From c0022ff63e84c281d10a73c21f14293b0aa3f422 Mon Sep 17 00:00:00 2001 From: qwerfunch Date: Tue, 21 Jul 2026 11:15:51 +0900 Subject: [PATCH 1/6] fix(init): honor host draft capabilities on existing-project adoption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The scan branch of runInit wrote spec/capabilities.yaml from the scan interpreter, whose total-fallback always fires for a host draft (the draft never emits the CONVENTIONS_MD sentinel) and re-derives capabilities from README headings — or `capabilities: []` when there are none — silently discarding the draft's schema-validated 3-8 approved capabilities. The greenfield branch already honors them; the scan branch now does too, preferring onboarding.capabilitiesYaml when the dispatch genuinely fired (source === 'llm'). conventions.md and architecture.yaml stay scanner-owned (code-grounded). Adds F-70ed1afd (adoption-honors-host-capabilities) with EARS ACs and a regression assertion in the sparse-codebase init-tools test. Regenerates the case-existing-adoption A/B report — the capabilities body byte-count shifted (fewer explainer comments, added summary/surface); the A/B verdict, capability count, and detector outcomes are unchanged. Co-Authored-By: Claude Opus 4.8 --- docs/ab-evaluation/case-existing-adoption.md | 10 +++--- plugins/claude-code/dist/clad.js | 32 ++++++++--------- spec.yaml | 2 +- spec/attestation.yaml | 7 ++-- ...ion-honors-host-capabilities-70ed1afd.yaml | 34 +++++++++++++++++++ spec/index.yaml | 1 + src/cli/init.ts | 15 +++++++- tests/serve/init-tools.test.ts | 11 ++++++ 8 files changed, 86 insertions(+), 26 deletions(-) create mode 100644 spec/features/adoption-honors-host-capabilities-70ed1afd.yaml diff --git a/docs/ab-evaluation/case-existing-adoption.md b/docs/ab-evaluation/case-existing-adoption.md index 54cd639..536de8a 100644 --- a/docs/ab-evaluation/case-existing-adoption.md +++ b/docs/ab-evaluation/case-existing-adoption.md @@ -51,8 +51,8 @@ No spec, no architecture invariants — just code on the existing tree. | Test files | 1 | 1 | +0 | | Test LoC | 14 | 14 | +0 | | Test cases | 1 | 1 | +0 | -| Total chars (artifacts + code) | 11268 | 3864 | +7404 | -| Estimated tokens | 2819 | 967 | +1852 | +| Total chars (artifacts + code) | 11212 | 3864 | +7348 | +| Estimated tokens | 2805 | 967 | +1838 | **Detector outcomes** (META_INTEGRITY + HARDCODED_SECRET excluded — toolchain-only checks): @@ -90,8 +90,8 @@ B (Vanilla) — errors: 1 warns: 3 infos: 28 | Test files | 2 | 2 | +0 | | Test LoC | 27 | 27 | +0 | | Test cases | 3 | 3 | +0 | -| Total chars (artifacts + code) | 12811 | 5115 | +7696 | -| Estimated tokens | 3205 | 1280 | +1925 | +| Total chars (artifacts + code) | 12732 | 5115 | +7617 | +| Estimated tokens | 3185 | 1280 | +1905 | **Detector outcomes** (META_INTEGRITY + HARDCODED_SECRET excluded — toolchain-only checks): @@ -111,7 +111,7 @@ B (Vanilla) — errors: 1 warns: 3 infos: 28 - **Spec ↔ code traceability**: cladding emits 1 feature(s), 2 AC(s), 1 scenario(s), 3 capability(s); vanilla has 0 of each. - **Architecture enforcement**: cladding declares 3 layer(s) with 0 forbidden-import rule(s); vanilla has 0. - **Detector behavior**: cladding-managed tree → 1 error(s) / 1 warn(s) / 11 info(s). Vanilla tree → 1 / 3 / 28. The detectors that gate against spec (REFERENCE_INTEGRITY, MISSING_IMPLEMENTATION, ARCHITECTURE_FROM_SPEC, CAPABILITIES_FEATURE_MAPPING) need cladding's artifacts to evaluate — without them they silently pass. The "0 errors on vanilla" therefore is **absence of signal**, not absence of drift. -- **Token cost**: cladding's cumulative artifact + code consumes ~3205 tokens vs vanilla's ~1280 (heuristic chars/4) — Δ ≈ 1925 tokens, the price of structure. +- **Token cost**: cladding's cumulative artifact + code consumes ~3185 tokens vs vanilla's ~1280 (heuristic chars/4) — Δ ≈ 1905 tokens, the price of structure. - **Code surface**: vanilla writes 9 source file(s) / 144 LoC + 2 test file(s) / 3 test case(s); cladding writes 9 / 128 + 2 / 3. (Vanilla front-loads code, cladding front-loads spec — both converge by M2.) ## Outcome Quality (F-ba2e05) diff --git a/plugins/claude-code/dist/clad.js b/plugins/claude-code/dist/clad.js index fe80975..64dd26b 100755 --- a/plugins/claude-code/dist/clad.js +++ b/plugins/claude-code/dist/clad.js @@ -70,7 +70,7 @@ ${hf.indentComment(T,r.indent)}`}w===""&&!r.inFlow?O===` `):O+=` ${r.indent}`}else if(!p&&po.isCollection(e)){let T=w[0],A=w.indexOf(` -`),D=A!==-1,$=r.inFlow??e.flow??e.items.length===0;if(D||!$){let ie=!1;if(D&&(T==="&"||T==="!")){let K=w.indexOf(" ");T==="&"&&K!==-1&&K{"use strict";var W4=Ge("process");function Vfe(t,...e){t==="debug"&&console.log(...e)}function Wfe(t,e){(t==="debug"||t==="warn")&&(typeof W4.emitWarning=="function"?W4.emitWarning(e):console.warn(e))}iT.debug=Vfe;iT.warn=Wfe});var Fy=v(My=>{"use strict";var jy=De(),K4=Dt(),Dy="<<",Ny={identify:t=>t===Dy||typeof t=="symbol"&&t.description===Dy,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new K4.Scalar(Symbol(Dy)),{addToJSMap:J4}),stringify:()=>Dy},Kfe=(t,e)=>(Ny.identify(e)||jy.isScalar(e)&&(!e.type||e.type===K4.Scalar.PLAIN)&&Ny.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Ny.tag&&r.default);function J4(t,e,r){let n=Y4(t,r);if(jy.isSeq(n))for(let i of n.items)sT(t,e,i);else if(Array.isArray(n))for(let i of n)sT(t,e,i);else sT(t,e,n)}function sT(t,e,r){let n=Y4(t,r);if(!jy.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function Y4(t,e){return t&&jy.isAlias(e)?e.resolve(t.doc,t):e}My.addMergeToJSMap=J4;My.isMergeKey=Kfe;My.merge=Ny});var cT=v(e6=>{"use strict";var Jfe=oT(),X4=Fy(),Yfe=mf(),Q4=De(),aT=Zo();function Xfe(t,e,{key:r,value:n}){if(Q4.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(X4.isMergeKey(t,r))X4.addMergeToJSMap(t,e,n);else{let i=aT.toJS(r,"",t);if(e instanceof Map)e.set(i,aT.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=Qfe(r,i,t),s=aT.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function Qfe(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Q4.isNode(t)&&r?.doc){let n=Yfe.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),Jfe.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}e6.addPairToJSMap=Xfe});var Jo=v(lT=>{"use strict";var t6=lf(),epe=V4(),tpe=cT(),Ly=De();function rpe(t,e,r){let n=t6.createNode(t,void 0,r),i=t6.createNode(e,void 0,r);return new zy(n,i)}var zy=class t{constructor(e,r=null){Object.defineProperty(this,Ly.NODE_TYPE,{value:Ly.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Ly.isNode(r)&&(r=r.clone(e)),Ly.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return tpe.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?epe.stringifyPair(this,e,r,n):JSON.stringify(this)}};lT.Pair=zy;lT.createPair=rpe});var uT=v(n6=>{"use strict";var fa=De(),r6=mf(),Uy=uf();function npe(t,e,r){return(e.inFlow??t.flow?ope:ipe)(t,e,r)}function ipe({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(b+=Uy.lineComment(b,o,l(g))),d&&g&&(d=!1),f.push(n+b)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;m{"use strict";var Zme=Qo(),Vme=Tf(),Wme=KT();function Kme({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Zme.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=Vme.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&Wme.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}fB.resolveBlockSeq=Kme});var ol=v(mB=>{"use strict";function Jme(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}mB.resolveEnd=Jme});var _B=v(yB=>{"use strict";var Yme=De(),Xme=Jo(),hB=Xo(),Qme=Qo(),ehe=ol(),gB=Tf(),the=l_(),rhe=JT(),YT="Block collections are not allowed within flow collections",XT=t=>t&&(t.type==="block-map"||t.type==="block-seq");function nhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?hB.YAMLMap:Qme.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g0){let g=ehe.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` +`+D.comment:A.comment=D.comment);let re=new Xme.Pair(A,$);if(r.options.keepSourceTokens&&(re.srcToken=b),s){let K=l;rhe.mapIncludes(r,K.items,A)&&i(T,"DUPLICATE_KEY","Map keys must be unique"),K.items.push(re)}else{let K=new hB.YAMLMap(r.schema);K.flow=!0,K.items.push(re);let xe=($??A).range;K.range=[A.range[0],xe[1],xe[2]],l.items.push(K)}d=$?$.range[2]:D.end}}let f=s?"}":"]",[p,...m]=n.end,h=d;if(p?.source===f)h=p.offset+p.source.length;else{let g=a[0].toUpperCase()+a.substring(1),b=u?`${g} must end with a ${f}`:`${g} in block collection must be sufficiently indented and end with a ${f}`;i(d,u?"MISSING_CHAR":"BAD_INDENT",b),p&&p.source.length!==1&&m.unshift(p)}if(m.length>0){let g=ehe.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` `+g.comment:l.comment=g.comment),l.range=[n.offset,h,g.offset]}else l.range=[n.offset,h,h];return l}yB.resolveFlowCollection=nhe});var vB=v(bB=>{"use strict";var ihe=De(),ohe=Dt(),she=Xo(),ahe=Qo(),che=dB(),lhe=pB(),uhe=_B();function QT(t,e,r,n,i,o){let s=r.type==="block-map"?che.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?lhe.resolveBlockSeq(t,e,r,n,o):uhe.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function dhe(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,m=f&&o?f.offset>o.offset?f:o:f??o;m&&(!p||p.offsetf.tag===s&&f.collection===a);if(!c){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),QT(t,e,r,i,s)}let l=QT(t,e,r,i,s,c),u=c.resolve?.(l,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??l,d=ihe.isNode(u)?u:new ohe.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}bB.composeCollection=dhe});var tO=v(SB=>{"use strict";var eO=Dt();function fhe(t,e,r){let n=e.offset,i=phe(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?eO.Scalar.BLOCK_FOLDED:eO.Scalar.BLOCK_LITERAL,s=e.source?mhe(e.source):[],a=s.length;for(let h=s.length-1;h>=0;--h){let g=s[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&s.length>0?` `.repeat(Math.max(1,s.length-1)):"",g=n+i.length;return e.source&&(g+=e.source.length),{value:h,type:o,comment:i.comment,range:[n,g,g]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let h=0;hc&&(c=g.length);else{g.length=a;--h)s[h][0].length>c&&(a=h+1);let d="",f="",p=!1;for(let h=0;hr.length>0).map(r=>JSON.parse(r))}function ba(t){return TO(RO(t))}function $_(t){return[...TO(OO(t,fH,pH)),...TO(RO(t))]}function Qr(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function Jge(t){let e;try{e=dH("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=Zge().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function Yge(t){try{return dH("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function Nf(t,e){try{let r=ba(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function er(t,e,r){try{let n=Yge(t),i=Jge(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=Nf(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Xr(t,Qr(e,o))}catch{}}var fH,Wge,pH,Kge,Nr=y(()=>{"use strict";fH=".cladding",Wge="events.log.jsonl",pH="events.log.1.jsonl",Kge=5*1024*1024});import{execFileSync as Xge}from"node:child_process";import{existsSync as mH,readdirSync as Qge,readFileSync as eye,statSync as hH}from"node:fs";import{createHash as tye}from"node:crypto";import{join as IO}from"node:path";function va(t){try{return Xge("git",["rev-parse","HEAD"],{cwd:t,stdio:["ignore","pipe","ignore"]}).toString("utf8").trim()||null}catch{return null}}function PO(t){let e=[],r=IO(t,"spec.yaml");mH(r)&&hH(r).isFile()&&e.push(r);for(let i of["features","scenarios"]){let o=IO(t,"spec",i);if(!(!mH(o)||!hH(o).isDirectory()))for(let s of Qge(o))s.endsWith(".yaml")&&e.push(IO(o,s))}e.sort();let n=tye("sha256");for(let i of e){let o=i.slice(t.length+1);n.update(`${o}\0`),n.update(eye(i)),n.update("\0")}return n.digest("hex")}function k_(t,e){let r={featureId:e,gitHead:va(t),specDigest:PO(t),timestamp:new Date().toISOString()};return Xr(t,Qr("feature_checkpoint",{feature:e,git_head:r.gitHead,spec_digest:r.specDigest})),r}function E_(t,e){let r=ba(t);for(let n=r.length-1;n>=0;n--){let i=r[n];if(i.type==="feature_checkpoint"&&i.payload.feature===e)return{featureId:e,gitHead:i.payload.git_head??null,specDigest:String(i.payload.spec_digest??""),timestamp:i.timestamp}}return null}function A_(t,e,r,n){let i=Qr("feature_rolled_back",{feature:e,to_git_head:r.gitHead,to_spec_digest:r.specDigest,to_checkpoint_at:r.timestamp,reason:n??null});return Xr(t,i),i}var jf=y(()=>{"use strict";Nr()});import{readFileSync as rye,statSync as nye}from"node:fs";import{extname as iye,resolve as CO,sep as oye}from"node:path";function en(t){return Math.ceil(t.length/4)}function cye(t,e){let r=CO(e),n=CO(r,t);return n===r||n.startsWith(r+oye)}function yH(t,e,r,n){if(!cye(t,e))return{path:t,omitted:"unsafe-path"};if(!sye.has(iye(t).toLowerCase()))return{path:t,omitted:"unsupported"};let i,o;if(n){let l=n(t);if(l==null)return{path:t,omitted:"missing"};if(i=l,o=Buffer.byteLength(l,"utf8"),o>gH)return{path:t,omitted:"too-large",bytes:o}}else{let l=CO(e,t);try{o=nye(l).size}catch{return{path:t,omitted:"missing"}}if(o>gH)return{path:t,omitted:"too-large",bytes:o};try{i=rye(l,"utf8")}catch{return{path:t,omitted:"missing",bytes:o}}}if(i.includes(aye))return{path:t,omitted:"binary",bytes:o};let s=Math.max(0,Math.floor(r));if(i.length<=s)return{path:t,text:i,bytes:o};let a=` /* ... clipped (${o} bytes total) ... */ `,c=Math.max(0,s-a.length);return{path:t,text:i.slice(0,c)+a,truncated:!0,bytes:o}}var sye,gH,aye,T_=y(()=>{"use strict";sye=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".rs",".go",".java",".kt",".kts",".cs",".rb",".php",".swift",".c",".h",".cpp",".hpp",".css",".scss",".sql",".sh",".yaml",".yml",".json",".md",".toml"]),gH=2e6,aye="\0"});function uye(t){for(let i of lye)if(t.startsWith(i))return null;let e=t.indexOf("#"),n=(e>=0?t.slice(0,e):t).trim();return n.length>0?n:null}function DO(t,e,r){let n=t.get(e);n||(n=new Set,t.set(e,n)),n.add(r)}function dye(t){let e=new Map,r=new Map,n=new Map;for(let i of t.features??[]){let o=i.id;for(let s of i.depends_on??[])DO(e,s,o);for(let s of i.modules??[])DO(r,s,o);for(let s of i.acceptance_criteria??[])for(let a of s.test_refs??[]){let c=uye(a);c&&DO(n,c,o)}}return{dependents:e,moduleOwners:r,testRefCitations:n}}function En(t){let e=_H.get(t);return e||(e=dye(t),_H.set(t,e)),e}var lye,_H,Sa=y(()=>{"use strict";lye=["derived:","fixture:","script:","self-dogfood:"];_H=new WeakMap});function NO(t,e,r=1/0){let n=new Set,i=new Set(t),o=[...i],s=0;for(;o.length>0&&sn.id===e)??r.find(n=>n.slug===e)??null}function br(t,e,r={}){let n=r.depth??1/0,i=En(t),o=new Map((t.features??[]).map(_=>[_.id,_])),s=[],a,c=fye(t,e);if(c)s=[c];else{let _=i.moduleOwners.get(e);_&&_.size>0&&(a=e,s=[..._].map(S=>o.get(S)).filter(S=>!!S))}if(s.length===0)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/spec/load.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (run clad sync if missing); module paths live in each shard\u2019s modules:; if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let l=s.map(_=>_.id),u=NO(l,i.dependents,n),d=[...u].map(_=>o.get(_)).filter(_=>!!_).map(_=>({id:_.id,title:_.title,status:_.status})).sort((_,S)=>_.id.localeCompare(S.id)),f=new Set([...l,...u]),p=[...f].map(_=>o.get(_)).filter(_=>!!_),m=[...new Set(p.flatMap(_=>_.modules??[]))].sort(),h=(t.scenarios??[]).filter(_=>(_.features??[]).some(S=>f.has(S))).map(_=>({id:_.id,title:_.title})).sort((_,S)=>_.id.localeCompare(S.id)),g=[...new Set(p.flatMap(_=>(_.acceptance_criteria??[]).flatMap(S=>S.test_refs??[])))].sort();return{focus:a?{module:a,owners:[...l].sort()}:{id:s[0].id,title:s[0].title,status:s[0].status},impacted:d,impacted_modules:m,scenarios:h,test_refs:g,ledger:jO(i)}}var wa=y(()=>{"use strict";Sa()});function bH(t){return t.impacted.length}function R_(t,e,r={}){let n=r.initialDepth??O_.initialDepth,i=r.maxDepth??O_.maxDepth,o=r.coverageThreshold??O_.coverageThreshold,s=r.marginYieldThreshold??O_.marginYieldThreshold,a=En(t),c=new Map((t.features??[]).map(b=>[b.id,b])),l=[],u=(t.features??[]).find(b=>b.id===e||b.slug===e);if(u)l=[u.id];else{let b=a.moduleOwners.get(e);b&&b.size>0&&(l=[...b].filter(_=>c.has(_)))}if(l.length===0){let b=br(t,e,{depth:1});return"not_found"in b,b}let d=NO(l,a.dependents,1/0).size;if(d===0){let b=br(t,e,{depth:n});return"not_found"in b?b:{slice:b,depthUsed:n,stoppedBy:"no-known-dependents",analysis:{frontierExhausted:!0,coverage:null,marginalYields:[0],totalKnownDependents:0}}}let f=[],p=0,m=null;for(let b=n;b<=i;b++){let _=br(t,e,{depth:b});if("not_found"in _)return _;m=_;let S=bH(_),x=S-p,w=S>0?x/S:0;f.push(w);let O=d>0?S/d:1,T=x===0&&b>n,A={frontierExhausted:T,coverage:O,marginalYields:[...f],totalKnownDependents:d};if(T)return{slice:_,depthUsed:b,stoppedBy:"exhaustion",analysis:A};if(O>=o)return{slice:_,depthUsed:b,stoppedBy:"coverage",analysis:A};if(f.length>=2&&f[f.length-1]0?g/d:1,marginalYields:[...f],totalKnownDependents:d}}}var O_,MO=y(()=>{"use strict";wa();Sa();O_={initialDepth:1,maxDepth:10,coverageThreshold:.9,marginYieldThreshold:.05}});function pye(t,e){let r=new Set,n=[t];for(;n.length>0;){let i=n.pop();if(!i||r.has(i))continue;r.add(i);let o=e.get(i);for(let s of o?.depends_on??[])n.push(s)}return r}function vH(t,e){let r=new Map(t.features.map(a=>[a.id,a]));if(!r.has(e))return t;let n=pye(e,r),i=t.features.filter(a=>n.has(a.id)),o=(t.scenarios??[]).filter(a=>(a.features??[]).some(c=>n.has(c)));return{...t,features:i,scenarios:o}}var SH=y(()=>{"use strict"});function mye(t,e){let r=t.features??[];return r.find(n=>n.id===e)??r.find(n=>n.slug===e)??r.find(n=>(n.modules??[]).includes(e))??null}function ll(t,e){let r=mye(t,e);if(!r)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/auth/login.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (id, slug, status; run clad sync if missing); if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let n=vH(t,r.id),i=(n.features??[]).filter(c=>c.id!==r.id).map(c=>({id:c.id,title:c.title,status:c.status})).sort((c,l)=>c.id.localeCompare(l.id)),o=(n.scenarios??[]).map(c=>({id:c.id,title:c.title})).sort((c,l)=>c.id.localeCompare(l.id)),s=(t.project?.ai_hints?.preferred_patterns??[]).map(c=>({when:c.when,prefer:c.prefer,...c.over!==void 0?{over:c.over}:{}})),a=[...new Set((r.acceptance_criteria??[]).flatMap(c=>c.test_refs??[]))].sort();return{focus:r,ancestors:i,scenarios:o,preferred_patterns:s,test_refs:a}}var I_=y(()=>{"use strict";SH()});import{existsSync as xH,readdirSync as hye,readFileSync as gye}from"node:fs";import{join as LO}from"node:path";function zO(t,e=_ye){let r=t.trim().replace(/\s+/g," ");return r.length<=e?r:`${r.slice(0,e-1)}\u2026`}function bye(t){let e=t.payload??{};if(t.type==="drift_detected"){let n=typeof e.gate=="string"&&e.gate?e.gate:"drift";return{detector:n,message:zO(`drift detected at gate ${n}`)}}let r=typeof e.worst=="number"?` (worst ${e.worst})`:"";return{detector:"done_attempted",message:zO(`done reverted \u2014 pre-push strict gate red${r}`)}}function wH(t){let e=Date.parse(t.timestamp);return Number.isFinite(e)?e:0}function vye(t){let e=[];t.lastFailedGate&&e.push(`failed ${t.lastFailedGate}`),typeof t.retryCount=="number"&&e.push(`${t.retryCount} retries`);let r=e.length?` (${e.join(", ")})`:"",n=t.recovery?`recover: ${t.recovery}${r}`:`rolled back${r}`;return zO(n)}function Sye(t,e,r,n={}){let i=t.filter(m=>m&&m.payload&&m.payload.feature===r),o=e.filter(m=>m&&m.featureId===r).slice().sort((m,h)=>wH(m)-wH(h)),s=i.filter(m=>m.type==="drift_detected"||m.type==="done_attempted"&&m.payload.kept===!1),a=i.filter(m=>m.type==="feature_rolled_back");if(s.length===0&&a.length===0&&o.length===0)return;let c=o.length?o[o.length-1]:void 0,l;for(let m=s.length-1;m>=0;m--){let h=s[m].payload.gate;if(s[m].type==="drift_detected"&&typeof h=="string"&&h){l=h;break}}!l&&c?.lastFailedGate&&(l=c.lastFailedGate);let u=s.slice(-yye).map(bye),d;for(let m=a.length-1;m>=0;m--){let h=a[m].payload.to_git_head;if(typeof h=="string"&&h){d=h;break}}let f=typeof c?.retryCount=="number"?c.retryCount:void 0,p=c?vye(c):void 0;return{attempts:s.length,...l?{last_failed_gate:l}:{},...f!==void 0?{retry_count:f}:{},...u.length?{drift_history:u}:{},...d?{rolled_back_at:d}:{},...p?{recovery_hint:p}:{},...n.truncated?{truncated_history:!0}:{}}}function FO(t,e){let r=t.match(e);return r&&r[1]?r[1].trim():void 0}function wye(t){let e=t.indexOf("## Recommended recovery");if(e<0)return;let r=t.slice(e).match(/```[^\n]*\n([\s\S]*?)```/);return r&&r[1].split(` -`).map(i=>i.trim()).find(i=>i.length>0)||void 0}function xye(t,e,r){let n=FO(t,/_Rolled back at_\s*`([^`]+)`/),i=FO(t,/Last failed gate:\s*`([^`]+)`/),o=FO(t,/Retry attempts:\s*(\d+)/),s=wye(t);return{featureId:e,timestamp:n??r,...i?{lastFailedGate:i}:{},...o?{retryCount:Number(o)}:{},...s?{recovery:s}:{}}}function $ye(t,e){let r=LO(t,".cladding","post-mortems");if(!xH(r))return[];let n=`post-mortem-${e}-`,i=[];for(let o of hye(r))if(!(!o.startsWith(n)||!o.endsWith(".md")))try{i.push(xye(gye(LO(r,o),"utf8"),e,o))}catch{}return i}function $H(t,e){try{let r=$_(t),n=$ye(t,e),i=xH(LO(t,".cladding","events.log.1.jsonl"));return Sye(r,n,e,{truncated:i})}catch{return}}var yye,_ye,kH=y(()=>{"use strict";Nr();yye=5,_ye=120});function P_(t,e,r){return en(JSON.stringify({...t,needs:e,must_edit:{...t.must_edit,code:r}}))}function xa(t,e,r={}){let n=r.cwd??".",i=r.maxTokens&&r.maxTokens>0?r.maxTokens:kye,o=e,s,a=En(t).moduleOwners.get(e);if(a&&a.size>0){let se=[...a].sort();o=se[0],se.length>1&&(s=se)}let c=ll(t,o);if("not_found"in c)return c;let l=c.focus,u=$H(n,l.id),d=a&&a.size>0?e:l.id,f=R_(t,d),p="not_found"in f?null:f.slice,m=p?p.impacted:[],h=p?p.test_refs:[],g="not_found"in f?null:{depth:f.depthUsed,stopped_by:f.stoppedBy,coverage:f.analysis.coverage===null?null:Math.round(f.analysis.coverage*100)/100,total_known_dependents:f.analysis.totalKnownDependents},b=l.acceptance_criteria??[],_=b.filter(se=>se.ears==="unwanted"||se.ears==="state").map(se=>({id:se.id,ears:String(se.ears)})),S=[...new Set(b.flatMap(se=>se.oracle_refs??[]))].sort(),x=[],w={must_edit:{id:l.id,title:l.title,status:l.status,modules:l.modules??[],acceptance_criteria:b,code:[],...s?{co_owners:s}:{}},needs:c.ancestors,breaks_if_changed:{impacted:m,regression_tests:h,...g?{radius:g}:{}},verify:{scenarios:c.scenarios,test_refs:c.test_refs,oracle_refs:S,high_risk_acs:_},guidance:{preferred_patterns:c.preferred_patterns},budget:{max_tokens:i,used_tokens:0,truncated:x}},O=[...c.ancestors];for(;O.length>Eye&&P_(w,O,[])>i;)O.pop();O.lengthi){x.push(`code: omitted ${se} (budget)`);continue}A.push(Kt),Kt.truncated&&x.push(`code: clipped ${se}`)}T>i&&x.push("must-edit exceeds budget \u2014 retained in full (focus is never dropped)");let D=(se,Ce)=>({impacted:se,regression_tests:Ce,...g?{radius:g}:{},...p?.ledger?{ledger:p.ledger}:{}}),$=(se,Ce,Kt,dr)=>{let Yt=Kt+dr>0?[`breaks: omitted ${Kt} feature(s) / ${dr} test(s)`]:[],co={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:D(se,Ce),budget:{...w.budget,truncated:[...x,...Yt]}};return en(JSON.stringify(co))>i},ie=m,K=h;if($(ie,K,0,0)){let se=br(t,d,{depth:1}),Ce=new Set("not_found"in se?[]:se.impacted.map(de=>de.id)),Kt=new Set("not_found"in se?[]:se.test_refs),Yt=[...m.filter(de=>Ce.has(de.id)),...m.filter(de=>!Ce.has(de.id))],co=0;for(;Yt.length>Ce.size&&$(Yt,K,co,0);)Yt=Yt.slice(0,-1),co++;let wi=[...h],Yr=0;for(;$(Yt,wi,co,Yr);){let de=-1;for(let lo=wi.length-1;lo>=0;lo--)if(!Kt.has(wi[lo])){de=lo;break}if(de<0)break;wi.splice(de,1),Yr++}ie=Yt,K=wi,co+Yr>0&&x.push(`breaks: omitted ${co} feature(s) / ${Yr} test(s)`),$(ie,K,0,0)&&x.push("breaks: direct set retained in full \u2014 exceeds budget")}let xe=D(ie,K),C={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:xe},P=C;if(u){let se={...C,prior_attempts:u};en(JSON.stringify(se))<=i?P=se:x.push("prior_attempts: omitted (budget)")}let Ir=en(JSON.stringify(P));return{...P,budget:{max_tokens:i,used_tokens:Ir,truncated:x}}}var kye,Eye,C_=y(()=>{"use strict";T_();I_();MO();kH();wa();Sa();kye=3e3,Eye=3});function Jn(t){if(t.length===0)return 0;let e=[...t].sort((n,i)=>n-i),r=Math.floor(e.length/2);return e.length%2?e[r]:(e[r-1]+e[r])/2}function Aye(t,e){if(t.length===0)return 0;let r=[...t].sort((n,i)=>n-i);return r[Math.min(r.length-1,Math.floor(e/100*r.length))]}function EH(t,e,r="."){let n=En(t),i=t.features??[],o=[];for(let f of i){let p=xa(t,f.id,{cwd:r,read:e});if("not_found"in p)continue;let m=xa(t,f.id,{cwd:r,read:e,maxTokens:Number.MAX_SAFE_INTEGER}),h=R_(t,f.id),g=!("not_found"in h),b=en(JSON.stringify(p)),_="not_found"in m?b:en(JSON.stringify(m)),S=en(JSON.stringify(f));for(let O of f.modules??[]){let T=e(O);T&&(S+=en(T))}let x=(f.depends_on??[]).length,w=n.dependents.get(f.id)?.size??0;o.push({id:f.id,sliceTokens:b,structuralTokens:_,naiveTokens:S,contextRatio:S>0?b/S:1,budgetSaturated:p.budget.truncated.length>0,searchDepth:g?h.depthUsed:1,edgesResolved:x+w,stoppedBy:g?h.stoppedBy:"n/a",coverage:g?h.analysis.coverage:1,regressionTests:p.breaks_if_changed.regression_tests.length})}o.sort((f,p)=>f.id.localeCompare(p.id));let s=o.map(f=>f.contextRatio),a=f=>f.filter(p=>p.sliceTokens>0).map(p=>p.naiveTokens/p.sliceTokens),c=o.filter(f=>!f.budgetSaturated),l=o.filter(f=>f.budgetSaturated),u=o.filter(f=>f.naiveTokens>0).map(f=>f.structuralTokens/f.naiveTokens),d={};for(let f of o)d[f.stoppedBy]=(d[f.stoppedBy]??0)+1;return{featureCount:i.length,measured:o.length,context:{medianContextRatio:Math.round(Jn(s)*1e3)/1e3,medianShrinkFactor:Math.round(Jn(a(o))*10)/10,fitsCount:c.length,truncatedCount:l.length,medianShrinkFit:Math.round(Jn(a(c))*10)/10,medianShrinkTruncated:Math.round(Jn(a(l))*10)/10,medianStructuralRatio:Math.round(Jn(u)*100)/100,medianSliceTokens:Math.round(Jn(o.map(f=>f.sliceTokens))),medianNaiveTokens:Math.round(Jn(o.map(f=>f.naiveTokens)))},search:{medianDepth:Jn(o.map(f=>f.searchDepth)),p95Depth:Aye(o.map(f=>f.searchDepth),95),medianEdges:Jn(o.map(f=>f.edgesResolved)),maxEdges:o.reduce((f,p)=>Math.max(f,p.edgesResolved),0)},stability:{byStopReason:d,medianCoverage:Math.round(Jn(o.map(f=>f.coverage).filter(f=>f!==null))*100)/100,medianRegressionTests:Jn(o.map(f=>f.regressionTests))},features:o}}var ul,D_=y(()=>{"use strict";T_();MO();C_();Sa();ul="(deterministic upper bound vs the shard+all-modules baseline \u2014 not an agent-adoption measurement)"});import{appendFileSync as Tye,existsSync as UO,mkdirSync as Oye,readFileSync as AH}from"node:fs";import{dirname as Rye,join as Iye}from"node:path";function qO(t){return Iye(t,Pye,Cye)}function Dye(t,e){return{timestamp:new Date().toISOString(),head:va(t),spec_digest:PO(t),featureCount:e.featureCount,measured:e.measured,context:e.context,search:e.search,stability:e.stability}}function TH(t,e){try{let r=Dye(t,e);if(r.head===null)return{appended:!1,reason:"no_head"};let n=BO(t),i=n[n.length-1];if(i&&i.head===r.head&&i.spec_digest===r.spec_digest)return{appended:!1,reason:"deduped"};let o=qO(t),s=Rye(o);return UO(s)||Oye(s,{recursive:!0}),Tye(o,`${JSON.stringify(r)} +`).map(i=>i.trim()).find(i=>i.length>0)||void 0}function xye(t,e,r){let n=FO(t,/_Rolled back at_\s*`([^`]+)`/),i=FO(t,/Last failed gate:\s*`([^`]+)`/),o=FO(t,/Retry attempts:\s*(\d+)/),s=wye(t);return{featureId:e,timestamp:n??r,...i?{lastFailedGate:i}:{},...o?{retryCount:Number(o)}:{},...s?{recovery:s}:{}}}function $ye(t,e){let r=LO(t,".cladding","post-mortems");if(!xH(r))return[];let n=`post-mortem-${e}-`,i=[];for(let o of hye(r))if(!(!o.startsWith(n)||!o.endsWith(".md")))try{i.push(xye(gye(LO(r,o),"utf8"),e,o))}catch{}return i}function $H(t,e){try{let r=$_(t),n=$ye(t,e),i=xH(LO(t,".cladding","events.log.1.jsonl"));return Sye(r,n,e,{truncated:i})}catch{return}}var yye,_ye,kH=y(()=>{"use strict";Nr();yye=5,_ye=120});function P_(t,e,r){return en(JSON.stringify({...t,needs:e,must_edit:{...t.must_edit,code:r}}))}function xa(t,e,r={}){let n=r.cwd??".",i=r.maxTokens&&r.maxTokens>0?r.maxTokens:kye,o=e,s,a=En(t).moduleOwners.get(e);if(a&&a.size>0){let se=[...a].sort();o=se[0],se.length>1&&(s=se)}let c=ll(t,o);if("not_found"in c)return c;let l=c.focus,u=$H(n,l.id),d=a&&a.size>0?e:l.id,f=R_(t,d),p="not_found"in f?null:f.slice,m=p?p.impacted:[],h=p?p.test_refs:[],g="not_found"in f?null:{depth:f.depthUsed,stopped_by:f.stoppedBy,coverage:f.analysis.coverage===null?null:Math.round(f.analysis.coverage*100)/100,total_known_dependents:f.analysis.totalKnownDependents},b=l.acceptance_criteria??[],_=b.filter(se=>se.ears==="unwanted"||se.ears==="state").map(se=>({id:se.id,ears:String(se.ears)})),S=[...new Set(b.flatMap(se=>se.oracle_refs??[]))].sort(),x=[],w={must_edit:{id:l.id,title:l.title,status:l.status,modules:l.modules??[],acceptance_criteria:b,code:[],...s?{co_owners:s}:{}},needs:c.ancestors,breaks_if_changed:{impacted:m,regression_tests:h,...g?{radius:g}:{}},verify:{scenarios:c.scenarios,test_refs:c.test_refs,oracle_refs:S,high_risk_acs:_},guidance:{preferred_patterns:c.preferred_patterns},budget:{max_tokens:i,used_tokens:0,truncated:x}},O=[...c.ancestors];for(;O.length>Eye&&P_(w,O,[])>i;)O.pop();O.lengthi){x.push(`code: omitted ${se} (budget)`);continue}A.push(Kt),Kt.truncated&&x.push(`code: clipped ${se}`)}T>i&&x.push("must-edit exceeds budget \u2014 retained in full (focus is never dropped)");let D=(se,Ce)=>({impacted:se,regression_tests:Ce,...g?{radius:g}:{},...p?.ledger?{ledger:p.ledger}:{}}),$=(se,Ce,Kt,dr)=>{let Yt=Kt+dr>0?[`breaks: omitted ${Kt} feature(s) / ${dr} test(s)`]:[],co={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:D(se,Ce),budget:{...w.budget,truncated:[...x,...Yt]}};return en(JSON.stringify(co))>i},re=m,K=h;if($(re,K,0,0)){let se=br(t,d,{depth:1}),Ce=new Set("not_found"in se?[]:se.impacted.map(de=>de.id)),Kt=new Set("not_found"in se?[]:se.test_refs),Yt=[...m.filter(de=>Ce.has(de.id)),...m.filter(de=>!Ce.has(de.id))],co=0;for(;Yt.length>Ce.size&&$(Yt,K,co,0);)Yt=Yt.slice(0,-1),co++;let wi=[...h],Yr=0;for(;$(Yt,wi,co,Yr);){let de=-1;for(let lo=wi.length-1;lo>=0;lo--)if(!Kt.has(wi[lo])){de=lo;break}if(de<0)break;wi.splice(de,1),Yr++}re=Yt,K=wi,co+Yr>0&&x.push(`breaks: omitted ${co} feature(s) / ${Yr} test(s)`),$(re,K,0,0)&&x.push("breaks: direct set retained in full \u2014 exceeds budget")}let xe=D(re,K),C={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:xe},P=C;if(u){let se={...C,prior_attempts:u};en(JSON.stringify(se))<=i?P=se:x.push("prior_attempts: omitted (budget)")}let Ir=en(JSON.stringify(P));return{...P,budget:{max_tokens:i,used_tokens:Ir,truncated:x}}}var kye,Eye,C_=y(()=>{"use strict";T_();I_();MO();kH();wa();Sa();kye=3e3,Eye=3});function Jn(t){if(t.length===0)return 0;let e=[...t].sort((n,i)=>n-i),r=Math.floor(e.length/2);return e.length%2?e[r]:(e[r-1]+e[r])/2}function Aye(t,e){if(t.length===0)return 0;let r=[...t].sort((n,i)=>n-i);return r[Math.min(r.length-1,Math.floor(e/100*r.length))]}function EH(t,e,r="."){let n=En(t),i=t.features??[],o=[];for(let f of i){let p=xa(t,f.id,{cwd:r,read:e});if("not_found"in p)continue;let m=xa(t,f.id,{cwd:r,read:e,maxTokens:Number.MAX_SAFE_INTEGER}),h=R_(t,f.id),g=!("not_found"in h),b=en(JSON.stringify(p)),_="not_found"in m?b:en(JSON.stringify(m)),S=en(JSON.stringify(f));for(let O of f.modules??[]){let T=e(O);T&&(S+=en(T))}let x=(f.depends_on??[]).length,w=n.dependents.get(f.id)?.size??0;o.push({id:f.id,sliceTokens:b,structuralTokens:_,naiveTokens:S,contextRatio:S>0?b/S:1,budgetSaturated:p.budget.truncated.length>0,searchDepth:g?h.depthUsed:1,edgesResolved:x+w,stoppedBy:g?h.stoppedBy:"n/a",coverage:g?h.analysis.coverage:1,regressionTests:p.breaks_if_changed.regression_tests.length})}o.sort((f,p)=>f.id.localeCompare(p.id));let s=o.map(f=>f.contextRatio),a=f=>f.filter(p=>p.sliceTokens>0).map(p=>p.naiveTokens/p.sliceTokens),c=o.filter(f=>!f.budgetSaturated),l=o.filter(f=>f.budgetSaturated),u=o.filter(f=>f.naiveTokens>0).map(f=>f.structuralTokens/f.naiveTokens),d={};for(let f of o)d[f.stoppedBy]=(d[f.stoppedBy]??0)+1;return{featureCount:i.length,measured:o.length,context:{medianContextRatio:Math.round(Jn(s)*1e3)/1e3,medianShrinkFactor:Math.round(Jn(a(o))*10)/10,fitsCount:c.length,truncatedCount:l.length,medianShrinkFit:Math.round(Jn(a(c))*10)/10,medianShrinkTruncated:Math.round(Jn(a(l))*10)/10,medianStructuralRatio:Math.round(Jn(u)*100)/100,medianSliceTokens:Math.round(Jn(o.map(f=>f.sliceTokens))),medianNaiveTokens:Math.round(Jn(o.map(f=>f.naiveTokens)))},search:{medianDepth:Jn(o.map(f=>f.searchDepth)),p95Depth:Aye(o.map(f=>f.searchDepth),95),medianEdges:Jn(o.map(f=>f.edgesResolved)),maxEdges:o.reduce((f,p)=>Math.max(f,p.edgesResolved),0)},stability:{byStopReason:d,medianCoverage:Math.round(Jn(o.map(f=>f.coverage).filter(f=>f!==null))*100)/100,medianRegressionTests:Jn(o.map(f=>f.regressionTests))},features:o}}var ul,D_=y(()=>{"use strict";T_();MO();C_();Sa();ul="(deterministic upper bound vs the shard+all-modules baseline \u2014 not an agent-adoption measurement)"});import{appendFileSync as Tye,existsSync as UO,mkdirSync as Oye,readFileSync as AH}from"node:fs";import{dirname as Rye,join as Iye}from"node:path";function qO(t){return Iye(t,Pye,Cye)}function Dye(t,e){return{timestamp:new Date().toISOString(),head:va(t),spec_digest:PO(t),featureCount:e.featureCount,measured:e.measured,context:e.context,search:e.search,stability:e.stability}}function TH(t,e){try{let r=Dye(t,e);if(r.head===null)return{appended:!1,reason:"no_head"};let n=BO(t),i=n[n.length-1];if(i&&i.head===r.head&&i.spec_digest===r.spec_digest)return{appended:!1,reason:"deduped"};let o=qO(t),s=Rye(o);return UO(s)||Oye(s,{recursive:!0}),Tye(o,`${JSON.stringify(r)} `,"utf8"),{appended:!0,reason:"appended"}}catch{return{appended:!1,reason:"error"}}}function OH(t){let e=[];for(let r of t.split(` `)){let n=r.trim();if(n.length!==0)try{let i=JSON.parse(n);i&&typeof i=="object"&&i.context&&i.search&&i.stability&&e.push(i)}catch{}}return e}function BO(t,e){let r=qO(t);if(!UO(r))return[];let n;try{n=AH(r,"utf8")}catch{return[]}let i=OH(n);return typeof e=="number"&&e>=0?i.slice(-e):i}function RH(t){let e=qO(t);if(!UO(e))return{snapshots:[],unreadable:!1};let r;try{r=AH(e,"utf8")}catch{return{snapshots:[],unreadable:!0}}let n=OH(r),i=r.trim().length>0;return{snapshots:n,unreadable:i&&n.length===0}}function Mf(t,e=0){let r=e>0?Math.round(t*10**e)/10**e:Math.round(t),n=r.toFixed(e);return r>0?`+${n}`:n}function IH(t,e=5){let r=Math.max(0,t.length-e),i=[`measure trend \xB7 last ${t.slice(r).length} of ${t.length} snapshot(s)`];for(let o=r;o0?t[o-1]:null,c=(d,f=0)=>a?` (${Mf(d(s)-d(a),f)})`:"",l=s.timestamp.slice(0,19),u=s.head?s.head.slice(0,7):"nogit";i.push(` ${l} ${u} \xB7 ${s.featureCount} feat \xB7 slice ${s.context.medianSliceTokens}${c(d=>d.context.medianSliceTokens)} \xB7 struct ${s.context.medianStructuralRatio.toFixed(2)}${c(d=>d.context.medianStructuralRatio,2)} \xB7 cov ${s.stability.medianCoverage.toFixed(2)}${c(d=>d.stability.medianCoverage,2)} \xB7 p95depth ${s.search.p95Depth}${c(d=>d.search.p95Depth)} \xB7 trunc ${s.context.truncatedCount}${c(d=>d.context.truncatedCount)}`)}return i.push(` ${ul}`),i.join(` `)}var Pye,Cye,Ff=y(()=>{"use strict";jf();D_();Pye=".cladding",Cye="measure.jsonl"});import{existsSync as Nye}from"node:fs";import{join as jye}from"node:path";function dl(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${Mye[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` @@ -246,16 +246,16 @@ ${x}`,O=`${S}: ${a}${w}`,T=e===void 0?[t[2],t[1]]:[e],A=[O,...T,...t.slice(3),r. `)].map(D=>Hf(Rl(fwe(D)))).filter(Boolean).join(` `);return{originalMessage:x,shortMessage:O,message:A}},cwe=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=lwe(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${zV(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${db(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},lwe=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",uwe=(t,e)=>{if(t instanceof Qn)return;let r=a9(t)?t.originalMessage:String(t?.message??t),n=Hf(hV(r,e));return n===""?void 0:n},dwe=t=>typeof t=="string"?t:awe(t),fwe=t=>Array.isArray(t)?t.map(e=>Rl(BV(e))).filter(Boolean).join(` -`):BV(t),BV=t=>typeof t=="string"?t:Ut(t)?V_(t):""});var Hb,Pl,rp,pwe,ZV,mwe,np=y(()=>{Wf();ib();Ra();GV();Hb=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>ZV({command:t,escapedCommand:e,cwd:o,durationMs:_R(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),Pl=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>rp({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),rp=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:S},isSync:x})=>{let{exitCode:w,signal:O,signalDescription:T}=mwe(l,u),{originalMessage:A,shortMessage:D,message:$}=HV({stdio:d,all:f,ipcOutput:p,originalError:t,signal:O,signalDescription:T,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:S,timeout:h,cwd:_}),ie=o9(t,$,x);return Object.assign(ie,pwe({error:ie,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:O,signalDescription:T,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:A,shortMessage:D})),ie},pwe=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>ZV({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:_R(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),ZV=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),mwe=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:db(e);return{exitCode:r,signal:n,signalDescription:i}}});function hwe(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(VV(t*1e3)%1e3),nanoseconds:Math.trunc(VV(t*1e6)%1e3)}}function gwe(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function rI(t){switch(typeof t){case"number":{if(Number.isFinite(t))return hwe(t);break}case"bigint":return gwe(t)}throw new TypeError("Expected a finite number or bigint")}var VV,WV=y(()=>{VV=t=>Number.isFinite(t)?t:0});function nI(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+bwe);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&ywe(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+_we(d,u):f;i.push(p)}},a=rI(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%vwe):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var ywe,_we,bwe,vwe,KV=y(()=>{WV();ywe=t=>t===0||t===0n,_we=(t,e)=>e===1||e===1n?t:`${t}s`,bwe=1e-7,vwe=24n*60n*60n*1000n});var JV,YV=y(()=>{wl();JV=(t,e)=>{t.failed&&Ri({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var XV,Swe,QV=y(()=>{KV();ls();wl();YV();XV=(t,e)=>{vl(e)&&(JV(t,e),Swe(t,e))},Swe=(t,e)=>{let r=`(done in ${nI(t.durationMs)})`;Ri({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Cl,Gb=y(()=>{QV();Cl=(t,e,{reject:r})=>{if(XV(t,e),t.failed&&r)throw t;return t}});var rW,wwe,xwe,nW,iW,eW,$we,iI,tW,ja,oW,kwe,Zb,sW,Ewe,Awe,oI,aW,Twe,cW,Vb,Owe,sI,Rwe,Iwe,lW,Tn,Wb,aI,uW,dW,ps,vr=y(()=>{Da();go();rn();rW=(t,e)=>ja(t)?"asyncGenerator":oW(t)?"generator":Zb(t)?"fileUrl":Ewe(t)?"filePath":Owe(t)?"webStream":ti(t,{checkOpen:!1})?"native":Ut(t)?"uint8Array":Rwe(t)?"asyncIterable":Iwe(t)?"iterable":sI(t)?nW({transform:t},e):kwe(t)?wwe(t,e):"native",wwe=(t,e)=>YR(t.transform,{checkOpen:!1})?xwe(t,e):sI(t.transform)?nW(t,e):$we(t,e),xwe=(t,e)=>(iW(t,e,"Duplex stream"),"duplex"),nW=(t,e)=>(iW(t,e,"web TransformStream"),"webTransform"),iW=({final:t,binary:e,objectMode:r},n,i)=>{eW(t,`${n}.final`,i),eW(e,`${n}.binary`,i),iI(r,`${n}.objectMode`)},eW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},$we=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!tW(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(YR(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(sI(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!tW(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return iI(r,`${i}.binary`),iI(n,`${i}.objectMode`),ja(t)||ja(e)?"asyncGenerator":"generator"},iI=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},tW=t=>ja(t)||oW(t),ja=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",oW=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",kwe=t=>Ot(t)&&(t.transform!==void 0||t.final!==void 0),Zb=t=>Object.prototype.toString.call(t)==="[object URL]",sW=t=>Zb(t)&&t.protocol!=="file:",Ewe=t=>Ot(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Awe.has(e))&&oI(t.file),Awe=new Set(["file","append"]),oI=t=>typeof t=="string",aW=(t,e)=>t==="native"&&typeof e=="string"&&!Twe.has(e),Twe=new Set(["ipc","ignore","inherit","overlapped","pipe"]),cW=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Vb=t=>Object.prototype.toString.call(t)==="[object WritableStream]",Owe=t=>cW(t)||Vb(t),sI=t=>cW(t?.readable)&&Vb(t?.writable),Rwe=t=>lW(t)&&typeof t[Symbol.asyncIterator]=="function",Iwe=t=>lW(t)&&typeof t[Symbol.iterator]=="function",lW=t=>typeof t=="object"&&t!==null,Tn=new Set(["generator","asyncGenerator","duplex","webTransform"]),Wb=new Set(["fileUrl","filePath","fileNumber"]),aI=new Set(["fileUrl","filePath"]),uW=new Set([...aI,"webStream","nodeStream"]),dW=new Set(["webTransform","duplex"]),ps={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var cI,Pwe,Cwe,fW,lI=y(()=>{vr();cI=(t,e,r,n)=>n==="output"?Pwe(t,e,r):Cwe(t,e,r),Pwe=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},Cwe=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},fW=(t,e)=>{let r=t.findLast(({type:n})=>Tn.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var pW,Dwe,Nwe,jwe,Mwe,Fwe,Lwe,mW=y(()=>{go();Pa();vr();lI();pW=(t,e,r,n)=>[...t.filter(({type:i})=>!Tn.has(i)),...Dwe(t,e,r,n)],Dwe=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>Tn.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=Nwe({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return Lwe(o,r)},Nwe=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?jwe({stdioItem:t,optionName:i}):e==="webTransform"?Mwe({stdioItem:t,index:r,newTransforms:n,direction:o}):Fwe({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),jwe=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Mwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=Ot(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=cI(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},Fwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Ot(e)?e:{transform:e},d=c||nn.has(o),{writableObjectMode:f,readableObjectMode:p}=cI(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Lwe=(t,e)=>e==="input"?t.reverse():t});import uI from"node:process";var hW,zwe,Uwe,Dl,dI,gW,qwe,Bwe,yW=y(()=>{Da();vr();hW=(t,e,r)=>{let n=t.map(i=>zwe(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Bwe},zwe=({type:t,value:e},r)=>Uwe[r]??gW[t](e),Uwe=["input","output","output"],Dl=()=>{},dI=()=>"input",gW={generator:Dl,asyncGenerator:Dl,fileUrl:Dl,filePath:Dl,iterable:dI,asyncIterable:dI,uint8Array:dI,webStream:t=>Vb(t)?"output":"input",nodeStream(t){return Ca(t,{checkOpen:!1})?JR(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Dl,duplex:Dl,native(t){let e=qwe(t);if(e!==void 0)return e;if(ti(t,{checkOpen:!1}))return gW.nodeStream(t)}},qwe=t=>{if([0,uI.stdin].includes(t))return"input";if([1,2,uI.stdout,uI.stderr].includes(t))return"output"},Bwe="output"});var _W,bW=y(()=>{_W=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var vW,Hwe,Gwe,SW,Zwe,Vwe,wW=y(()=>{_o();bW();ls();vW=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Hwe(t,n).map((a,c)=>SW(a,c));return o?Zwe(s,r,i):_W(s,e)},Hwe=(t,e)=>{if(t===void 0)return An.map(n=>e[n]);if(Gwe(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${An.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,An.length);return Array.from({length:r},(n,i)=>t[i])},Gwe=t=>An.some(e=>t[e]!==void 0),SW=(t,e)=>Array.isArray(t)?t.map(r=>SW(r,e)):t??(e>=An.length?"ignore":"pipe"),Zwe=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!Sl(r,i)&&Vwe(n)?"ignore":n),Vwe=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as Wwe}from"node:fs";import Kwe from"node:tty";var $W,Jwe,Ywe,Xwe,Qwe,xW,kW=y(()=>{Da();_o();rn();ds();$W=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?Jwe({stdioItem:t,fdNumber:n,direction:i}):Qwe({stdioItem:t,fdNumber:n}),Jwe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=Ywe({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(ti(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},Ywe=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=Xwe(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(Kwe.isatty(i))throw new TypeError(`The \`${e}: ${hb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:yo(Wwe(i)),optionName:e}}},Xwe=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=W_.indexOf(t);if(r!==-1)return r},Qwe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:xW(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:xW(e,e,r),optionName:r}:ti(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,xW=(t,e,r)=>{let n=W_[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var EW,exe,txe,rxe,nxe,AW=y(()=>{Da();rn();vr();EW=({input:t,inputFile:e},r)=>r===0?[...exe(t),...rxe(e)]:[],exe=t=>t===void 0?[]:[{type:txe(t),value:t,optionName:"input"}],txe=t=>{if(Ca(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(Ut(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},rxe=t=>t===void 0?[]:[{...nxe(t),optionName:"inputFile"}],nxe=t=>{if(Zb(t))return{type:"fileUrl",value:t};if(oI(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var TW,OW,ixe,oxe,RW,sxe,axe,IW,PW=y(()=>{vr();TW=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),OW=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=ixe(i,t);if(s.length!==0){if(o){oxe({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(uW.has(t))return RW({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});dW.has(t)&&axe({otherStdioItems:s,type:t,value:e,optionName:r})}},ixe=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),oxe=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{aI.has(e)&&RW({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},RW=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>sxe(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return IW(s,n,e),i==="output"?o[0].stream:void 0},sxe=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,axe=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);IW(i,n,e)},IW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${ps[r]} that is the same.`)}});var Kb,cxe,lxe,uxe,dxe,fxe,pxe,mxe,hxe,gxe,yxe,_xe,fI,bxe,Jb=y(()=>{_o();mW();lI();vr();yW();wW();kW();AW();PW();Kb=(t,e,r,n)=>{let o=vW(e,r,n).map((a,c)=>cxe({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=gxe({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>bxe(a)),s},cxe=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=K_(e),{stdioItems:o,isStdioArray:s}=lxe({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=hW(o,e,i),c=o.map(d=>$W({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=pW(c,i,a,r),u=fW(l,a);return hxe(l,u),{direction:a,objectMode:u,stdioItems:l}},lxe=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>uxe(c,n)),...EW(r,e)],s=TW(o),a=s.length>1;return dxe(s,a,n),pxe(s),{stdioItems:s,isStdioArray:a}},uxe=(t,e)=>({type:rW(t,e),value:t,optionName:e}),dxe=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(fxe.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},fxe=new Set(["ignore","ipc"]),pxe=t=>{for(let e of t)mxe(e)},mxe=({type:t,value:e,optionName:r})=>{if(sW(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. +`):BV(t),BV=t=>typeof t=="string"?t:Ut(t)?V_(t):""});var Hb,Pl,rp,pwe,ZV,mwe,np=y(()=>{Wf();ib();Ra();GV();Hb=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>ZV({command:t,escapedCommand:e,cwd:o,durationMs:_R(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),Pl=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>rp({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),rp=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:S},isSync:x})=>{let{exitCode:w,signal:O,signalDescription:T}=mwe(l,u),{originalMessage:A,shortMessage:D,message:$}=HV({stdio:d,all:f,ipcOutput:p,originalError:t,signal:O,signalDescription:T,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:S,timeout:h,cwd:_}),re=o9(t,$,x);return Object.assign(re,pwe({error:re,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:O,signalDescription:T,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:A,shortMessage:D})),re},pwe=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>ZV({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:_R(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),ZV=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),mwe=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:db(e);return{exitCode:r,signal:n,signalDescription:i}}});function hwe(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(VV(t*1e3)%1e3),nanoseconds:Math.trunc(VV(t*1e6)%1e3)}}function gwe(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function rI(t){switch(typeof t){case"number":{if(Number.isFinite(t))return hwe(t);break}case"bigint":return gwe(t)}throw new TypeError("Expected a finite number or bigint")}var VV,WV=y(()=>{VV=t=>Number.isFinite(t)?t:0});function nI(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+bwe);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&ywe(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+_we(d,u):f;i.push(p)}},a=rI(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%vwe):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var ywe,_we,bwe,vwe,KV=y(()=>{WV();ywe=t=>t===0||t===0n,_we=(t,e)=>e===1||e===1n?t:`${t}s`,bwe=1e-7,vwe=24n*60n*60n*1000n});var JV,YV=y(()=>{wl();JV=(t,e)=>{t.failed&&Ri({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var XV,Swe,QV=y(()=>{KV();ls();wl();YV();XV=(t,e)=>{vl(e)&&(JV(t,e),Swe(t,e))},Swe=(t,e)=>{let r=`(done in ${nI(t.durationMs)})`;Ri({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Cl,Gb=y(()=>{QV();Cl=(t,e,{reject:r})=>{if(XV(t,e),t.failed&&r)throw t;return t}});var rW,wwe,xwe,nW,iW,eW,$we,iI,tW,ja,oW,kwe,Zb,sW,Ewe,Awe,oI,aW,Twe,cW,Vb,Owe,sI,Rwe,Iwe,lW,Tn,Wb,aI,uW,dW,ps,vr=y(()=>{Da();go();rn();rW=(t,e)=>ja(t)?"asyncGenerator":oW(t)?"generator":Zb(t)?"fileUrl":Ewe(t)?"filePath":Owe(t)?"webStream":ti(t,{checkOpen:!1})?"native":Ut(t)?"uint8Array":Rwe(t)?"asyncIterable":Iwe(t)?"iterable":sI(t)?nW({transform:t},e):kwe(t)?wwe(t,e):"native",wwe=(t,e)=>YR(t.transform,{checkOpen:!1})?xwe(t,e):sI(t.transform)?nW(t,e):$we(t,e),xwe=(t,e)=>(iW(t,e,"Duplex stream"),"duplex"),nW=(t,e)=>(iW(t,e,"web TransformStream"),"webTransform"),iW=({final:t,binary:e,objectMode:r},n,i)=>{eW(t,`${n}.final`,i),eW(e,`${n}.binary`,i),iI(r,`${n}.objectMode`)},eW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},$we=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!tW(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(YR(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(sI(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!tW(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return iI(r,`${i}.binary`),iI(n,`${i}.objectMode`),ja(t)||ja(e)?"asyncGenerator":"generator"},iI=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},tW=t=>ja(t)||oW(t),ja=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",oW=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",kwe=t=>Ot(t)&&(t.transform!==void 0||t.final!==void 0),Zb=t=>Object.prototype.toString.call(t)==="[object URL]",sW=t=>Zb(t)&&t.protocol!=="file:",Ewe=t=>Ot(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Awe.has(e))&&oI(t.file),Awe=new Set(["file","append"]),oI=t=>typeof t=="string",aW=(t,e)=>t==="native"&&typeof e=="string"&&!Twe.has(e),Twe=new Set(["ipc","ignore","inherit","overlapped","pipe"]),cW=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Vb=t=>Object.prototype.toString.call(t)==="[object WritableStream]",Owe=t=>cW(t)||Vb(t),sI=t=>cW(t?.readable)&&Vb(t?.writable),Rwe=t=>lW(t)&&typeof t[Symbol.asyncIterator]=="function",Iwe=t=>lW(t)&&typeof t[Symbol.iterator]=="function",lW=t=>typeof t=="object"&&t!==null,Tn=new Set(["generator","asyncGenerator","duplex","webTransform"]),Wb=new Set(["fileUrl","filePath","fileNumber"]),aI=new Set(["fileUrl","filePath"]),uW=new Set([...aI,"webStream","nodeStream"]),dW=new Set(["webTransform","duplex"]),ps={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var cI,Pwe,Cwe,fW,lI=y(()=>{vr();cI=(t,e,r,n)=>n==="output"?Pwe(t,e,r):Cwe(t,e,r),Pwe=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},Cwe=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},fW=(t,e)=>{let r=t.findLast(({type:n})=>Tn.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var pW,Dwe,Nwe,jwe,Mwe,Fwe,Lwe,mW=y(()=>{go();Pa();vr();lI();pW=(t,e,r,n)=>[...t.filter(({type:i})=>!Tn.has(i)),...Dwe(t,e,r,n)],Dwe=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>Tn.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=Nwe({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return Lwe(o,r)},Nwe=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?jwe({stdioItem:t,optionName:i}):e==="webTransform"?Mwe({stdioItem:t,index:r,newTransforms:n,direction:o}):Fwe({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),jwe=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Mwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=Ot(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=cI(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},Fwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Ot(e)?e:{transform:e},d=c||nn.has(o),{writableObjectMode:f,readableObjectMode:p}=cI(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Lwe=(t,e)=>e==="input"?t.reverse():t});import uI from"node:process";var hW,zwe,Uwe,Dl,dI,gW,qwe,Bwe,yW=y(()=>{Da();vr();hW=(t,e,r)=>{let n=t.map(i=>zwe(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Bwe},zwe=({type:t,value:e},r)=>Uwe[r]??gW[t](e),Uwe=["input","output","output"],Dl=()=>{},dI=()=>"input",gW={generator:Dl,asyncGenerator:Dl,fileUrl:Dl,filePath:Dl,iterable:dI,asyncIterable:dI,uint8Array:dI,webStream:t=>Vb(t)?"output":"input",nodeStream(t){return Ca(t,{checkOpen:!1})?JR(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Dl,duplex:Dl,native(t){let e=qwe(t);if(e!==void 0)return e;if(ti(t,{checkOpen:!1}))return gW.nodeStream(t)}},qwe=t=>{if([0,uI.stdin].includes(t))return"input";if([1,2,uI.stdout,uI.stderr].includes(t))return"output"},Bwe="output"});var _W,bW=y(()=>{_W=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var vW,Hwe,Gwe,SW,Zwe,Vwe,wW=y(()=>{_o();bW();ls();vW=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Hwe(t,n).map((a,c)=>SW(a,c));return o?Zwe(s,r,i):_W(s,e)},Hwe=(t,e)=>{if(t===void 0)return An.map(n=>e[n]);if(Gwe(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${An.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,An.length);return Array.from({length:r},(n,i)=>t[i])},Gwe=t=>An.some(e=>t[e]!==void 0),SW=(t,e)=>Array.isArray(t)?t.map(r=>SW(r,e)):t??(e>=An.length?"ignore":"pipe"),Zwe=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!Sl(r,i)&&Vwe(n)?"ignore":n),Vwe=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as Wwe}from"node:fs";import Kwe from"node:tty";var $W,Jwe,Ywe,Xwe,Qwe,xW,kW=y(()=>{Da();_o();rn();ds();$W=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?Jwe({stdioItem:t,fdNumber:n,direction:i}):Qwe({stdioItem:t,fdNumber:n}),Jwe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=Ywe({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(ti(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},Ywe=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=Xwe(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(Kwe.isatty(i))throw new TypeError(`The \`${e}: ${hb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:yo(Wwe(i)),optionName:e}}},Xwe=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=W_.indexOf(t);if(r!==-1)return r},Qwe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:xW(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:xW(e,e,r),optionName:r}:ti(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,xW=(t,e,r)=>{let n=W_[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var EW,exe,txe,rxe,nxe,AW=y(()=>{Da();rn();vr();EW=({input:t,inputFile:e},r)=>r===0?[...exe(t),...rxe(e)]:[],exe=t=>t===void 0?[]:[{type:txe(t),value:t,optionName:"input"}],txe=t=>{if(Ca(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(Ut(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},rxe=t=>t===void 0?[]:[{...nxe(t),optionName:"inputFile"}],nxe=t=>{if(Zb(t))return{type:"fileUrl",value:t};if(oI(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var TW,OW,ixe,oxe,RW,sxe,axe,IW,PW=y(()=>{vr();TW=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),OW=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=ixe(i,t);if(s.length!==0){if(o){oxe({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(uW.has(t))return RW({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});dW.has(t)&&axe({otherStdioItems:s,type:t,value:e,optionName:r})}},ixe=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),oxe=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{aI.has(e)&&RW({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},RW=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>sxe(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return IW(s,n,e),i==="output"?o[0].stream:void 0},sxe=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,axe=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);IW(i,n,e)},IW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${ps[r]} that is the same.`)}});var Kb,cxe,lxe,uxe,dxe,fxe,pxe,mxe,hxe,gxe,yxe,_xe,fI,bxe,Jb=y(()=>{_o();mW();lI();vr();yW();wW();kW();AW();PW();Kb=(t,e,r,n)=>{let o=vW(e,r,n).map((a,c)=>cxe({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=gxe({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>bxe(a)),s},cxe=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=K_(e),{stdioItems:o,isStdioArray:s}=lxe({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=hW(o,e,i),c=o.map(d=>$W({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=pW(c,i,a,r),u=fW(l,a);return hxe(l,u),{direction:a,objectMode:u,stdioItems:l}},lxe=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>uxe(c,n)),...EW(r,e)],s=TW(o),a=s.length>1;return dxe(s,a,n),pxe(s),{stdioItems:s,isStdioArray:a}},uxe=(t,e)=>({type:rW(t,e),value:t,optionName:e}),dxe=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(fxe.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},fxe=new Set(["ignore","ipc"]),pxe=t=>{for(let e of t)mxe(e)},mxe=({type:t,value:e,optionName:r})=>{if(sW(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(aW(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},hxe=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>Wb.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},gxe=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push(yxe({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw fI(i),o}},yxe=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>_xe({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},_xe=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=OW({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},fI=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Xn(r)&&r.destroy()},bxe=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as CW}from"node:fs";var NW,Di,vxe,jW,DW,Sxe,MW=y(()=>{rn();Jb();vr();NW=(t,e)=>Kb(Sxe,t,e,!0),Di=({type:t,optionName:e})=>{jW(e,ps[t])},vxe=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&jW(t,`"${e}"`),{}),jW=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},DW={generator(){},asyncGenerator:Di,webStream:Di,nodeStream:Di,webTransform:Di,duplex:Di,asyncIterable:Di,native:vxe},Sxe={input:{...DW,fileUrl:({value:t})=>({contents:[yo(CW(t))]}),filePath:({value:{file:t}})=>({contents:[yo(CW(t))]}),fileNumber:Di,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...DW,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:Di,string:Di,uint8Array:Di}}});var wo,pI,ip=y(()=>{KR();wo=(t,{stripFinalNewline:e},r)=>pI(e,r)&&t!==void 0&&!Array.isArray(t)?Rl(t):t,pI=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var Yb,hI,FW,LW,wxe,xxe,$xe,zW,kxe,mI,Exe,Axe,Txe,Xb=y(()=>{Yb=(t,e,r,n)=>t||r?void 0:LW(e,n),hI=(t,e,r)=>r?t.flatMap(n=>FW(n,e)):FW(t,e),FW=(t,e)=>{let{transform:r,final:n}=LW(e,{});return[...r(t),...n()]},LW=(t,e)=>(e.previousChunks="",{transform:wxe.bind(void 0,e,t),final:$xe.bind(void 0,e)}),wxe=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o0&&(a=mI(n,a),n=""),yield a,i=o}i!==r.length-1&&(n=mI(n,r.slice(i+1))),t.previousChunks=n},xxe=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),$xe=function*({previousChunks:t}){t.length>0&&(yield t)},zW=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:kxe.bind(void 0,n)},kxe=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}=typeof e=="string"?Exe:Txe;if(e.at(-1)===i){yield e;return}yield o(e,t?n:r)},mI=(t,e)=>`${t}${e}`,Exe={windowsNewline:`\r `,unixNewline:` `,LF:` `,concatBytes:mI},Axe=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},Txe={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Axe}});import{Buffer as Oxe}from"node:buffer";var UW,Rxe,qW,Ixe,Pxe,BW,HW=y(()=>{rn();UW=(t,e)=>t?void 0:Rxe.bind(void 0,e),Rxe=function*(t,e){if(typeof e!="string"&&!Ut(e)&&!Oxe.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},qW=(t,e)=>t?Ixe.bind(void 0,e):Pxe.bind(void 0,e),Ixe=function*(t,e){BW(t,e),yield e},Pxe=function*(t,e){if(BW(t,e),typeof e!="string"&&!Ut(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},BW=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`. Instead, \`yield\` should either be called with a value, or not be called at all. For example: - if (condition) { yield value; }`)}});import{Buffer as Cxe}from"node:buffer";import{StringDecoder as Dxe}from"node:string_decoder";var Qb,Nxe,jxe,Mxe,gI=y(()=>{rn();Qb=(t,e,r)=>{if(r)return;if(t)return{transform:Nxe.bind(void 0,new TextEncoder)};let n=new Dxe(e);return{transform:jxe.bind(void 0,n),final:Mxe.bind(void 0,n)}},Nxe=function*(t,e){Cxe.isBuffer(e)?yield yo(e):typeof e=="string"?yield t.encode(e):yield e},jxe=function*(t,e){yield Ut(e)?t.write(e):e},Mxe=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as GW}from"node:util";var yI,ev,ZW,Fxe,VW,Lxe,WW=y(()=>{yI=GW(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),ev=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Lxe}=e[r];for await(let i of n(t))yield*ev(i,e,r+1)},ZW=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Fxe(r,Number(e),t)},Fxe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*ev(n,r,e+1)},VW=GW(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Lxe=function*(t){yield t}});var _I,KW,Ma,op,zxe,Uxe,bI=y(()=>{_I=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},KW=(t,e)=>[...e.flatMap(r=>[...Ma(r,t,0)]),...op(t)],Ma=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Uxe}=e[r];for(let i of n(t))yield*Ma(i,e,r+1)},op=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*zxe(r,Number(e),t)},zxe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ma(n,r,e+1)},Uxe=function*(t){yield t}});import{Transform as qxe,getDefaultHighWaterMark as JW}from"node:stream";var vI,tv,YW,rv=y(()=>{vr();Xb();HW();gI();WW();bI();vI=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=YW(t,s,o),l=ja(e),u=ja(r),d=l?yI.bind(void 0,ev,a):_I.bind(void 0,Ma),f=l||u?yI.bind(void 0,ZW,a):_I.bind(void 0,op),p=l||u?VW.bind(void 0,a):void 0;return{stream:new qxe({writableObjectMode:n,writableHighWaterMark:JW(n),readableObjectMode:i,readableHighWaterMark:JW(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},tv=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=YW(s,r,a);t=KW(c,t)}return t},YW=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:UW(n,a)},Qb(r,s,n),Yb(r,o,n,c),{transform:t,final:e},{transform:qW(i,a)},zW({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var XW,Bxe,Hxe,Gxe,Zxe,QW=y(()=>{rv();rn();vr();XW=(t,e)=>{for(let r of Bxe(t))Hxe(t,r,e)},Bxe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Hxe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ps[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>Gxe(a,n));r.input=Bf(s)},Gxe=(t,e)=>{let r=tv(t,e,"utf8",!0);return Zxe(r),Bf(r)},Zxe=t=>{let e=t.find(r=>typeof r!="string"&&!Ut(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var nv,Vxe,Wxe,e3,t3,Kxe,r3,SI=y(()=>{Pa();vr();wl();ls();nv=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Sl(r,n)&&!nn.has(e)&&Vxe(n)&&(t.some(({type:i,value:o})=>i==="native"&&Wxe.has(o))||t.every(({type:i})=>Tn.has(i))),Vxe=t=>t===1||t===2,Wxe=new Set(["pipe","overlapped"]),e3=async(t,e,r,n)=>{for await(let i of t)Kxe(e)||r3(i,r,n)},t3=(t,e,r)=>{for(let n of t)r3(n,e,r)},Kxe=t=>t._readableState.pipes.length>0,r3=(t,e,r)=>{let n=rb(t);Ri({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as Jxe,appendFileSync as Yxe}from"node:fs";var n3,Xxe,Qxe,e0e,t0e,r0e,i3=y(()=>{SI();rv();Xb();rn();vr();Na();n3=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>Xxe({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},Xxe=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=qV(t,o,d),p=yo(f),{stdioItems:m,objectMode:h}=e[r],g=Qxe([p],m,c,n),{serializedResult:b,finalResult:_=b}=e0e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});t0e({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&r0e(b,m,i),S}catch(x){return n.error=x,S}},Qxe=(t,e,r,n)=>{try{return tv(t,e,r,!1)}catch(i){return n.error=i,t}},e0e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Bf(t)};let s=PG(t,r);return n[o]?{serializedResult:s,finalResult:hI(s,!i[o],e)}:{serializedResult:s}},t0e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!nv({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=hI(t,!1,s);try{t3(a,e,n)}catch(c){r.error??=c}},r0e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>Wb.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?Yxe(n,t):(r.add(o),Jxe(n,t))}}});var o3,s3=y(()=>{rn();ip();o3=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,wo(e,r,"all")]:Array.isArray(e)?[wo(t,r,"all"),...e]:Ut(t)&&Ut(e)?uR([t,e]):`${t}${e}`}});import{once as wI}from"node:events";var a3,n0e,c3,l3,i0e,xI,$I=y(()=>{Ra();a3=async(t,e)=>{let[r,n]=await n0e(t);return e.isForcefullyTerminated??=!1,[r,n]},n0e=async t=>{let[e,r]=await Promise.allSettled([wI(t,"spawn"),wI(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?c3(t):r.value},c3=async t=>{try{return await wI(t,"exit")}catch{return c3(t)}},l3=async t=>{let[e,r]=await t;if(!i0e(e,r)&&xI(e,r))throw new Qn;return[e,r]},i0e=(t,e)=>t===void 0&&e===void 0,xI=(t,e)=>t!==0||e!==null});var u3,o0e,d3=y(()=>{Ra();Na();$I();u3=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=o0e(t,e,r),s=o?.code==="ETIMEDOUT",a=UV(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},o0e=(t,e,r)=>t!==void 0?t:xI(e,r)?new Qn:void 0});import{spawnSync as s0e}from"node:child_process";var f3,a0e,c0e,l0e,iv,u0e,d0e,f0e,p0e,p3=y(()=>{bR();VR();WR();np();Gb();MW();ip();QW();i3();Na();s3();d3();f3=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=a0e(t,e,r),d=u0e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Cl(d,c,l)},a0e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ob(t,e,r),a=c0e(r),{file:c,commandArguments:l,options:u}=Pb(t,e,a);l0e(u);let d=NW(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},c0e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,l0e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&iv("ipcInput"),t&&iv("ipc: true"),r&&iv("detached: true"),n&&iv("cancelSignal")},iv=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},u0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=d0e({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=u3(c,r),{output:m,error:h=l}=n3({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>wo(_,r,S)),b=wo(o3(m,r),r,"all");return p0e({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},d0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{XW(o,r);let a=f0e(r);return s0e(...Cb(t,e,a))}catch(a){return Pl({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},f0e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Bb(e)}),p0e=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?Hb({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):rp({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as kI,on as m0e}from"node:events";var m3,h0e,g0e,y0e,_0e,h3=y(()=>{Al();Yf();Jf();m3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(kl({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:kb(t)}),h0e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),h0e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{_b(e,i);let o=fs(t,e,r),s=new AbortController;try{return await Promise.race([g0e(o,n,s),y0e(o,r,s),_0e(o,r,s)])}catch(a){throw El(t),a}finally{s.abort(),bb(e,i)}},g0e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await kI(t,"message",{signal:r});return n}for await(let[n]of m0e(t,"message",{signal:r}))if(e(n))return n},y0e=async(t,e,{signal:r})=>{await kI(t,"disconnect",{signal:r}),E9(e)},_0e=async(t,e,{signal:r})=>{let[n]=await kI(t,"strict:error",{signal:r});throw mb(n,e)}});import{once as y3,on as b0e}from"node:events";var _3,EI,v0e,S0e,w0e,g3,AI=y(()=>{Al();Yf();Jf();_3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>EI({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),EI=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{kl({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:kb(t)}),_b(e,o);let s=fs(t,e,r),a=new AbortController,c={};return v0e(t,s,a),S0e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),w0e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},v0e=async(t,e,r)=>{try{await y3(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},S0e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await y3(t,"strict:error",{signal:r.signal});n.error=mb(i,e),r.abort()}catch{}},w0e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of b0e(r,"message",{signal:o.signal}))g3(s),yield c}catch{g3(s)}finally{o.abort(),bb(e,a),n||El(t),i&&await t}},g3=({error:t})=>{if(t)throw t}});import b3 from"node:process";var v3,S3,w3,TI=y(()=>{Rb();h3();AI();xb();v3=(t,{ipc:e})=>{Object.assign(t,w3(t,!1,e))},S3=()=>{let t=b3,e=!0,r=b3.channel!==void 0;return{...w3(t,e,r),getCancelSignal:eV.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},w3=(t,e,r)=>({sendMessage:Ob.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:m3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:_3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as x0e}from"node:child_process";import{PassThrough as $0e,Readable as k0e,Writable as E0e,Duplex as A0e}from"node:stream";var x3,T0e,sp,O0e,R0e,I0e,P0e,$3=y(()=>{Jb();np();Gb();x3=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{fI(n);let a=new x0e;T0e(a,n),Object.assign(a,{readable:O0e,writable:R0e,duplex:I0e});let c=Pl({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=P0e(c,s,i);return{subprocess:a,promise:l}},T0e=(t,e)=>{let r=sp(),n=sp(),i=sp(),o=Array.from({length:e.length-3},sp),s=sp(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},sp=()=>{let t=new $0e;return t.end(),t},O0e=()=>new k0e({read(){}}),R0e=()=>new E0e({write(){}}),I0e=()=>new A0e({read(){},write(){}}),P0e=async(t,e,r)=>Cl(t,e,r)});import{createReadStream as k3,createWriteStream as E3}from"node:fs";import{Buffer as C0e}from"node:buffer";import{Readable as ap,Writable as D0e,Duplex as N0e}from"node:stream";var T3,cp,A3,j0e,O3=y(()=>{rv();Jb();vr();T3=(t,e)=>Kb(j0e,t,e,!1),cp=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ps[t]}.`)},A3={fileNumber:cp,generator:vI,asyncGenerator:vI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:N0e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},j0e={input:{...A3,fileUrl:({value:t})=>({stream:k3(t)}),filePath:({value:{file:t}})=>({stream:k3(t)}),webStream:({value:t})=>({stream:ap.fromWeb(t)}),iterable:({value:t})=>({stream:ap.from(t)}),asyncIterable:({value:t})=>({stream:ap.from(t)}),string:({value:t})=>({stream:ap.from(t)}),uint8Array:({value:t})=>({stream:ap.from(C0e.from(t))})},output:{...A3,fileUrl:({value:t})=>({stream:E3(t)}),filePath:({value:{file:t,append:e}})=>({stream:E3(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:D0e.fromWeb(t)}),iterable:cp,asyncIterable:cp,string:cp,uint8Array:cp}}});import{on as M0e,once as R3}from"node:events";import{PassThrough as F0e,getDefaultHighWaterMark as L0e}from"node:stream";import{finished as C3}from"node:stream/promises";function Fa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)RI(i);let e=t.some(({readableObjectMode:i})=>i),r=z0e(t,e),n=new OI({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var z0e,OI,U0e,q0e,B0e,RI,H0e,G0e,Z0e,V0e,W0e,D3,N3,II,j3,K0e,ov,I3,P3,sv=y(()=>{z0e=(t,e)=>{if(t.length===0)return L0e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},OI=class extends F0e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(RI(e),this.#t.has(e))return;this.#t.add(e),this.#n??=U0e(this,this.#t,this.#o);let r=H0e({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(RI(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},U0e=async(t,e,r)=>{ov(t,I3);let n=new AbortController;try{await Promise.race([q0e(t,n),B0e(t,e,r,n)])}finally{n.abort(),ov(t,-I3)}},q0e=async(t,{signal:e})=>{try{await C3(t,{signal:e,cleanup:!0})}catch(r){throw D3(t,r),r}},B0e=async(t,e,r,{signal:n})=>{for await(let[i]of M0e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},RI=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},H0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{ov(t,P3);let a=new AbortController;try{await Promise.race([G0e(o,e,a),Z0e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),V0e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),ov(t,-P3)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?II(t):W0e(t))},G0e=async(t,e,{signal:r})=>{try{await t,r.aborted||II(e)}catch(n){r.aborted||D3(e,n)}},Z0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await C3(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;N3(s)?i.add(e):j3(t,s)}},V0e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await R3(t,i,{signal:o}),!t.readable)return R3(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},W0e=t=>{t.writable&&t.end()},D3=(t,e)=>{N3(e)?II(t):j3(t,e)},N3=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",II=t=>{(t.readable||t.writable)&&t.destroy()},j3=(t,e)=>{t.destroyed||(t.once("error",K0e),t.destroy(e))},K0e=()=>{},ov=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},I3=2,P3=1});import{finished as M3}from"node:stream/promises";var Nl,J0e,PI,Y0e,CI,av=y(()=>{_o();Nl=(t,e)=>{t.pipe(e),J0e(t,e),Y0e(t,e)},J0e=async(t,e)=>{if(!(Xn(t)||Xn(e))){try{await M3(t,{cleanup:!0,readable:!0,writable:!1})}catch{}PI(e)}},PI=t=>{t.writable&&t.end()},Y0e=async(t,e)=>{if(!(Xn(t)||Xn(e))){try{await M3(e,{cleanup:!0,readable:!1,writable:!0})}catch{}CI(t)}},CI=t=>{t.readable&&t.destroy()}});var F3,X0e,Q0e,e$e,t$e,r$e,L3=y(()=>{sv();_o();yb();vr();av();F3=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>Tn.has(c)))X0e(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!Tn.has(c)))e$e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Fa(o);Nl(s,i)}},X0e=(t,e,r,n)=>{r==="output"?Nl(t.stdio[n],e):Nl(e,t.stdio[n]);let i=Q0e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},Q0e=["stdin","stdout","stderr"],e$e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;t$e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},t$e=(t,{signal:e})=>{Xn(t)&&Ia(t,r$e,e)},r$e=2});var La,z3=y(()=>{La=[];La.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&La.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&La.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var cv,DI,NI,n$e,jI,lv,i$e,MI,FI,LI,U3,Nst,jst,q3=y(()=>{z3();cv=t=>!!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",DI=Symbol.for("signal-exit emitter"),NI=globalThis,n$e=Object.defineProperty.bind(Object),jI=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(NI[DI])return NI[DI];n$e(NI,DI,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},lv=class{},i$e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),MI=class extends lv{onExit(){return()=>{}}load(){}unload(){}},FI=class extends lv{#t=LI.platform==="win32"?"SIGINT":"SIGHUP";#r=new jI;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of La)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!cv(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of La)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,La.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return cv(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&cv(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},LI=globalThis.process,{onExit:U3,load:Nst,unload:jst}=i$e(cv(LI)?new FI(LI):new MI)});import{addAbortListener as o$e}from"node:events";var B3,H3=y(()=>{q3();B3=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=U3(()=>{t.kill()});o$e(n,()=>{i()})}});var Z3,s$e,a$e,G3,c$e,V3=y(()=>{lR();ib();ds();bl();Z3=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=nb(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=s$e(r,n,i),{sourceStream:d,sourceError:f}=c$e(t,l),{options:p,fileDescriptors:m}=Pi.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},s$e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=a$e(t,e,...r),a=gb(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},a$e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(G3,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||aR(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=Z_(r,...n);return{destination:e(G3)(i,o,s),pipeOptions:s}}if(Pi.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},G3=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),c$e=(t,e)=>{try{return{sourceStream:Ol(t,e)}}catch(r){return{sourceError:r}}}});var K3,l$e,zI,W3,UI=y(()=>{np();av();K3=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=l$e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw zI({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},l$e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return CI(t),n;if(e!==void 0)return PI(r),e},zI=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Pl({error:t,command:W3,escapedCommand:W3,fileDescriptors:e,options:r,startTime:n,isSync:!1}),W3="source.pipe(destination)"});var J3,Y3=y(()=>{J3=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as u$e}from"node:stream/promises";var X3,d$e,f$e,p$e,uv,m$e,h$e,Q3=y(()=>{sv();yb();av();X3=(t,e,r)=>{let n=uv.has(e)?f$e(t,e):d$e(t,e);return Ia(t,m$e,r.signal),Ia(e,h$e,r.signal),p$e(e),n},d$e=(t,e)=>{let r=Fa([t]);return Nl(r,e),uv.set(e,r),r},f$e=(t,e)=>{let r=uv.get(e);return r.add(t),r},p$e=async t=>{try{await u$e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}uv.delete(t)},uv=new WeakMap,m$e=2,h$e=1});import{aborted as g$e}from"node:util";var eK,y$e,tK=y(()=>{UI();eK=(t,e)=>t===void 0?[]:[y$e(t,e)],y$e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await g$e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw zI({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var dv,_$e,b$e,rK=y(()=>{go();V3();UI();Y3();Q3();tK();dv=(t,...e)=>{if(Ot(e[0]))return dv.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Z3(t,...e),i=_$e({...n,destination:r});return i.pipe=dv.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},_$e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=b$e(t,i);K3({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=X3(e,o,d);return await Promise.race([J3(u),...eK(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},b$e=(t,e)=>Promise.allSettled([t,e])});import{on as v$e}from"node:events";import{getDefaultHighWaterMark as S$e}from"node:stream";var fv,w$e,qI,x$e,iK,BI,nK,$$e,k$e,pv=y(()=>{gI();Xb();bI();fv=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return w$e(e,s),iK({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},w$e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},qI=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;x$e(e,s,t);let a=t.readableObjectMode&&!o;return iK({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},x$e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},iK=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=v$e(t,"data",{signal:e.signal,highWaterMark:nK,highWatermark:nK});return $$e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},BI=S$e(!0),nK=BI,$$e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=k$e({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ma(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*op(a)}},k$e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[Qb(t,r,!e),Yb(t,i,!n,{})].filter(Boolean)});import{setImmediate as E$e}from"node:timers/promises";var oK,A$e,T$e,O$e,HI,sK,GI=y(()=>{qb();rn();SI();pv();Na();ip();oK=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=A$e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([T$e(t),d]);return}let f=pI(c,r),p=qI({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([O$e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},A$e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!nv({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=qI({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await e3(a,t,r,o)},T$e=async t=>{await E$e(),t.readableFlowing===null&&t.resume()},O$e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await Fb(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await Lb(r,{maxBuffer:o})):await Ub(r,{maxBuffer:o})}catch(a){return sK(FV({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},HI=async t=>{try{return await t}catch(e){return sK(e)}},sK=({bufferedData:t})=>RG(t)?new Uint8Array(t):t});import{finished as R$e}from"node:stream/promises";var lp,I$e,P$e,C$e,D$e,N$e,ZI,mv,aK,hv=y(()=>{lp=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=I$e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],R$e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||D$e(a,e,r,n)}finally{s.abort()}},I$e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&P$e(t,r,n),n},P$e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{C$e(e,r),n.call(t,...i)}},C$e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},D$e=(t,e,r,n)=>{if(!N$e(t,e,r,n))throw t},N$e=(t,e,r,n=!0)=>r.propagating?aK(t)||mv(t):(r.propagating=!0,ZI(r,e)===n?aK(t):mv(t)),ZI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",mv=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",aK=t=>t?.code==="EPIPE"});var cK,VI,WI=y(()=>{GI();hv();cK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>VI({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),VI=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=lp(t,e,l);if(ZI(l,e)){await u;return}let[d]=await Promise.all([oK({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var lK,uK,j$e,M$e,KI=y(()=>{sv();WI();lK=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Fa([t,e].filter(Boolean)):void 0,uK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>VI({...j$e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:M$e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),j$e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},M$e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var dK,fK,pK=y(()=>{wl();ls();dK=t=>Sl(t,"ipc"),fK=(t,e)=>{let r=rb(t);Ri({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var mK,hK,gK=y(()=>{Na();pK();vo();AI();mK=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=dK(o),a=bo(e,"ipc"),c=bo(r,"ipc");for await(let l of EI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(LV(t,i,c),i.push(l)),s&&fK(l,o);return i},hK=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as F$e}from"node:events";var yK,L$e,z$e,U$e,_K=y(()=>{Da();qR();CR();UR();_o();vr();GI();gK();HR();KI();WI();$I();hv();yK=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:b})=>{let _=a3(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=cK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=uK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),O=[],T=mK({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),A=L$e(h,t,S),D=z$e(m,S);try{return await Promise.race([Promise.all([{},l3(_),Promise.all(x),w,T,uV(t,d),...A,...D]),g,U$e(t,b),...oV(t,o,f,b),...k9({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...nV({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch($){return f.terminationReason??="other",Promise.all([{error:$},_,Promise.all(x.map(ie=>HI(ie))),HI(w),hK(T,O),Promise.allSettled(A),Promise.allSettled(D)])}},L$e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:lp(n,i,r)),z$e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>ti(o,{checkOpen:!1})&&!Xn(o)).map(({type:i,value:o,stream:s=o})=>lp(s,n,e,{isSameDirection:Tn.has(i),stopOnExit:i==="native"}))),U$e=async(t,{signal:e})=>{let[r]=await F$e(t,"error",{signal:e});throw r}});var bK,up,jl,gv=y(()=>{Tl();bK=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),up=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Ii();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},jl=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as vK}from"node:stream/promises";var JI,SK,YI,XI,yv,_v,QI=y(()=>{hv();JI=async t=>{if(t!==void 0)try{await YI(t)}catch{}},SK=async t=>{if(t!==void 0)try{await XI(t)}catch{}},YI=async t=>{await vK(t,{cleanup:!0,readable:!1,writable:!0})},XI=async t=>{await vK(t,{cleanup:!0,readable:!0,writable:!1})},yv=async(t,e)=>{if(await t,e)throw e},_v=(t,e,r)=>{r&&!mv(r)?t.destroy(r):e&&t.destroy()}});import{Readable as q$e}from"node:stream";import{callbackify as B$e}from"node:util";var wK,eP,tP,rP,H$e,nP,iP,xK,oP=y(()=>{Pa();ds();pv();Tl();gv();QI();wK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||nn.has(r),{subprocessStdout:a,waitReadableDestroy:c}=eP(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=tP(a,s),{read:f,onStdoutDataDone:p}=rP({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new q$e({read:f,destroy:B$e(iP.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return nP({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},eP=(t,e,r)=>{let n=Ol(t,e),i=up(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},tP=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:BI},rP=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Ii(),s=fv({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){H$e(this,s,o)},onStdoutDataDone:o}},H$e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},nP=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await XI(t),await n,await JI(i),await e,r.readable&&r.push(null)}catch(o){await JI(i),xK(r,o)}},iP=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await jl(r,e)&&(xK(t,n),await yv(e,n))},xK=(t,e)=>{_v(t,t.readable,e)}});import{Writable as G$e}from"node:stream";import{callbackify as $K}from"node:util";var kK,sP,aP,Z$e,V$e,cP,lP,EK,uP=y(()=>{ds();gv();QI();kK=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=sP(t,r,e),s=new G$e({...aP(n,t,i),destroy:$K(lP.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return cP(n,s),s},sP=(t,e,r)=>{let n=gb(t,e),i=up(r,n,"writableFinal"),o=up(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},aP=(t,e,r)=>({write:Z$e.bind(void 0,t),final:$K(V$e.bind(void 0,t,e,r))}),Z$e=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},V$e=async(t,e,r)=>{await jl(r,e)&&(t.writable&&t.end(),await e)},cP=async(t,e,r)=>{try{await YI(t),e.writable&&e.end()}catch(n){await SK(r),EK(e,n)}},lP=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await jl(r,e),await jl(n,e)&&(EK(t,i),await yv(e,i))},EK=(t,e)=>{_v(t,t.writable,e)}});import{Duplex as W$e}from"node:stream";import{callbackify as K$e}from"node:util";var AK,J$e,TK=y(()=>{Pa();oP();uP();AK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||nn.has(r),{subprocessStdout:c,waitReadableDestroy:l}=eP(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=sP(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=tP(c,a),{read:g,onStdoutDataDone:b}=rP({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new W$e({read:g,...aP(u,t,d),destroy:K$e(J$e.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return nP({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),cP(u,_,c),_},J$e=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([iP({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),lP({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var dP,Y$e,OK=y(()=>{Pa();ds();pv();dP=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||nn.has(e),s=Ol(t,r),a=fv({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return Y$e(a,s,t)},Y$e=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var RK,IK=y(()=>{gv();oP();uP();TK();OK();RK=(t,{encoding:e})=>{let r=bK();t.readable=wK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=kK.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=AK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=dP.bind(void 0,t,e),t[Symbol.asyncIterator]=dP.bind(void 0,t,e,{})}});var PK,X$e,Q$e,CK=y(()=>{PK=(t,e)=>{for(let[r,n]of Q$e){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},X$e=(async()=>{})().constructor.prototype,Q$e=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(X$e,t)])});import{setMaxListeners as eke}from"node:events";import{spawn as tke}from"node:child_process";var DK,rke,nke,ike,oke,ske,NK=y(()=>{qb();bR();VR();ds();WR();TI();np();Gb();$3();O3();ip();L3();fb();H3();rK();KI();_K();IK();Tl();CK();DK=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=rke(t,e,r),{subprocess:f,promise:p}=ike({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=dv.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),PK(f,p),Pi.set(f,{options:u,fileDescriptors:d}),f},rke=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ob(t,e,r),{file:a,commandArguments:c,options:l}=Pb(t,e,r),u=nke(l),d=T3(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},nke=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},ike=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=tke(...Cb(t,e,r))}catch(m){return x3({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;eke(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];F3(c,a,l),B3(c,r,l);let d={},f=Ii();c.kill=x9.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=lK(c,r),RK(c,r),v3(c,r);let p=oke({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},oke=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await yK({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map((x,w)=>wo(x,e,w)),_=wo(h,e,"all"),S=ske({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Cl(S,n,e)},ske=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?rp({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Ci,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):Hb({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var bv,ake,cke,jK=y(()=>{go();vo();bv=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,ake(n,t[n],i)]));return{...t,...r}},ake=(t,e,r)=>cke.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,cke=new Set(["env",...mR])});var ms,lke,uke,MK=y(()=>{go();lR();FG();p3();NK();jK();ms=(t,e,r,n)=>{let i=(s,a,c)=>ms(s,a,r,c),o=(...s)=>lke({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},lke=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Ot(o))return i(t,bv(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=uke({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?f3(a,c,l):DK(a,c,l,i)},uke=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=jG(e)?MG(e,r):[e,...r],[s,a,c]=Z_(...o),l=bv(bv(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var FK,LK,zK,dke,fke,UK=y(()=>{FK=({file:t,commandArguments:e})=>zK(t,e),LK=({file:t,commandArguments:e})=>({...zK(t,e),isSync:!0}),zK=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=dke(t);return{file:r,commandArguments:n}},dke=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(fke)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},fke=/ +/g});var qK,BK,pke,HK,mke,GK,ZK=y(()=>{qK=(t,e,r)=>{t.sync=e(pke,r),t.s=t.sync},BK=({options:t})=>HK(t),pke=({options:t})=>({...HK(t),isSync:!0}),HK=t=>({options:{...mke(t),...t}}),mke=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},GK={preferLocal:!0}});var klt,Ye,Elt,Alt,Tlt,Olt,Rlt,Ilt,Plt,Clt,Mr=y(()=>{MK();UK();BR();ZK();TI();klt=ms(()=>({})),Ye=ms(()=>({isSync:!0})),Elt=ms(FK),Alt=ms(LK),Tlt=ms(aV),Olt=ms(BK,{},GK,qK),{sendMessage:Rlt,getOneMessage:Ilt,getEachMessage:Plt,getCancelSignal:Clt}=S3()});import{existsSync as vv,statSync as hke}from"node:fs";import{dirname as fP,extname as gke,isAbsolute as VK,join as pP,relative as mP,resolve as Sv,sep as yke}from"node:path";function wv(t){return t==="./gradlew"||t==="gradle"}function _ke(t){return(vv(pP(t,"build.gradle.kts"))||vv(pP(t,"build.gradle")))&&vv(pP(t,"gradle.properties"))}function bke(t,e){let n=mP(t,e).split(yke).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function hs(t,e){return t===":"?`:${e}`:`${t}:${e}`}function vke(t,e){let r=Sv(t,e),n=r;vv(r)?hke(r).isFile()&&(n=fP(r)):gke(r)!==""&&(n=fP(r));let i=mP(t,n);if(i.startsWith("..")||VK(i))return null;let o=n;for(;;){if(_ke(o))return o;if(Sv(o)===Sv(t))return null;let s=fP(o);if(s===o)return null;let a=mP(t,s);if(a.startsWith("..")||VK(a))return null;o=s}}function xv(t,e){let r=Sv(t),n=new Map,i=[];for(let o of e){let s=vke(r,o);if(!s){i.push(o);continue}let a=bke(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var $v=y(()=>{"use strict"});import{existsSync as gP,readFileSync as Ske}from"node:fs";import{join as Ml}from"node:path";function Fl(t="."){let e=Ml(t,".cladding","config.yaml");if(!gP(e))return hP;try{let n=(0,WK.parse)(Ske(e,"utf8"))?.gate;if(!n)return hP;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of wke){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return hP}}function KK(t="."){let e=Fl(t).testReport,r=e?[e,...yP]:yP;return[...new Set(r.map(n=>Ml(t,n)))]}function JK(t="."){let e=Fl(t).testReport;if(e){let r=Ml(t,e);return gP(r)?r:null}return yP.map(r=>Ml(t,r)).find(r=>gP(r))??null}function YK(t,e){let r=[],n=!1;for(let i of t){let o=xke.exec(i);if(o){n=!0;for(let s of e)r.push(hs(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var WK,wke,hP,yP,xke,dp=y(()=>{"use strict";WK=St(Qt(),1);$v();wke=["type","lint","test","coverage"],hP={scope:"feature"},yP=["test-report.junit.xml",Ml("coverage","junit.xml"),Ml(".cladding","test-report.junit.xml")];xke=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as bP,readFileSync as XK,readdirSync as $ke,statSync as kke}from"node:fs";import{join as kv}from"node:path";function wP(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=kv(t,e);if(bP(r))try{if(QK.test(XK(r,"utf8")))return!0}catch{}}return!1}function eJ(t){try{return bP(t)&&QK.test(XK(t,"utf8"))}catch{return!1}}function tJ(t,e=0){if(e>4||!bP(t))return!1;let r;try{r=$ke(t)}catch{return!1}for(let n of r){let i=kv(t,n),o=!1;try{o=kke(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(tJ(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&eJ(i))return!0}return!1}function Tke(t){if(wP(t))return!0;for(let e of Eke)if(eJ(kv(t,e)))return!0;for(let e of Ake)if(tJ(kv(t,e)))return!0;return!1}function rJ(t="."){let e=Fl(t).coverage;return e||(Tke(t)?"kover":"jacoco")}function nJ(t="."){return vP[rJ(t)]}function iJ(t="."){return _P[rJ(t)]}var vP,_P,SP,QK,Eke,Ake,Ev=y(()=>{"use strict";dp();vP={kover:"koverXmlReport",jacoco:"jacocoTestReport"},_P={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},SP=[_P.kover,_P.jacoco],QK=/kover/i;Eke=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],Ake=["buildSrc","build-logic"]});import{existsSync as pp,readFileSync as sJ,readdirSync as aJ}from"node:fs";import{join as gs}from"node:path";function $P(t){return pp(gs(t,"gradlew"))?"./gradlew":"gradle"}function Oke(t){let e=$P(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[nJ(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function Rke(t){let e=!1;try{e=/(^|\n)\s*flutter\s*:|sdk:\s*flutter/.test(sJ(gs(t,"pubspec.yaml"),"utf8"))}catch{}let r={cmd:"dart",args:["format","--output=none","--set-exit-if-changed","."]},n={cmd:"gitleaks",args:["detect","--no-banner"]};return e?{type:{cmd:"flutter",args:["analyze"]},lint:r,test:{cmd:"flutter",args:["test"]},coverage:{cmd:"flutter",args:["test","--coverage"]},secret:n}:{type:{cmd:"dart",args:["analyze"]},lint:r,test:{cmd:"dart",args:["test"]},coverage:{cmd:"dart",args:["test","--coverage=coverage"]},secret:n}}function Pke(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function Nke(t,e){for(let r of e)if(pp(gs(t,r)))return r}function jke(t,e){try{return aJ(t).find(n=>n.endsWith(e))}catch{return}}function Lke(t){try{return JSON.parse(sJ(gs(t,"package.json"),"utf8"))}catch{return{}}}function fp(t,e){let r=t.scripts?.[e];return typeof r=="string"&&r.trim().length>0?r.trim():void 0}function oJ(t,e){return[t.dependencies,t.devDependencies,t.optionalDependencies,t.peerDependencies].some(r=>r?.[e]!==void 0)}function zke(t,e,r){if(fp(r,"lint"))return{cmd:"npm",args:["run","--silent","lint"]};for(let n of Mke)if(n.configs.some(i=>pp(gs(t,i))))return n.gate;if(Fke.some(n=>pp(gs(t,n)))||r.eslintConfig!==void 0)return e}function qke(t,e){return Uke.some(r=>pp(gs(t,r)))?!0:e.jest!==void 0}function Bke(t){if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?vitest(?:\s+run)?$/i.test(t))return"vitest";if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?jest$/i.test(t))return"jest"}function xP(t,e){let r={...t};return e==="lint"?delete r.lint:delete r.coverage,r}function Hke(t,e){let r=Lke(t),n=e.lint?zke(t,e.lint,r):void 0,i=n?{...e,lint:n}:xP(e,"lint"),o=fp(r,"test"),s=o?Bke(o):void 0;return o&&!s?(i=xP(i,"coverage"),{...i,test:{cmd:"npm",args:["test"]},...fp(r,"coverage")?{coverage:{cmd:"npm",args:["run","--silent","coverage"]}}:{}}):s==="jest"||!o&&qke(t,r)?{...i,test:{cmd:"npx",args:[...Ni,"jest"]},coverage:{cmd:"npx",args:[...Ni,"jest","--coverage"]}}:(s==="vitest"&&!fp(r,"coverage")&&!oJ(r,"@vitest/coverage-v8")&&!oJ(r,"@vitest/coverage-istanbul")?i=xP(i,"coverage"):s==="vitest"&&fp(r,"coverage")&&(i={...i,coverage:{cmd:"npm",args:["run","--silent","coverage"]}}),i)}function dt(t="."){for(let e of Cke){let r;for(let o of e.manifests)if(o.startsWith(".")?r=jke(t,o):r=Nke(t,[o]),r)break;if(!r||e.requiresSource&&!Pke(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"?Hke(t,n):n;return{language:e.language,manifest:r,gates:i}}return Dke}var Ni,Ike,Cke,Dke,Mke,Fke,Uke,on=y(()=>{"use strict";Ev();Ni=["--offline","--no-install"];Ike=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);Cke=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:[...Ni,"tsc","--noEmit"]},lint:{cmd:"npx",args:[...Ni,"eslint","."]},test:{cmd:"npx",args:[...Ni,"vitest","run"]},coverage:{cmd:"npx",args:[...Ni,"vitest","run","--coverage"]},secret:{cmd:"npx",args:[...Ni,"secretlint","**/*"]},arch:{cmd:"npx",args:[...Ni,"madge","--circular","--extensions","ts,tsx,js,jsx","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:Oke},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"swift",manifests:["Package.swift"],gates:{type:{cmd:"swift",args:["build"]},lint:{cmd:"swiftlint",args:["lint"]},test:{cmd:"swift",args:["test"]},coverage:{cmd:"swift",args:["test","--enable-code-coverage"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dart",manifests:["pubspec.yaml"],gates:Rke}],Dke={language:"unknown",manifest:"",gates:{}};Mke=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:[...Ni,"biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:[...Ni,"oxlint"]}}],Fke=["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts",".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"];Uke=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs","jest.config.json"]});import{existsSync as Gke,readFileSync as Zke}from"node:fs";import{join as Vke}from"node:path";function za(t){return t.code==="ENOENT"}function Av(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return cJ.test(o)||cJ.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function qt(t,e,r,n=[]){if(za(r))return{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`};let i=`${String(r.stderr??"")} + if (condition) { yield value; }`)}});import{Buffer as Cxe}from"node:buffer";import{StringDecoder as Dxe}from"node:string_decoder";var Qb,Nxe,jxe,Mxe,gI=y(()=>{rn();Qb=(t,e,r)=>{if(r)return;if(t)return{transform:Nxe.bind(void 0,new TextEncoder)};let n=new Dxe(e);return{transform:jxe.bind(void 0,n),final:Mxe.bind(void 0,n)}},Nxe=function*(t,e){Cxe.isBuffer(e)?yield yo(e):typeof e=="string"?yield t.encode(e):yield e},jxe=function*(t,e){yield Ut(e)?t.write(e):e},Mxe=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as GW}from"node:util";var yI,ev,ZW,Fxe,VW,Lxe,WW=y(()=>{yI=GW(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),ev=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Lxe}=e[r];for await(let i of n(t))yield*ev(i,e,r+1)},ZW=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Fxe(r,Number(e),t)},Fxe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*ev(n,r,e+1)},VW=GW(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Lxe=function*(t){yield t}});var _I,KW,Ma,op,zxe,Uxe,bI=y(()=>{_I=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},KW=(t,e)=>[...e.flatMap(r=>[...Ma(r,t,0)]),...op(t)],Ma=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Uxe}=e[r];for(let i of n(t))yield*Ma(i,e,r+1)},op=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*zxe(r,Number(e),t)},zxe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ma(n,r,e+1)},Uxe=function*(t){yield t}});import{Transform as qxe,getDefaultHighWaterMark as JW}from"node:stream";var vI,tv,YW,rv=y(()=>{vr();Xb();HW();gI();WW();bI();vI=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=YW(t,s,o),l=ja(e),u=ja(r),d=l?yI.bind(void 0,ev,a):_I.bind(void 0,Ma),f=l||u?yI.bind(void 0,ZW,a):_I.bind(void 0,op),p=l||u?VW.bind(void 0,a):void 0;return{stream:new qxe({writableObjectMode:n,writableHighWaterMark:JW(n),readableObjectMode:i,readableHighWaterMark:JW(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},tv=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=YW(s,r,a);t=KW(c,t)}return t},YW=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:UW(n,a)},Qb(r,s,n),Yb(r,o,n,c),{transform:t,final:e},{transform:qW(i,a)},zW({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var XW,Bxe,Hxe,Gxe,Zxe,QW=y(()=>{rv();rn();vr();XW=(t,e)=>{for(let r of Bxe(t))Hxe(t,r,e)},Bxe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Hxe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ps[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>Gxe(a,n));r.input=Bf(s)},Gxe=(t,e)=>{let r=tv(t,e,"utf8",!0);return Zxe(r),Bf(r)},Zxe=t=>{let e=t.find(r=>typeof r!="string"&&!Ut(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var nv,Vxe,Wxe,e3,t3,Kxe,r3,SI=y(()=>{Pa();vr();wl();ls();nv=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Sl(r,n)&&!nn.has(e)&&Vxe(n)&&(t.some(({type:i,value:o})=>i==="native"&&Wxe.has(o))||t.every(({type:i})=>Tn.has(i))),Vxe=t=>t===1||t===2,Wxe=new Set(["pipe","overlapped"]),e3=async(t,e,r,n)=>{for await(let i of t)Kxe(e)||r3(i,r,n)},t3=(t,e,r)=>{for(let n of t)r3(n,e,r)},Kxe=t=>t._readableState.pipes.length>0,r3=(t,e,r)=>{let n=rb(t);Ri({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as Jxe,appendFileSync as Yxe}from"node:fs";var n3,Xxe,Qxe,e0e,t0e,r0e,i3=y(()=>{SI();rv();Xb();rn();vr();Na();n3=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>Xxe({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},Xxe=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=qV(t,o,d),p=yo(f),{stdioItems:m,objectMode:h}=e[r],g=Qxe([p],m,c,n),{serializedResult:b,finalResult:_=b}=e0e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});t0e({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&r0e(b,m,i),S}catch(x){return n.error=x,S}},Qxe=(t,e,r,n)=>{try{return tv(t,e,r,!1)}catch(i){return n.error=i,t}},e0e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Bf(t)};let s=PG(t,r);return n[o]?{serializedResult:s,finalResult:hI(s,!i[o],e)}:{serializedResult:s}},t0e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!nv({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=hI(t,!1,s);try{t3(a,e,n)}catch(c){r.error??=c}},r0e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>Wb.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?Yxe(n,t):(r.add(o),Jxe(n,t))}}});var o3,s3=y(()=>{rn();ip();o3=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,wo(e,r,"all")]:Array.isArray(e)?[wo(t,r,"all"),...e]:Ut(t)&&Ut(e)?uR([t,e]):`${t}${e}`}});import{once as wI}from"node:events";var a3,n0e,c3,l3,i0e,xI,$I=y(()=>{Ra();a3=async(t,e)=>{let[r,n]=await n0e(t);return e.isForcefullyTerminated??=!1,[r,n]},n0e=async t=>{let[e,r]=await Promise.allSettled([wI(t,"spawn"),wI(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?c3(t):r.value},c3=async t=>{try{return await wI(t,"exit")}catch{return c3(t)}},l3=async t=>{let[e,r]=await t;if(!i0e(e,r)&&xI(e,r))throw new Qn;return[e,r]},i0e=(t,e)=>t===void 0&&e===void 0,xI=(t,e)=>t!==0||e!==null});var u3,o0e,d3=y(()=>{Ra();Na();$I();u3=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=o0e(t,e,r),s=o?.code==="ETIMEDOUT",a=UV(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},o0e=(t,e,r)=>t!==void 0?t:xI(e,r)?new Qn:void 0});import{spawnSync as s0e}from"node:child_process";var f3,a0e,c0e,l0e,iv,u0e,d0e,f0e,p0e,p3=y(()=>{bR();VR();WR();np();Gb();MW();ip();QW();i3();Na();s3();d3();f3=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=a0e(t,e,r),d=u0e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Cl(d,c,l)},a0e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ob(t,e,r),a=c0e(r),{file:c,commandArguments:l,options:u}=Pb(t,e,a);l0e(u);let d=NW(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},c0e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,l0e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&iv("ipcInput"),t&&iv("ipc: true"),r&&iv("detached: true"),n&&iv("cancelSignal")},iv=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},u0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=d0e({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=u3(c,r),{output:m,error:h=l}=n3({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>wo(_,r,S)),b=wo(o3(m,r),r,"all");return p0e({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},d0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{XW(o,r);let a=f0e(r);return s0e(...Cb(t,e,a))}catch(a){return Pl({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},f0e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Bb(e)}),p0e=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?Hb({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):rp({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as kI,on as m0e}from"node:events";var m3,h0e,g0e,y0e,_0e,h3=y(()=>{Al();Yf();Jf();m3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(kl({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:kb(t)}),h0e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),h0e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{_b(e,i);let o=fs(t,e,r),s=new AbortController;try{return await Promise.race([g0e(o,n,s),y0e(o,r,s),_0e(o,r,s)])}catch(a){throw El(t),a}finally{s.abort(),bb(e,i)}},g0e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await kI(t,"message",{signal:r});return n}for await(let[n]of m0e(t,"message",{signal:r}))if(e(n))return n},y0e=async(t,e,{signal:r})=>{await kI(t,"disconnect",{signal:r}),E9(e)},_0e=async(t,e,{signal:r})=>{let[n]=await kI(t,"strict:error",{signal:r});throw mb(n,e)}});import{once as y3,on as b0e}from"node:events";var _3,EI,v0e,S0e,w0e,g3,AI=y(()=>{Al();Yf();Jf();_3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>EI({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),EI=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{kl({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:kb(t)}),_b(e,o);let s=fs(t,e,r),a=new AbortController,c={};return v0e(t,s,a),S0e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),w0e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},v0e=async(t,e,r)=>{try{await y3(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},S0e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await y3(t,"strict:error",{signal:r.signal});n.error=mb(i,e),r.abort()}catch{}},w0e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of b0e(r,"message",{signal:o.signal}))g3(s),yield c}catch{g3(s)}finally{o.abort(),bb(e,a),n||El(t),i&&await t}},g3=({error:t})=>{if(t)throw t}});import b3 from"node:process";var v3,S3,w3,TI=y(()=>{Rb();h3();AI();xb();v3=(t,{ipc:e})=>{Object.assign(t,w3(t,!1,e))},S3=()=>{let t=b3,e=!0,r=b3.channel!==void 0;return{...w3(t,e,r),getCancelSignal:eV.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},w3=(t,e,r)=>({sendMessage:Ob.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:m3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:_3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as x0e}from"node:child_process";import{PassThrough as $0e,Readable as k0e,Writable as E0e,Duplex as A0e}from"node:stream";var x3,T0e,sp,O0e,R0e,I0e,P0e,$3=y(()=>{Jb();np();Gb();x3=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{fI(n);let a=new x0e;T0e(a,n),Object.assign(a,{readable:O0e,writable:R0e,duplex:I0e});let c=Pl({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=P0e(c,s,i);return{subprocess:a,promise:l}},T0e=(t,e)=>{let r=sp(),n=sp(),i=sp(),o=Array.from({length:e.length-3},sp),s=sp(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},sp=()=>{let t=new $0e;return t.end(),t},O0e=()=>new k0e({read(){}}),R0e=()=>new E0e({write(){}}),I0e=()=>new A0e({read(){},write(){}}),P0e=async(t,e,r)=>Cl(t,e,r)});import{createReadStream as k3,createWriteStream as E3}from"node:fs";import{Buffer as C0e}from"node:buffer";import{Readable as ap,Writable as D0e,Duplex as N0e}from"node:stream";var T3,cp,A3,j0e,O3=y(()=>{rv();Jb();vr();T3=(t,e)=>Kb(j0e,t,e,!1),cp=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ps[t]}.`)},A3={fileNumber:cp,generator:vI,asyncGenerator:vI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:N0e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},j0e={input:{...A3,fileUrl:({value:t})=>({stream:k3(t)}),filePath:({value:{file:t}})=>({stream:k3(t)}),webStream:({value:t})=>({stream:ap.fromWeb(t)}),iterable:({value:t})=>({stream:ap.from(t)}),asyncIterable:({value:t})=>({stream:ap.from(t)}),string:({value:t})=>({stream:ap.from(t)}),uint8Array:({value:t})=>({stream:ap.from(C0e.from(t))})},output:{...A3,fileUrl:({value:t})=>({stream:E3(t)}),filePath:({value:{file:t,append:e}})=>({stream:E3(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:D0e.fromWeb(t)}),iterable:cp,asyncIterable:cp,string:cp,uint8Array:cp}}});import{on as M0e,once as R3}from"node:events";import{PassThrough as F0e,getDefaultHighWaterMark as L0e}from"node:stream";import{finished as C3}from"node:stream/promises";function Fa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)RI(i);let e=t.some(({readableObjectMode:i})=>i),r=z0e(t,e),n=new OI({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var z0e,OI,U0e,q0e,B0e,RI,H0e,G0e,Z0e,V0e,W0e,D3,N3,II,j3,K0e,ov,I3,P3,sv=y(()=>{z0e=(t,e)=>{if(t.length===0)return L0e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},OI=class extends F0e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(RI(e),this.#t.has(e))return;this.#t.add(e),this.#n??=U0e(this,this.#t,this.#o);let r=H0e({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(RI(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},U0e=async(t,e,r)=>{ov(t,I3);let n=new AbortController;try{await Promise.race([q0e(t,n),B0e(t,e,r,n)])}finally{n.abort(),ov(t,-I3)}},q0e=async(t,{signal:e})=>{try{await C3(t,{signal:e,cleanup:!0})}catch(r){throw D3(t,r),r}},B0e=async(t,e,r,{signal:n})=>{for await(let[i]of M0e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},RI=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},H0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{ov(t,P3);let a=new AbortController;try{await Promise.race([G0e(o,e,a),Z0e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),V0e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),ov(t,-P3)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?II(t):W0e(t))},G0e=async(t,e,{signal:r})=>{try{await t,r.aborted||II(e)}catch(n){r.aborted||D3(e,n)}},Z0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await C3(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;N3(s)?i.add(e):j3(t,s)}},V0e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await R3(t,i,{signal:o}),!t.readable)return R3(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},W0e=t=>{t.writable&&t.end()},D3=(t,e)=>{N3(e)?II(t):j3(t,e)},N3=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",II=t=>{(t.readable||t.writable)&&t.destroy()},j3=(t,e)=>{t.destroyed||(t.once("error",K0e),t.destroy(e))},K0e=()=>{},ov=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},I3=2,P3=1});import{finished as M3}from"node:stream/promises";var Nl,J0e,PI,Y0e,CI,av=y(()=>{_o();Nl=(t,e)=>{t.pipe(e),J0e(t,e),Y0e(t,e)},J0e=async(t,e)=>{if(!(Xn(t)||Xn(e))){try{await M3(t,{cleanup:!0,readable:!0,writable:!1})}catch{}PI(e)}},PI=t=>{t.writable&&t.end()},Y0e=async(t,e)=>{if(!(Xn(t)||Xn(e))){try{await M3(e,{cleanup:!0,readable:!1,writable:!0})}catch{}CI(t)}},CI=t=>{t.readable&&t.destroy()}});var F3,X0e,Q0e,e$e,t$e,r$e,L3=y(()=>{sv();_o();yb();vr();av();F3=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>Tn.has(c)))X0e(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!Tn.has(c)))e$e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Fa(o);Nl(s,i)}},X0e=(t,e,r,n)=>{r==="output"?Nl(t.stdio[n],e):Nl(e,t.stdio[n]);let i=Q0e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},Q0e=["stdin","stdout","stderr"],e$e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;t$e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},t$e=(t,{signal:e})=>{Xn(t)&&Ia(t,r$e,e)},r$e=2});var La,z3=y(()=>{La=[];La.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&La.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&La.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var cv,DI,NI,n$e,jI,lv,i$e,MI,FI,LI,U3,Nst,jst,q3=y(()=>{z3();cv=t=>!!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",DI=Symbol.for("signal-exit emitter"),NI=globalThis,n$e=Object.defineProperty.bind(Object),jI=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(NI[DI])return NI[DI];n$e(NI,DI,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},lv=class{},i$e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),MI=class extends lv{onExit(){return()=>{}}load(){}unload(){}},FI=class extends lv{#t=LI.platform==="win32"?"SIGINT":"SIGHUP";#r=new jI;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of La)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!cv(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of La)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,La.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return cv(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&cv(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},LI=globalThis.process,{onExit:U3,load:Nst,unload:jst}=i$e(cv(LI)?new FI(LI):new MI)});import{addAbortListener as o$e}from"node:events";var B3,H3=y(()=>{q3();B3=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=U3(()=>{t.kill()});o$e(n,()=>{i()})}});var Z3,s$e,a$e,G3,c$e,V3=y(()=>{lR();ib();ds();bl();Z3=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=nb(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=s$e(r,n,i),{sourceStream:d,sourceError:f}=c$e(t,l),{options:p,fileDescriptors:m}=Pi.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},s$e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=a$e(t,e,...r),a=gb(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},a$e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(G3,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||aR(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=Z_(r,...n);return{destination:e(G3)(i,o,s),pipeOptions:s}}if(Pi.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},G3=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),c$e=(t,e)=>{try{return{sourceStream:Ol(t,e)}}catch(r){return{sourceError:r}}}});var K3,l$e,zI,W3,UI=y(()=>{np();av();K3=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=l$e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw zI({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},l$e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return CI(t),n;if(e!==void 0)return PI(r),e},zI=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Pl({error:t,command:W3,escapedCommand:W3,fileDescriptors:e,options:r,startTime:n,isSync:!1}),W3="source.pipe(destination)"});var J3,Y3=y(()=>{J3=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as u$e}from"node:stream/promises";var X3,d$e,f$e,p$e,uv,m$e,h$e,Q3=y(()=>{sv();yb();av();X3=(t,e,r)=>{let n=uv.has(e)?f$e(t,e):d$e(t,e);return Ia(t,m$e,r.signal),Ia(e,h$e,r.signal),p$e(e),n},d$e=(t,e)=>{let r=Fa([t]);return Nl(r,e),uv.set(e,r),r},f$e=(t,e)=>{let r=uv.get(e);return r.add(t),r},p$e=async t=>{try{await u$e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}uv.delete(t)},uv=new WeakMap,m$e=2,h$e=1});import{aborted as g$e}from"node:util";var eK,y$e,tK=y(()=>{UI();eK=(t,e)=>t===void 0?[]:[y$e(t,e)],y$e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await g$e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw zI({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var dv,_$e,b$e,rK=y(()=>{go();V3();UI();Y3();Q3();tK();dv=(t,...e)=>{if(Ot(e[0]))return dv.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Z3(t,...e),i=_$e({...n,destination:r});return i.pipe=dv.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},_$e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=b$e(t,i);K3({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=X3(e,o,d);return await Promise.race([J3(u),...eK(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},b$e=(t,e)=>Promise.allSettled([t,e])});import{on as v$e}from"node:events";import{getDefaultHighWaterMark as S$e}from"node:stream";var fv,w$e,qI,x$e,iK,BI,nK,$$e,k$e,pv=y(()=>{gI();Xb();bI();fv=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return w$e(e,s),iK({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},w$e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},qI=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;x$e(e,s,t);let a=t.readableObjectMode&&!o;return iK({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},x$e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},iK=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=v$e(t,"data",{signal:e.signal,highWaterMark:nK,highWatermark:nK});return $$e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},BI=S$e(!0),nK=BI,$$e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=k$e({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ma(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*op(a)}},k$e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[Qb(t,r,!e),Yb(t,i,!n,{})].filter(Boolean)});import{setImmediate as E$e}from"node:timers/promises";var oK,A$e,T$e,O$e,HI,sK,GI=y(()=>{qb();rn();SI();pv();Na();ip();oK=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=A$e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([T$e(t),d]);return}let f=pI(c,r),p=qI({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([O$e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},A$e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!nv({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=qI({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await e3(a,t,r,o)},T$e=async t=>{await E$e(),t.readableFlowing===null&&t.resume()},O$e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await Fb(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await Lb(r,{maxBuffer:o})):await Ub(r,{maxBuffer:o})}catch(a){return sK(FV({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},HI=async t=>{try{return await t}catch(e){return sK(e)}},sK=({bufferedData:t})=>RG(t)?new Uint8Array(t):t});import{finished as R$e}from"node:stream/promises";var lp,I$e,P$e,C$e,D$e,N$e,ZI,mv,aK,hv=y(()=>{lp=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=I$e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],R$e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||D$e(a,e,r,n)}finally{s.abort()}},I$e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&P$e(t,r,n),n},P$e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{C$e(e,r),n.call(t,...i)}},C$e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},D$e=(t,e,r,n)=>{if(!N$e(t,e,r,n))throw t},N$e=(t,e,r,n=!0)=>r.propagating?aK(t)||mv(t):(r.propagating=!0,ZI(r,e)===n?aK(t):mv(t)),ZI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",mv=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",aK=t=>t?.code==="EPIPE"});var cK,VI,WI=y(()=>{GI();hv();cK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>VI({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),VI=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=lp(t,e,l);if(ZI(l,e)){await u;return}let[d]=await Promise.all([oK({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var lK,uK,j$e,M$e,KI=y(()=>{sv();WI();lK=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Fa([t,e].filter(Boolean)):void 0,uK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>VI({...j$e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:M$e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),j$e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},M$e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var dK,fK,pK=y(()=>{wl();ls();dK=t=>Sl(t,"ipc"),fK=(t,e)=>{let r=rb(t);Ri({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var mK,hK,gK=y(()=>{Na();pK();vo();AI();mK=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=dK(o),a=bo(e,"ipc"),c=bo(r,"ipc");for await(let l of EI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(LV(t,i,c),i.push(l)),s&&fK(l,o);return i},hK=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as F$e}from"node:events";var yK,L$e,z$e,U$e,_K=y(()=>{Da();qR();CR();UR();_o();vr();GI();gK();HR();KI();WI();$I();hv();yK=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:b})=>{let _=a3(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=cK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=uK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),O=[],T=mK({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),A=L$e(h,t,S),D=z$e(m,S);try{return await Promise.race([Promise.all([{},l3(_),Promise.all(x),w,T,uV(t,d),...A,...D]),g,U$e(t,b),...oV(t,o,f,b),...k9({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...nV({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch($){return f.terminationReason??="other",Promise.all([{error:$},_,Promise.all(x.map(re=>HI(re))),HI(w),hK(T,O),Promise.allSettled(A),Promise.allSettled(D)])}},L$e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:lp(n,i,r)),z$e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>ti(o,{checkOpen:!1})&&!Xn(o)).map(({type:i,value:o,stream:s=o})=>lp(s,n,e,{isSameDirection:Tn.has(i),stopOnExit:i==="native"}))),U$e=async(t,{signal:e})=>{let[r]=await F$e(t,"error",{signal:e});throw r}});var bK,up,jl,gv=y(()=>{Tl();bK=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),up=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Ii();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},jl=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as vK}from"node:stream/promises";var JI,SK,YI,XI,yv,_v,QI=y(()=>{hv();JI=async t=>{if(t!==void 0)try{await YI(t)}catch{}},SK=async t=>{if(t!==void 0)try{await XI(t)}catch{}},YI=async t=>{await vK(t,{cleanup:!0,readable:!1,writable:!0})},XI=async t=>{await vK(t,{cleanup:!0,readable:!0,writable:!1})},yv=async(t,e)=>{if(await t,e)throw e},_v=(t,e,r)=>{r&&!mv(r)?t.destroy(r):e&&t.destroy()}});import{Readable as q$e}from"node:stream";import{callbackify as B$e}from"node:util";var wK,eP,tP,rP,H$e,nP,iP,xK,oP=y(()=>{Pa();ds();pv();Tl();gv();QI();wK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||nn.has(r),{subprocessStdout:a,waitReadableDestroy:c}=eP(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=tP(a,s),{read:f,onStdoutDataDone:p}=rP({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new q$e({read:f,destroy:B$e(iP.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return nP({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},eP=(t,e,r)=>{let n=Ol(t,e),i=up(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},tP=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:BI},rP=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Ii(),s=fv({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){H$e(this,s,o)},onStdoutDataDone:o}},H$e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},nP=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await XI(t),await n,await JI(i),await e,r.readable&&r.push(null)}catch(o){await JI(i),xK(r,o)}},iP=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await jl(r,e)&&(xK(t,n),await yv(e,n))},xK=(t,e)=>{_v(t,t.readable,e)}});import{Writable as G$e}from"node:stream";import{callbackify as $K}from"node:util";var kK,sP,aP,Z$e,V$e,cP,lP,EK,uP=y(()=>{ds();gv();QI();kK=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=sP(t,r,e),s=new G$e({...aP(n,t,i),destroy:$K(lP.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return cP(n,s),s},sP=(t,e,r)=>{let n=gb(t,e),i=up(r,n,"writableFinal"),o=up(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},aP=(t,e,r)=>({write:Z$e.bind(void 0,t),final:$K(V$e.bind(void 0,t,e,r))}),Z$e=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},V$e=async(t,e,r)=>{await jl(r,e)&&(t.writable&&t.end(),await e)},cP=async(t,e,r)=>{try{await YI(t),e.writable&&e.end()}catch(n){await SK(r),EK(e,n)}},lP=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await jl(r,e),await jl(n,e)&&(EK(t,i),await yv(e,i))},EK=(t,e)=>{_v(t,t.writable,e)}});import{Duplex as W$e}from"node:stream";import{callbackify as K$e}from"node:util";var AK,J$e,TK=y(()=>{Pa();oP();uP();AK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||nn.has(r),{subprocessStdout:c,waitReadableDestroy:l}=eP(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=sP(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=tP(c,a),{read:g,onStdoutDataDone:b}=rP({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new W$e({read:g,...aP(u,t,d),destroy:K$e(J$e.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return nP({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),cP(u,_,c),_},J$e=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([iP({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),lP({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var dP,Y$e,OK=y(()=>{Pa();ds();pv();dP=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||nn.has(e),s=Ol(t,r),a=fv({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return Y$e(a,s,t)},Y$e=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var RK,IK=y(()=>{gv();oP();uP();TK();OK();RK=(t,{encoding:e})=>{let r=bK();t.readable=wK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=kK.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=AK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=dP.bind(void 0,t,e),t[Symbol.asyncIterator]=dP.bind(void 0,t,e,{})}});var PK,X$e,Q$e,CK=y(()=>{PK=(t,e)=>{for(let[r,n]of Q$e){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},X$e=(async()=>{})().constructor.prototype,Q$e=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(X$e,t)])});import{setMaxListeners as eke}from"node:events";import{spawn as tke}from"node:child_process";var DK,rke,nke,ike,oke,ske,NK=y(()=>{qb();bR();VR();ds();WR();TI();np();Gb();$3();O3();ip();L3();fb();H3();rK();KI();_K();IK();Tl();CK();DK=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=rke(t,e,r),{subprocess:f,promise:p}=ike({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=dv.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),PK(f,p),Pi.set(f,{options:u,fileDescriptors:d}),f},rke=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ob(t,e,r),{file:a,commandArguments:c,options:l}=Pb(t,e,r),u=nke(l),d=T3(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},nke=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},ike=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=tke(...Cb(t,e,r))}catch(m){return x3({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;eke(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];F3(c,a,l),B3(c,r,l);let d={},f=Ii();c.kill=x9.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=lK(c,r),RK(c,r),v3(c,r);let p=oke({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},oke=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await yK({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map((x,w)=>wo(x,e,w)),_=wo(h,e,"all"),S=ske({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Cl(S,n,e)},ske=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?rp({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Ci,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):Hb({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var bv,ake,cke,jK=y(()=>{go();vo();bv=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,ake(n,t[n],i)]));return{...t,...r}},ake=(t,e,r)=>cke.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,cke=new Set(["env",...mR])});var ms,lke,uke,MK=y(()=>{go();lR();FG();p3();NK();jK();ms=(t,e,r,n)=>{let i=(s,a,c)=>ms(s,a,r,c),o=(...s)=>lke({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},lke=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Ot(o))return i(t,bv(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=uke({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?f3(a,c,l):DK(a,c,l,i)},uke=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=jG(e)?MG(e,r):[e,...r],[s,a,c]=Z_(...o),l=bv(bv(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var FK,LK,zK,dke,fke,UK=y(()=>{FK=({file:t,commandArguments:e})=>zK(t,e),LK=({file:t,commandArguments:e})=>({...zK(t,e),isSync:!0}),zK=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=dke(t);return{file:r,commandArguments:n}},dke=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(fke)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},fke=/ +/g});var qK,BK,pke,HK,mke,GK,ZK=y(()=>{qK=(t,e,r)=>{t.sync=e(pke,r),t.s=t.sync},BK=({options:t})=>HK(t),pke=({options:t})=>({...HK(t),isSync:!0}),HK=t=>({options:{...mke(t),...t}}),mke=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},GK={preferLocal:!0}});var klt,Ye,Elt,Alt,Tlt,Olt,Rlt,Ilt,Plt,Clt,Mr=y(()=>{MK();UK();BR();ZK();TI();klt=ms(()=>({})),Ye=ms(()=>({isSync:!0})),Elt=ms(FK),Alt=ms(LK),Tlt=ms(aV),Olt=ms(BK,{},GK,qK),{sendMessage:Rlt,getOneMessage:Ilt,getEachMessage:Plt,getCancelSignal:Clt}=S3()});import{existsSync as vv,statSync as hke}from"node:fs";import{dirname as fP,extname as gke,isAbsolute as VK,join as pP,relative as mP,resolve as Sv,sep as yke}from"node:path";function wv(t){return t==="./gradlew"||t==="gradle"}function _ke(t){return(vv(pP(t,"build.gradle.kts"))||vv(pP(t,"build.gradle")))&&vv(pP(t,"gradle.properties"))}function bke(t,e){let n=mP(t,e).split(yke).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function hs(t,e){return t===":"?`:${e}`:`${t}:${e}`}function vke(t,e){let r=Sv(t,e),n=r;vv(r)?hke(r).isFile()&&(n=fP(r)):gke(r)!==""&&(n=fP(r));let i=mP(t,n);if(i.startsWith("..")||VK(i))return null;let o=n;for(;;){if(_ke(o))return o;if(Sv(o)===Sv(t))return null;let s=fP(o);if(s===o)return null;let a=mP(t,s);if(a.startsWith("..")||VK(a))return null;o=s}}function xv(t,e){let r=Sv(t),n=new Map,i=[];for(let o of e){let s=vke(r,o);if(!s){i.push(o);continue}let a=bke(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var $v=y(()=>{"use strict"});import{existsSync as gP,readFileSync as Ske}from"node:fs";import{join as Ml}from"node:path";function Fl(t="."){let e=Ml(t,".cladding","config.yaml");if(!gP(e))return hP;try{let n=(0,WK.parse)(Ske(e,"utf8"))?.gate;if(!n)return hP;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of wke){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return hP}}function KK(t="."){let e=Fl(t).testReport,r=e?[e,...yP]:yP;return[...new Set(r.map(n=>Ml(t,n)))]}function JK(t="."){let e=Fl(t).testReport;if(e){let r=Ml(t,e);return gP(r)?r:null}return yP.map(r=>Ml(t,r)).find(r=>gP(r))??null}function YK(t,e){let r=[],n=!1;for(let i of t){let o=xke.exec(i);if(o){n=!0;for(let s of e)r.push(hs(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var WK,wke,hP,yP,xke,dp=y(()=>{"use strict";WK=St(Qt(),1);$v();wke=["type","lint","test","coverage"],hP={scope:"feature"},yP=["test-report.junit.xml",Ml("coverage","junit.xml"),Ml(".cladding","test-report.junit.xml")];xke=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as bP,readFileSync as XK,readdirSync as $ke,statSync as kke}from"node:fs";import{join as kv}from"node:path";function wP(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=kv(t,e);if(bP(r))try{if(QK.test(XK(r,"utf8")))return!0}catch{}}return!1}function eJ(t){try{return bP(t)&&QK.test(XK(t,"utf8"))}catch{return!1}}function tJ(t,e=0){if(e>4||!bP(t))return!1;let r;try{r=$ke(t)}catch{return!1}for(let n of r){let i=kv(t,n),o=!1;try{o=kke(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(tJ(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&eJ(i))return!0}return!1}function Tke(t){if(wP(t))return!0;for(let e of Eke)if(eJ(kv(t,e)))return!0;for(let e of Ake)if(tJ(kv(t,e)))return!0;return!1}function rJ(t="."){let e=Fl(t).coverage;return e||(Tke(t)?"kover":"jacoco")}function nJ(t="."){return vP[rJ(t)]}function iJ(t="."){return _P[rJ(t)]}var vP,_P,SP,QK,Eke,Ake,Ev=y(()=>{"use strict";dp();vP={kover:"koverXmlReport",jacoco:"jacocoTestReport"},_P={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},SP=[_P.kover,_P.jacoco],QK=/kover/i;Eke=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],Ake=["buildSrc","build-logic"]});import{existsSync as pp,readFileSync as sJ,readdirSync as aJ}from"node:fs";import{join as gs}from"node:path";function $P(t){return pp(gs(t,"gradlew"))?"./gradlew":"gradle"}function Oke(t){let e=$P(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[nJ(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function Rke(t){let e=!1;try{e=/(^|\n)\s*flutter\s*:|sdk:\s*flutter/.test(sJ(gs(t,"pubspec.yaml"),"utf8"))}catch{}let r={cmd:"dart",args:["format","--output=none","--set-exit-if-changed","."]},n={cmd:"gitleaks",args:["detect","--no-banner"]};return e?{type:{cmd:"flutter",args:["analyze"]},lint:r,test:{cmd:"flutter",args:["test"]},coverage:{cmd:"flutter",args:["test","--coverage"]},secret:n}:{type:{cmd:"dart",args:["analyze"]},lint:r,test:{cmd:"dart",args:["test"]},coverage:{cmd:"dart",args:["test","--coverage=coverage"]},secret:n}}function Pke(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function Nke(t,e){for(let r of e)if(pp(gs(t,r)))return r}function jke(t,e){try{return aJ(t).find(n=>n.endsWith(e))}catch{return}}function Lke(t){try{return JSON.parse(sJ(gs(t,"package.json"),"utf8"))}catch{return{}}}function fp(t,e){let r=t.scripts?.[e];return typeof r=="string"&&r.trim().length>0?r.trim():void 0}function oJ(t,e){return[t.dependencies,t.devDependencies,t.optionalDependencies,t.peerDependencies].some(r=>r?.[e]!==void 0)}function zke(t,e,r){if(fp(r,"lint"))return{cmd:"npm",args:["run","--silent","lint"]};for(let n of Mke)if(n.configs.some(i=>pp(gs(t,i))))return n.gate;if(Fke.some(n=>pp(gs(t,n)))||r.eslintConfig!==void 0)return e}function qke(t,e){return Uke.some(r=>pp(gs(t,r)))?!0:e.jest!==void 0}function Bke(t){if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?vitest(?:\s+run)?$/i.test(t))return"vitest";if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?jest$/i.test(t))return"jest"}function xP(t,e){let r={...t};return e==="lint"?delete r.lint:delete r.coverage,r}function Hke(t,e){let r=Lke(t),n=e.lint?zke(t,e.lint,r):void 0,i=n?{...e,lint:n}:xP(e,"lint"),o=fp(r,"test"),s=o?Bke(o):void 0;return o&&!s?(i=xP(i,"coverage"),{...i,test:{cmd:"npm",args:["test"]},...fp(r,"coverage")?{coverage:{cmd:"npm",args:["run","--silent","coverage"]}}:{}}):s==="jest"||!o&&qke(t,r)?{...i,test:{cmd:"npx",args:[...Ni,"jest"]},coverage:{cmd:"npx",args:[...Ni,"jest","--coverage"]}}:(s==="vitest"&&!fp(r,"coverage")&&!oJ(r,"@vitest/coverage-v8")&&!oJ(r,"@vitest/coverage-istanbul")?i=xP(i,"coverage"):s==="vitest"&&fp(r,"coverage")&&(i={...i,coverage:{cmd:"npm",args:["run","--silent","coverage"]}}),i)}function dt(t="."){for(let e of Cke){let r;for(let o of e.manifests)if(o.startsWith(".")?r=jke(t,o):r=Nke(t,[o]),r)break;if(!r||e.requiresSource&&!Pke(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"?Hke(t,n):n;return{language:e.language,manifest:r,gates:i}}return Dke}var Ni,Ike,Cke,Dke,Mke,Fke,Uke,on=y(()=>{"use strict";Ev();Ni=["--offline","--no-install"];Ike=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);Cke=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:[...Ni,"tsc","--noEmit"]},lint:{cmd:"npx",args:[...Ni,"eslint","."]},test:{cmd:"npx",args:[...Ni,"vitest","run"]},coverage:{cmd:"npx",args:[...Ni,"vitest","run","--coverage"]},secret:{cmd:"npx",args:[...Ni,"secretlint","**/*"]},arch:{cmd:"npx",args:[...Ni,"madge","--circular","--extensions","ts,tsx,js,jsx","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:Oke},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"swift",manifests:["Package.swift"],gates:{type:{cmd:"swift",args:["build"]},lint:{cmd:"swiftlint",args:["lint"]},test:{cmd:"swift",args:["test"]},coverage:{cmd:"swift",args:["test","--enable-code-coverage"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dart",manifests:["pubspec.yaml"],gates:Rke}],Dke={language:"unknown",manifest:"",gates:{}};Mke=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:[...Ni,"biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:[...Ni,"oxlint"]}}],Fke=["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts",".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"];Uke=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs","jest.config.json"]});import{existsSync as Gke,readFileSync as Zke}from"node:fs";import{join as Vke}from"node:path";function za(t){return t.code==="ENOENT"}function Av(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return cJ.test(o)||cJ.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function qt(t,e,r,n=[]){if(za(r))return{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`};let i=`${String(r.stderr??"")} ${String(r.stdout??"")}`,o=/ENOTCACHED|ENOTFOUND|EAI_AGAIN|canceled due to missing packages|could not determine executable/i.test(i),a=n.find(l=>l!=="--"&&!l.startsWith("-"))?.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=r.exitCode===127&&a!==void 0&&new RegExp(`(?:^|[\\s:])${a}: (?:command )?not found\\b`,"i").test(i);return e==="npx"&&(o||c)?{stage:t,pass:!1,exitCode:2,stderr:"setup gap: 'npx' could not resolve the configured tool without installing it; the inferred tool is not installed or unavailable offline"}:null}function tr(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Ll(t,e){let r=Vke(t,"package.json");if(!Gke(r))return!1;try{return!!JSON.parse(Zke(r,"utf8")).scripts?.[e]}catch{return!1}}var cJ,On=y(()=>{"use strict";cJ=/config (is |file )?not found|no such file|ENOENT|ENOTCACHED|ENOTFOUND|EAI_AGAIN|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function Wke(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.arch;if(!n)return[{detector:Tv,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=Ye(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Tv,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:Av(i,Tv,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var Tv,Ua,Ov=y(()=>{"use strict";Mr();on();On();Tv="ARCHITECTURE_VIOLATION";Ua={name:Tv,subprocess:!0,run:Wke}});function Kke(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.secret;if(!n)return[{detector:Rv,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=Ye(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Rv,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:Av(i,Rv,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var Rv,qa,Iv=y(()=>{"use strict";Mr();on();On();Rv="HARDCODED_SECRET";qa={name:Rv,subprocess:!0,run:Kke}});import{existsSync as kP,readdirSync as lJ}from"node:fs";import{join as Pv}from"node:path";function Yke(t,e){let r=Pv(t,e.path);if(!kP(r))return!0;if(e.isDirectory)try{return lJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function Xke(t){let{cwd:e="."}=t,r=[];for(let i of Jke)Yke(e,i)&&r.push({detector:mp,severity:i.severity,path:i.path,message:`${i.path} is absent \u2014 cladding scaffold incomplete (${i.purpose}). Run \`clad init --intent ""\` to populate it.`});let n=Pv(e,"spec.yaml");if(kP(n)){let i=tEe(n),o=i?null:Qke(e);if(i)r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present but unreadable (${i}) \u2014 cladding is governing nothing. Fix the SSoT root, then \`clad sync\` to validate.`});else if(o)r.push({detector:mp,severity:"error",path:o.path,message:`spec shard '${o.path}' is present but unparseable (${o.reason}) \u2014 loadSpec throws on it, so every spec-gated detector silently passes. Fix it, then \`clad sync\`.`});else{let s=eEe(e);s&&r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present and parses, but the assembled spec does not load (${s}) \u2014 every spec-gated detector then degrades to non-blocking info, so the gate would pass GREEN on an unloadable SSoT. Fix it, then \`clad sync\` to validate.`})}}return r}function Qke(t){for(let e of["spec/features","spec/scenarios"]){let r=Pv(t,e);if(!kP(r))continue;let n;try{n=lJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{Ai(Pv(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function eEe(t){try{return H(t),null}catch(e){return e.message}}function tEe(t){let e;try{e=Ai(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var mp,Jke,uJ,dJ=y(()=>{"use strict";Be();j_();mp="ABSENCE_OF_GOVERNANCE",Jke=[{path:"spec.yaml",severity:"error",purpose:"SSoT root \u2014 every spec-gated detector needs it"},{path:"spec/architecture.yaml",severity:"warn",purpose:"architecture invariants (layers + forbidden_imports)"},{path:"spec/capabilities.yaml",severity:"warn",purpose:"capability \u2194 feature traceability"},{path:"docs/project-context.md",severity:"warn",purpose:"intent narrative + decision history"},{path:"docs/conventions.md",severity:"info",purpose:"project style guide (recommended)"},{path:"spec/scenarios",severity:"info",purpose:"user-journey scenarios (recommended)",isDirectory:!0}];uJ={name:mp,run:Xke}});function Cv(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function EP(t,e){let r=e?.trim()??"";if(!t)return r.length>0?"condition is present but ears pattern is not declared":null;if(t==="ubiquitous")return r.length>0?`ears='ubiquitous' but condition is present ('${r.slice(0,40)}\u2026')`:null;if(t==="complex"){if(r.length===0)return"ears='complex' requires a 'while' precondition and a 'when' trigger \u2014 empty";let i=Cv(r)==="while",o=nEe.test(r);return i?o?null:"ears='complex' requires a 'when' trigger clause after the 'while' precondition \u2014 none found":`ears='complex' requires the condition to start with 'while' (precondition) \u2014 got '${Cv(r)}'`}let n=rEe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:Cv(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${Cv(r)}'`:null}function iEe(t,e){let r=EP(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function fJ(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...iEe(r,n));return e}var rEe,nEe,AP=y(()=>{"use strict";rEe={event:"when",state:"while",optional:"where",unwanted:"if"},nEe=/\bwhen\b/i});function ge(t,e,r){let n;try{n=H(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var wt=y(()=>{"use strict";Be()});function oEe(t){let{cwd:e="."}=t;return ge(e,Dv,sEe)}function sEe(t){let e=[];for(let r of t.features)for(let n of r.acceptance_criteria??[]){let i=!!n.text?.trim(),o=!!(n.condition?.trim()||n.action?.trim()||n.response?.trim());!i&&!o&&e.push({detector:Dv,severity:"error",message:`${r.id}.${n.id} has neither rendered text nor any EARS field (condition/action/response) \u2014 structurally empty AC`})}for(let r of fJ(t.features))e.push({detector:Dv,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var Dv,pJ,mJ=y(()=>{"use strict";AP();wt();Dv="AC_DRIFT";pJ={name:Dv,run:oEe}});function ji(t=".",e){let n=(e??"").trim().toLowerCase()||dt(t).language;return gJ[n]??hJ}var aEe,cEe,lEe,hJ,uEe,dEe,gJ,fEe,yJ,Ba=y(()=>{"use strict";on();aEe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,cEe=/^[ \t]*import\s+([\w.]+)/gm,lEe=/^[ \t]*(?:from|import)\s+([\w.]+)/gm,hJ={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:aEe,importStyle:"relative"},uEe={ext:"kt",extensions:[".kt",".kts"],sourceRoots:["src/main/kotlin","src/test/kotlin"],mainRoot:"src/main/kotlin",testGlobs:["src/test/kotlin/**/*Test.kt","src/test/kotlin/**/*Tests.kt"],coverageSummary:"build/reports/jacoco/test/jacocoTestReport.xml",coverageFormat:"jacoco-xml",importMatcher:cEe,importStyle:"dotted"},dEe={ext:"py",extensions:[".py"],sourceRoots:["."],mainRoot:"src",testGlobs:["tests/test_*.py","tests/**/test_*.py","tests/**/*_test.py"],coverageSummary:"coverage.xml",coverageFormat:"cobertura-xml",importMatcher:lEe,importStyle:"dotted"},gJ={typescript:hJ,kotlin:uEe,python:dEe},fEe=[".js",".jsx",".mts",".cts",".rs",".go",".java",".rb",".php",".cs",".fs",".ex",".exs"],yJ=new Set([...Object.values(gJ).flatMap(t=>t?.extensions??[]),...fEe].map(t=>t.toLowerCase()))});import{existsSync as pEe,readFileSync as mEe,readdirSync as hEe,statSync as gEe}from"node:fs";import{join as bJ,relative as _J}from"node:path";function yEe(t,e){if(!pEe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=hEe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=bJ(i,s),c;try{c=gEe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function _Ee(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function vEe(t){return bEe.test(t)}function SEe(t){let{cwd:e="."}=t,r;try{r=H(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=ji(e,r.project?.language),o=i.sourceRoots.flatMap(a=>yEe(bJ(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=mEe(a,"utf8")}catch{continue}let l=c.split(` -`);for(let u=0;u{"use strict";Be();Ba();vJ="AI_HINTS_FORBIDDEN_PATTERN";bEe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;SJ={name:vJ,run:SEe}});function wEe(t){let{cwd:e="."}=t,r;try{r=H(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:xJ,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var xJ,$J,kJ=y(()=>{"use strict";Be();xJ="AC_DUPLICATE_WITHIN_FEATURE";$J={name:xJ,run:wEe}});import{createRequire as xEe}from"module";import{basename as $Ee,dirname as OP,normalize as kEe,relative as EEe,resolve as AEe,sep as TJ}from"path";import*as TEe from"fs";function OEe(t){let e=kEe(t);return e.length>1&&e[e.length-1]===TJ&&(e=e.substring(0,e.length-1)),e}function OJ(t,e){return t.replace(REe,e)}function PEe(t){return t==="/"||IEe.test(t)}function TP(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=AEe(t)),(n||o)&&(t=OEe(t)),t===".")return"";let s=t[t.length-1]!==i;return OJ(s?t+i:t,i)}function RJ(t,e){return e+t}function CEe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:OJ(EEe(t,n),e.pathSeparator)+e.pathSeparator+r}}function DEe(t){return t}function NEe(t,e,r){return e+t+r}function jEe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?CEe(t,e):n?RJ:DEe}function MEe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function FEe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function qEe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?FEe(t):MEe(t):n&&n.length?zEe:LEe:UEe}function WEe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?VEe:r&&r.length?n?BEe:HEe:n?GEe:ZEe}function YEe(t){return t.group?JEe:KEe}function eAe(t){return t.group?XEe:QEe}function nAe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?rAe:tAe}function IJ(t,e,r){if(r.options.useRealPaths)return iAe(e,r);let n=OP(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=OP(n)}return r.symlinks.set(t,e),i>1}function iAe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function Nv(t,e,r,n){e(t&&!n?t:null,r)}function pAe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?oAe:lAe:n?e?sAe:fAe:i?e?cAe:dAe:e?aAe:uAe}function gAe(t){return t?hAe:mAe}function vAe(t,e){return new Promise((r,n)=>{DJ(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function DJ(t,e,r){new CJ(t,e,r).start()}function SAe(t,e){return new CJ(t,e).start()}var EJ,REe,IEe,LEe,zEe,UEe,BEe,HEe,GEe,ZEe,VEe,KEe,JEe,XEe,QEe,tAe,rAe,oAe,sAe,aAe,cAe,lAe,uAe,dAe,fAe,PJ,mAe,hAe,yAe,_Ae,bAe,CJ,AJ,NJ,jJ,MJ=y(()=>{EJ=xEe(import.meta.url);REe=/[\\/]/g;IEe=/^[a-z]:[\\/]$/i;LEe=(t,e)=>{e.push(t||".")},zEe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},UEe=()=>{};BEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},HEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},GEe=(t,e,r,n)=>{r.files++},ZEe=(t,e)=>{e.push(t)},VEe=()=>{};KEe=t=>t,JEe=()=>[""].slice(0,0);XEe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},QEe=()=>{};tAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&IJ(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},rAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&IJ(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};oAe=t=>t.counts,sAe=t=>t.groups,aAe=t=>t.paths,cAe=t=>t.paths.slice(0,t.options.maxFiles),lAe=(t,e,r)=>(Nv(e,r,t.counts,t.options.suppressErrors),null),uAe=(t,e,r)=>(Nv(e,r,t.paths,t.options.suppressErrors),null),dAe=(t,e,r)=>(Nv(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),fAe=(t,e,r)=>(Nv(e,r,t.groups,t.options.suppressErrors),null);PJ={withFileTypes:!0},mAe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",PJ,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},hAe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",PJ)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};yAe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},_Ae=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},bAe=class{aborted=!1;abort(){this.aborted=!0}},CJ=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=pAe(e,this.isSynchronous),this.root=TP(t,e),this.state={root:PEe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new _Ae,options:e,queue:new yAe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new bAe,fs:e.fs||TEe},this.joinPath=jEe(this.root,e),this.pushDirectory=qEe(this.root,e),this.pushFile=WEe(e),this.getArray=YEe(e),this.groupFiles=eAe(e),this.resolveSymlink=nAe(e,this.isSynchronous),this.walkDirectory=gAe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(b.isDirectory()){if(_=TP(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let S=$Ee(_),x=TP(OP(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};AJ=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return vAe(this.root,this.options)}withCallback(t){DJ(this.root,this.options,t)}sync(){return SAe(this.root,this.options)}},NJ=null;try{EJ.resolve("picomatch"),NJ=EJ("picomatch")}catch{}jJ=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:TJ,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new AJ(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new AJ(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||NJ;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var hp=v((jut,qJ)=>{"use strict";var FJ="[^\\\\/]",wAe="(?=.)",LJ="[^/]",RP="(?:\\/|$)",zJ="(?:^|\\/)",IP=`\\.{1,2}${RP}`,xAe="(?!\\.)",$Ae=`(?!${zJ}${IP})`,kAe=`(?!\\.{0,1}${RP})`,EAe=`(?!${IP})`,AAe="[^.\\/]",TAe=`${LJ}*?`,OAe="/",UJ={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:wAe,QMARK:LJ,END_ANCHOR:RP,DOTS_SLASH:IP,NO_DOT:xAe,NO_DOTS:$Ae,NO_DOT_SLASH:kAe,NO_DOTS_SLASH:EAe,QMARK_NO_DOT:AAe,STAR:TAe,START_ANCHOR:zJ,SEP:OAe},RAe={...UJ,SLASH_LITERAL:"[\\\\/]",QMARK:FJ,STAR:`${FJ}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},IAe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};qJ.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:IAe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?RAe:UJ}}});var gp=v(Fr=>{"use strict";var{REGEX_BACKSLASH:PAe,REGEX_REMOVE_BACKSLASH:CAe,REGEX_SPECIAL_CHARS:DAe,REGEX_SPECIAL_CHARS_GLOBAL:NAe}=hp();Fr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Fr.hasRegexChars=t=>DAe.test(t);Fr.isRegexChar=t=>t.length===1&&Fr.hasRegexChars(t);Fr.escapeRegex=t=>t.replace(NAe,"\\$1");Fr.toPosixSlashes=t=>t.replace(PAe,"/");Fr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Fr.removeBackslashes=t=>t.replace(CAe,e=>e==="\\"?"":e);Fr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Fr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Fr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Fr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Fr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var JJ=v((Fut,KJ)=>{"use strict";var BJ=gp(),{CHAR_ASTERISK:PP,CHAR_AT:jAe,CHAR_BACKWARD_SLASH:yp,CHAR_COMMA:MAe,CHAR_DOT:CP,CHAR_EXCLAMATION_MARK:DP,CHAR_FORWARD_SLASH:WJ,CHAR_LEFT_CURLY_BRACE:NP,CHAR_LEFT_PARENTHESES:jP,CHAR_LEFT_SQUARE_BRACKET:FAe,CHAR_PLUS:LAe,CHAR_QUESTION_MARK:HJ,CHAR_RIGHT_CURLY_BRACE:zAe,CHAR_RIGHT_PARENTHESES:GJ,CHAR_RIGHT_SQUARE_BRACKET:UAe}=hp(),ZJ=t=>t===WJ||t===yp,VJ=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},qAe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,b=!1,_=!1,S=!1,x=!1,w=!1,O=0,T,A,D={value:"",depth:0,isGlob:!1},$=()=>l>=n,ie=()=>c.charCodeAt(l+1),K=()=>(T=A,c.charCodeAt(++l));for(;l0&&(C=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),P=c.slice(d)):m===!0?(xe="",P=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&ZJ(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(P&&(P=BJ.removeBackslashes(P)),xe&&_===!0&&(xe=BJ.removeBackslashes(xe)));let Ir={prefix:C,input:t,start:u,base:xe,glob:P,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&(Ir.maxDepth=0,ZJ(A)||s.push(D),Ir.tokens=s),r.parts===!0||r.tokens===!0){let se;for(let Ce=0;Ce{"use strict";var _p=hp(),sn=gp(),{MAX_LENGTH:jv,POSIX_REGEX_SOURCE:BAe,REGEX_NON_SPECIAL_CHARS:HAe,REGEX_SPECIAL_CHARS_BACKREF:GAe,REPLACEMENTS:YJ}=_p,ZAe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>sn.escapeRegex(i)).join("..")}return r},zl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,XJ=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},VAe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},QJ=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(VAe(e))return e.replace(/\\(.)/g,"$1")},WAe=t=>{let e=t.map(QJ).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},KAe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=QJ(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?sn.escapeRegex(r[0]):`[${r.map(i=>sn.escapeRegex(i)).join("")}]`}*`},JAe=t=>{let e=0,r=t.trim(),n=MP(r);for(;n;)e++,r=n.body.trim(),n=MP(r);return e},YAe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:_p.DEFAULT_MAX_EXTGLOB_RECURSION,n=XJ(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||WAe(n)))return{risky:!0};for(let i of n){let o=KAe(i);if(o)return{risky:!0,safeOutput:o};if(JAe(i)>r)return{risky:!0}}return{risky:!1}},FP=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=YJ[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(jv,r.maxLength):jv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=_p.globChars(r.windows),l=_p.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:b,QMARK:_,QMARK_NO_DOT:S,STAR:x,START_ANCHOR:w}=c,O=B=>`(${a}(?:(?!${w}${B.dot?m:u}).)*?)`,T=r.dot?"":h,A=r.dot?_:S,D=r.bash===!0?O(r):x;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let $={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=sn.removePrefix(t,$),i=t.length;let ie=[],K=[],xe=[],C=o,P,Ir=()=>$.index===i-1,se=$.peek=(B=1)=>t[$.index+B],Ce=$.advance=()=>t[++$.index]||"",Kt=()=>t.slice($.index+1),dr=(B="",ht=0)=>{$.consumed+=B,$.index+=ht},Yt=B=>{$.output+=B.output!=null?B.output:B.value,dr(B.value)},co=()=>{let B=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)Ce(),$.start++,B++;return B%2===0?!1:($.negated=!0,$.start++,!0)},wi=B=>{$[B]++,xe.push(B)},Yr=B=>{$[B]--,xe.pop()},de=B=>{if(C.type==="globstar"){let ht=$.braces>0&&(B.type==="comma"||B.type==="brace"),q=B.extglob===!0||ie.length&&(B.type==="pipe"||B.type==="paren");B.type!=="slash"&&B.type!=="paren"&&!ht&&!q&&($.output=$.output.slice(0,-C.output.length),C.type="star",C.value="*",C.output=D,$.output+=C.output)}if(ie.length&&B.type!=="paren"&&(ie[ie.length-1].inner+=B.value),(B.value||B.output)&&Yt(B),C&&C.type==="text"&&B.type==="text"){C.output=(C.output||C.value)+B.value,C.value+=B.value;return}B.prev=C,s.push(B),C=B},lo=(B,ht)=>{let q={...l[ht],conditions:1,inner:""};q.prev=C,q.parens=$.parens,q.output=$.output,q.startIndex=$.index,q.tokensIndex=s.length;let Oe=(r.capture?"(":"")+q.open;wi("parens"),de({type:B,value:ht,output:$.output?"":p}),de({type:"paren",extglob:!0,value:Ce(),output:Oe}),ie.push(q)},Ode=B=>{let ht=t.slice(B.startIndex,$.index+1),q=t.slice(B.startIndex+2,$.index),Oe=YAe(q,r);if((B.type==="plus"||B.type==="star")&&Oe.risky){let lt=Oe.safeOutput?(B.output?"":p)+(r.capture?`(${Oe.safeOutput})`:Oe.safeOutput):void 0,xi=s[B.tokensIndex];xi.type="text",xi.value=ht,xi.output=lt||sn.escapeRegex(ht);for(let $i=B.tokensIndex+1;$i1&&B.inner.includes("/")&&(lt=O(r)),(lt!==D||Ir()||/^\)+$/.test(Kt()))&&(ut=B.close=`)$))${lt}`),B.inner.includes("*")&&(Lt=Kt())&&/^\.[^\\/.]+$/.test(Lt)){let xi=FP(Lt,{...e,fastpaths:!1}).output;ut=B.close=`)${xi})${lt})`}B.prev.type==="bos"&&($.negatedExtglob=!0)}de({type:"paren",extglob:!0,value:P,output:ut}),Yr("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let B=!1,ht=t.replace(GAe,(q,Oe,ut,Lt,lt,xi)=>Lt==="\\"?(B=!0,q):Lt==="?"?Oe?Oe+Lt+(lt?_.repeat(lt.length):""):xi===0?A+(lt?_.repeat(lt.length):""):_.repeat(ut.length):Lt==="."?u.repeat(ut.length):Lt==="*"?Oe?Oe+Lt+(lt?D:""):D:Oe?q:`\\${q}`);return B===!0&&(r.unescape===!0?ht=ht.replace(/\\/g,""):ht=ht.replace(/\\+/g,q=>q.length%2===0?"\\\\":q?"\\":"")),ht===t&&r.contains===!0?($.output=t,$):($.output=sn.wrapOutput(ht,$,e),$)}for(;!Ir();){if(P=Ce(),P==="\0")continue;if(P==="\\"){let q=se();if(q==="/"&&r.bash!==!0||q==="."||q===";")continue;if(!q){P+="\\",de({type:"text",value:P});continue}let Oe=/^\\+/.exec(Kt()),ut=0;if(Oe&&Oe[0].length>2&&(ut=Oe[0].length,$.index+=ut,ut%2!==0&&(P+="\\")),r.unescape===!0?P=Ce():P+=Ce(),$.brackets===0){de({type:"text",value:P});continue}}if($.brackets>0&&(P!=="]"||C.value==="["||C.value==="[^")){if(r.posix!==!1&&P===":"){let q=C.value.slice(1);if(q.includes("[")&&(C.posix=!0,q.includes(":"))){let Oe=C.value.lastIndexOf("["),ut=C.value.slice(0,Oe),Lt=C.value.slice(Oe+2),lt=BAe[Lt];if(lt){C.value=ut+lt,$.backtrack=!0,Ce(),!o.output&&s.indexOf(C)===1&&(o.output=p);continue}}}(P==="["&&se()!==":"||P==="-"&&se()==="]")&&(P=`\\${P}`),P==="]"&&(C.value==="["||C.value==="[^")&&(P=`\\${P}`),r.posix===!0&&P==="!"&&C.value==="["&&(P="^"),C.value+=P,Yt({value:P});continue}if($.quotes===1&&P!=='"'){P=sn.escapeRegex(P),C.value+=P,Yt({value:P});continue}if(P==='"'){$.quotes=$.quotes===1?0:1,r.keepQuotes===!0&&de({type:"text",value:P});continue}if(P==="("){wi("parens"),de({type:"paren",value:P});continue}if(P===")"){if($.parens===0&&r.strictBrackets===!0)throw new SyntaxError(zl("opening","("));let q=ie[ie.length-1];if(q&&$.parens===q.parens+1){Ode(ie.pop());continue}de({type:"paren",value:P,output:$.parens?")":"\\)"}),Yr("parens");continue}if(P==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(zl("closing","]"));P=`\\${P}`}else wi("brackets");de({type:"bracket",value:P});continue}if(P==="]"){if(r.nobracket===!0||C&&C.type==="bracket"&&C.value.length===1){de({type:"text",value:P,output:`\\${P}`});continue}if($.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(zl("opening","["));de({type:"text",value:P,output:`\\${P}`});continue}Yr("brackets");let q=C.value.slice(1);if(C.posix!==!0&&q[0]==="^"&&!q.includes("/")&&(P=`/${P}`),C.value+=P,Yt({value:P}),r.literalBrackets===!1||sn.hasRegexChars(q))continue;let Oe=sn.escapeRegex(C.value);if($.output=$.output.slice(0,-C.value.length),r.literalBrackets===!0){$.output+=Oe,C.value=Oe;continue}C.value=`(${a}${Oe}|${C.value})`,$.output+=C.value;continue}if(P==="{"&&r.nobrace!==!0){wi("braces");let q={type:"brace",value:P,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};K.push(q),de(q);continue}if(P==="}"){let q=K[K.length-1];if(r.nobrace===!0||!q){de({type:"text",value:P,output:P});continue}let Oe=")";if(q.dots===!0){let ut=s.slice(),Lt=[];for(let lt=ut.length-1;lt>=0&&(s.pop(),ut[lt].type!=="brace");lt--)ut[lt].type!=="dots"&&Lt.unshift(ut[lt].value);Oe=ZAe(Lt,r),$.backtrack=!0}if(q.comma!==!0&&q.dots!==!0){let ut=$.output.slice(0,q.outputIndex),Lt=$.tokens.slice(q.tokensIndex);q.value=q.output="\\{",P=Oe="\\}",$.output=ut;for(let lt of Lt)$.output+=lt.output||lt.value}de({type:"brace",value:P,output:Oe}),Yr("braces"),K.pop();continue}if(P==="|"){ie.length>0&&ie[ie.length-1].conditions++,de({type:"text",value:P});continue}if(P===","){let q=P,Oe=K[K.length-1];Oe&&xe[xe.length-1]==="braces"&&(Oe.comma=!0,q="|"),de({type:"comma",value:P,output:q});continue}if(P==="/"){if(C.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",s.pop(),C=o;continue}de({type:"slash",value:P,output:f});continue}if(P==="."){if($.braces>0&&C.type==="dot"){C.value==="."&&(C.output=u);let q=K[K.length-1];C.type="dots",C.output+=P,C.value+=P,q.dots=!0;continue}if($.braces+$.parens===0&&C.type!=="bos"&&C.type!=="slash"){de({type:"text",value:P,output:u});continue}de({type:"dot",value:P,output:u});continue}if(P==="?"){if(!(C&&C.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){lo("qmark",P);continue}if(C&&C.type==="paren"){let Oe=se(),ut=P;(C.value==="("&&!/[!=<:]/.test(Oe)||Oe==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(ut=`\\${P}`),de({type:"text",value:P,output:ut});continue}if(r.dot!==!0&&(C.type==="slash"||C.type==="bos")){de({type:"qmark",value:P,output:S});continue}de({type:"qmark",value:P,output:_});continue}if(P==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){lo("negate",P);continue}if(r.nonegate!==!0&&$.index===0){co();continue}}if(P==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){lo("plus",P);continue}if(C&&C.value==="("||r.regex===!1){de({type:"plus",value:P,output:d});continue}if(C&&(C.type==="bracket"||C.type==="paren"||C.type==="brace")||$.parens>0){de({type:"plus",value:P});continue}de({type:"plus",value:d});continue}if(P==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){de({type:"at",extglob:!0,value:P,output:""});continue}de({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let q=HAe.exec(Kt());q&&(P+=q[0],$.index+=q[0].length),de({type:"text",value:P});continue}if(C&&(C.type==="globstar"||C.star===!0)){C.type="star",C.star=!0,C.value+=P,C.output=D,$.backtrack=!0,$.globstar=!0,dr(P);continue}let B=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(B)){lo("star",P);continue}if(C.type==="star"){if(r.noglobstar===!0){dr(P);continue}let q=C.prev,Oe=q.prev,ut=q.type==="slash"||q.type==="bos",Lt=Oe&&(Oe.type==="star"||Oe.type==="globstar");if(r.bash===!0&&(!ut||B[0]&&B[0]!=="/")){de({type:"star",value:P,output:""});continue}let lt=$.braces>0&&(q.type==="comma"||q.type==="brace"),xi=ie.length&&(q.type==="pipe"||q.type==="paren");if(!ut&&q.type!=="paren"&&!lt&&!xi){de({type:"star",value:P,output:""});continue}for(;B.slice(0,3)==="/**";){let $i=t[$.index+4];if($i&&$i!=="/")break;B=B.slice(3),dr("/**",3)}if(q.type==="bos"&&Ir()){C.type="globstar",C.value+=P,C.output=O(r),$.output=C.output,$.globstar=!0,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&!Lt&&Ir()){$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=O(r)+(r.strictSlashes?")":"|$)"),C.value+=P,$.globstar=!0,$.output+=q.output+C.output,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&B[0]==="/"){let $i=B[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=`${O(r)}${f}|${f}${$i})`,C.value+=P,$.output+=q.output+C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}if(q.type==="bos"&&B[0]==="/"){C.type="globstar",C.value+=P,C.output=`(?:^|${f}|${O(r)}${f})`,$.output=C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-C.output.length),C.type="globstar",C.output=O(r),C.value+=P,$.output+=C.output,$.globstar=!0,dr(P);continue}let ht={type:"star",value:P,output:D};if(r.bash===!0){ht.output=".*?",(C.type==="bos"||C.type==="slash")&&(ht.output=T+ht.output),de(ht);continue}if(C&&(C.type==="bracket"||C.type==="paren")&&r.regex===!0){ht.output=P,de(ht);continue}($.index===$.start||C.type==="slash"||C.type==="dot")&&(C.type==="dot"?($.output+=g,C.output+=g):r.dot===!0?($.output+=b,C.output+=b):($.output+=T,C.output+=T),se()!=="*"&&($.output+=p,C.output+=p)),de(ht)}for(;$.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(zl("closing","]"));$.output=sn.escapeLast($.output,"["),Yr("brackets")}for(;$.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(zl("closing",")"));$.output=sn.escapeLast($.output,"("),Yr("parens")}for(;$.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(zl("closing","}"));$.output=sn.escapeLast($.output,"{"),Yr("braces")}if(r.strictSlashes!==!0&&(C.type==="star"||C.type==="bracket")&&de({type:"maybe_slash",value:"",output:`${f}?`}),$.backtrack===!0){$.output="";for(let B of $.tokens)$.output+=B.output!=null?B.output:B.value,B.suffix&&($.output+=B.suffix)}return $};FP.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(jv,r.maxLength):jv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=YJ[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=_p.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=T=>T.noglobstar===!0?_:`(${g}(?:(?!${p}${T.dot?c:o}).)*?)`,x=T=>{switch(T){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${S(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${S(r)}${s})?${o}${a}${_}`;default:{let A=/^(.*?)\.(\w+)$/.exec(T);if(!A)return;let D=x(A[1]);return D?D+o+A[2]:void 0}}},w=sn.removePrefix(t,b),O=x(w);return O&&r.strictSlashes!==!0&&(O+=`${s}?`),O};e8.exports=FP});var i8=v((zut,n8)=>{"use strict";var XAe=JJ(),LP=t8(),r8=gp(),QAe=hp(),eTe=t=>t&&typeof t=="object"&&!Array.isArray(t),Rt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Rt(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=eTe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?Rt.compileRe(t,e):Rt.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Rt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Rt.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};Rt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?r8.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Rt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Rt.matchBase=(t,e,r)=>(e instanceof RegExp?e:Rt.makeRe(e,r)).test(r8.basename(t));Rt.isMatch=(t,e,r)=>Rt(e,r)(t);Rt.parse=(t,e)=>Array.isArray(t)?t.map(r=>Rt.parse(r,e)):LP(t,{...e,fastpaths:!1});Rt.scan=(t,e)=>XAe(t,e);Rt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Rt.toRegex(a,e);return n===!0&&(c.state=t),c};Rt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=LP.fastpaths(t,e)),i.output||(i=LP(t,e)),Rt.compileRe(i,e,r,n)};Rt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Rt.constants=QAe;n8.exports=Rt});var c8=v((Uut,a8)=>{"use strict";var o8=i8(),tTe=gp();function s8(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:tTe.isWindows()}),o8(t,e,r)}Object.assign(s8,o8);a8.exports=s8});import{readdir as rTe,readdirSync as nTe,realpath as iTe,realpathSync as oTe,stat as sTe,statSync as aTe}from"fs";import{isAbsolute as cTe,posix as Ha,resolve as lTe}from"path";import{fileURLToPath as uTe}from"url";function pTe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&fTe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>Ha.relative(t,n)||".":n=>Ha.relative(t,`${e}/${n}`)||"."}function gTe(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=Ha.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function f8(t){var e;let r=Ul.default.scan(t,yTe);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function xTe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Ul.default.scan(t);return r.isGlob||r.negated}function bp(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function p8(t){return typeof t=="string"?[t]:t??[]}function zP(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=wTe(o);s=cTe(s.replace(kTe,""))?Ha.relative(a,s):Ha.normalize(s);let c=(i=$Te.exec(s))===null||i===void 0?void 0:i[0],l=f8(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?Ha.join(o,...d):o}return s}function ETe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(zP(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(zP(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(zP(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function ATe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=ETe(t,e,n);t.debug&&bp("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(u8,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Ul.default)(i.match,f),m=(0,Ul.default)(i.ignore,f),h=pTe(i.match,f),g=l8(r,d,o),b=o?g:l8(r,d,!0),_=(w,O)=>{let T=b(O,!0);return T!=="."&&!h(T)||m(T)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let x=new jJ({filters:[a?(w,O)=>{let T=g(w,O),A=p(T)&&!m(T);return A&&bp(`matched ${T}`),A}:(w,O)=>{let T=g(w,O);return p(T)&&!m(T)}],exclude:a?(w,O)=>{let T=_(w,O);return bp(`${T?"skipped":"crawling"} ${O}`),T}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:S,signal:t.signal}).crawl(d);return t.debug&&bp("internal properties:",{...n,root:d}),[x,r!==d&&!o&&gTe(r,d)]}function TTe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function RTe(t){let e={...OTe,...t};return e.cwd=(e.cwd instanceof URL?uTe(e.cwd):lTe(e.cwd)).replace(u8,"/"),e.ignore=p8(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||rTe,readdirSync:e.fs.readdirSync||nTe,realpath:e.fs.realpath||iTe,realpathSync:e.fs.realpathSync||oTe,stat:e.fs.stat||sTe,statSync:e.fs.statSync||aTe}),e.debug&&bp("globbing with options:",e),e}function ITe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=dTe(t)||typeof t=="string",i=p8((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=RTe(n?e:t);return i.length>0?ATe(o,i):[]}function ys(t,e){let[r,n]=ITe(t,e);return r?TTe(r.sync(),n):[]}var Ul,dTe,u8,d8,fTe,mTe,hTe,yTe,_Te,bTe,vTe,STe,wTe,$Te,kTe,OTe,vp=y(()=>{MJ();Ul=St(c8(),1),dTe=Array.isArray,u8=/\\/g,d8=process.platform==="win32",fTe=/^(\/?\.\.)+$/;mTe=/^[A-Z]:\/$/i,hTe=d8?t=>mTe.test(t):t=>t==="/";yTe={parts:!0};_Te=/(?t.replace(_Te,"\\$&"),STe=t=>t.replace(bTe,"\\$&"),wTe=d8?STe:vTe;$Te=/^(\/?\.\.)+/,kTe=/\\(?=[()[\]{}!*+?@|])/g;OTe={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as Sp,readFileSync as PTe,readdirSync as CTe,statSync as m8}from"node:fs";import{join as Ga}from"node:path";function DTe(t){let{cwd:e="."}=t,r,n;try{let c=H(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=ji(e,n),o=[],{layers:s,forbiddenImports:a}=UP(r);return(s.size>0||a.length>0)&&!Sp(Ga(e,i.mainRoot))?[{detector:wp,severity:"info",path:`${i.mainRoot}/`,message:`architecture layers declared but ${i.mainRoot}/ not found \u2014 layer checks skipped (flat layout not yet supported)`}]:(s.size>0&&(NTe(e,i,s,o),jTe(e,i,s,o)),a.length>0&&MTe(e,i,a,o),o)}function UP(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function NTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of CTe(o)){let a=Ga(o,s);m8(a).isDirectory()&&(r.has(s)||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function jTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of r){let a=Ga(o,s);Sp(a)&&m8(a).isDirectory()||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function MTe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Ga(t,i,s.from);if(!Sp(a))continue;let c=ys([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Ga(a,l),d;try{d=PTe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];FTe(p,s.to,e.importStyle)&&n.push({detector:wp,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function FTe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var wp,h8,qP=y(()=>{"use strict";vp();Be();Ba();wp="ARCHITECTURE_FROM_SPEC";h8={name:wp,run:DTe}});import{existsSync as LTe,readFileSync as zTe}from"node:fs";import{join as UTe}from"node:path";function BTe(t){let{cwd:e="."}=t,r=UTe(e,"spec/capabilities.yaml");if(!LTe(r))return[];let n;try{let u=zTe(r,"utf8"),d=g8.default.parse(u);if(!d||typeof d!="object")return[];n=d}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o,s=!1;try{let u=H(e);o=new Set(u.features.map(d=>d.id)),s=u.project.onboarding_seeded===!0}catch{return[]}let a=[],c=new Set,l=s&&o.size{"use strict";g8=St(Qt(),1);Be();Mv="CAPABILITIES_FEATURE_MAPPING",qTe=8;y8={name:Mv,run:BTe}});import{existsSync as HTe,readFileSync as GTe}from"node:fs";import{join as ZTe}from"node:path";function VTe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")}function WTe(t){let{cwd:e="."}=t;return ge(e,BP,r=>KTe(r,e))}function KTe(t,e){let r=ji(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=ZTe(e,o);if(!HTe(s))continue;let a=GTe(s,"utf8");VTe(a)||n.push({detector:BP,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var BP,b8,v8=y(()=>{"use strict";Ba();wt();BP="CONVENTION_DRIFT";b8={name:BP,run:WTe}});import{existsSync as HP,readFileSync as S8}from"node:fs";import{join as Fv}from"node:path";function JTe(t){return JSON.parse(t).total?.lines?.pct??0}function w8(t){let e=/]*\bline-rate="([0-9]*\.?[0-9]+)"/.exec(t);return e?Number(e[1])*100:null}function QTe(t,e){if(!wv(dt(t).gates.coverage?.cmd))return null;let r;try{r=xv(t,e)}catch(c){return[{detector:xo,severity:"error",message:c.message}]}let n=0,i=0,o=0,s=[];for(let c of r){let l=SP.find(d=>HP(Fv(c.dir,d)));if(!l){s.push(c.path);continue}let u=w8(S8(Fv(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:xo,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=x8(n,i);return a0?[{detector:xo,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function eOe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let a=QTe(e,t.focusModules);if(a)return a}let r;try{r=H(e).project?.language}catch{}let n=ji(e,r),i=dt(e).language==="kotlin"?SP.find(a=>HP(Fv(e,a)))??iJ(e):n.coverageSummary,o=Fv(e,i);if(!HP(o))return[{detector:xo,severity:"info",message:`${i} not present \u2014 run stage_2.2 first`}];let s;try{let a=S8(o,"utf8");s=n.coverageFormat==="jacoco-xml"?YTe(a):n.coverageFormat==="cobertura-xml"?XTe(a):JTe(a)}catch(a){return[{detector:xo,severity:"warn",message:`${i} unparseable: ${a.message}`}]}return s===null?n.coverageFormat==="cobertura-xml"?[]:[{detector:xo,severity:"warn",message:`${i} contained no line-coverage counter`}]:s>=Lv?[]:[{detector:xo,severity:"warn",message:`line coverage ${s.toFixed(1)}% < floor ${Lv}%`}]}var xo,Lv,$8,k8=y(()=>{"use strict";Be();Ev();Ba();$v();on();xo="COVERAGE_DROP",Lv=70;$8={name:xo,run:eOe}});import{existsSync as tOe}from"node:fs";import{join as rOe}from"node:path";function iOe(t){let{cwd:e="."}=t;return ge(e,zv,r=>oOe(r,e))}function oOe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);if(!r){if(n.length===0)return[];let i=t.project.onboarding_seeded===!0&&t.features.length{"use strict";wt();zv="DELIVERABLE_INTEGRITY",nOe=8;E8={name:zv,run:iOe}});function sOe(t){let e=new Set((t.features??[]).map(n=>n.id)),r=[];for(let n of t.project?.smoke??[]){let i=n.feature;if(i===void 0||e.has(i))continue;let o=(n.run??[]).join(" ")||`kind:${n.kind}`;r.push({detector:Uv,severity:"warn",path:"spec.yaml",message:`smoke probe '${o}' binds feature ${i}, which is not in the spec \u2014 a dangling binding is annotation drift (the bound feature was renamed, archived, or never existed). Fix the id or drop the binding.`})}return r}function aOe(t){let e=sOe(t),r=(t.features??[]).filter(o=>o.status==="done");return r.length===0||!!!t.project?.deliverable||(t.project?.smoke??[]).length>0?e:[...e,{detector:Uv,severity:"warn",path:"spec.yaml",message:`${r.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function cOe(t){let{cwd:e="."}=t;return ge(e,Uv,r=>aOe(r))}var Uv,T8,O8=y(()=>{"use strict";wt();Uv="SMOKE_PROBE_DEMAND";T8={name:Uv,run:cOe}});function lOe(t){let{cwd:e="."}=t;return ge(e,qv,r=>uOe(r,e))}function uOe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=as(e);if(n===null)return[{detector:qv,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=q_(n,e,o);s.state!=="fresh"&&i.push({detector:qv,severity:"warn",path:"spec/attestation.yaml",message:s.state==="unattested"?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:s.module?`${o.id}'s module ${s.module} changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var qv,Bv,GP=y(()=>{"use strict";gl();wt();qv="STALE_ATTESTATION";Bv={name:qv,run:lOe}});function dOe(t){let{cwd:e="."}=t,r;try{r=H(e)}catch{return[]}return fOe(r)}function fOe(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:R8,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var R8,Hv,ZP=y(()=>{"use strict";Be();R8="DEPENDENCY_CYCLE";Hv={name:R8,run:dOe}});import{appendFileSync as pOe,existsSync as I8,mkdirSync as mOe,readFileSync as hOe}from"node:fs";import{dirname as gOe,join as yOe}from"node:path";function P8(t){return yOe(t,_Oe,bOe)}function C8(t){return VP.add(t),()=>VP.delete(t)}function Za(t,e){let r=P8(t),n=gOe(r);I8(n)||mOe(n,{recursive:!0}),pOe(r,`${JSON.stringify(e)} +`);for(let u=0;u{"use strict";Be();Ba();vJ="AI_HINTS_FORBIDDEN_PATTERN";bEe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;SJ={name:vJ,run:SEe}});function wEe(t){let{cwd:e="."}=t,r;try{r=H(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:xJ,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var xJ,$J,kJ=y(()=>{"use strict";Be();xJ="AC_DUPLICATE_WITHIN_FEATURE";$J={name:xJ,run:wEe}});import{createRequire as xEe}from"module";import{basename as $Ee,dirname as OP,normalize as kEe,relative as EEe,resolve as AEe,sep as TJ}from"path";import*as TEe from"fs";function OEe(t){let e=kEe(t);return e.length>1&&e[e.length-1]===TJ&&(e=e.substring(0,e.length-1)),e}function OJ(t,e){return t.replace(REe,e)}function PEe(t){return t==="/"||IEe.test(t)}function TP(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=AEe(t)),(n||o)&&(t=OEe(t)),t===".")return"";let s=t[t.length-1]!==i;return OJ(s?t+i:t,i)}function RJ(t,e){return e+t}function CEe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:OJ(EEe(t,n),e.pathSeparator)+e.pathSeparator+r}}function DEe(t){return t}function NEe(t,e,r){return e+t+r}function jEe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?CEe(t,e):n?RJ:DEe}function MEe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function FEe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function qEe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?FEe(t):MEe(t):n&&n.length?zEe:LEe:UEe}function WEe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?VEe:r&&r.length?n?BEe:HEe:n?GEe:ZEe}function YEe(t){return t.group?JEe:KEe}function eAe(t){return t.group?XEe:QEe}function nAe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?rAe:tAe}function IJ(t,e,r){if(r.options.useRealPaths)return iAe(e,r);let n=OP(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=OP(n)}return r.symlinks.set(t,e),i>1}function iAe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function Nv(t,e,r,n){e(t&&!n?t:null,r)}function pAe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?oAe:lAe:n?e?sAe:fAe:i?e?cAe:dAe:e?aAe:uAe}function gAe(t){return t?hAe:mAe}function vAe(t,e){return new Promise((r,n)=>{DJ(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function DJ(t,e,r){new CJ(t,e,r).start()}function SAe(t,e){return new CJ(t,e).start()}var EJ,REe,IEe,LEe,zEe,UEe,BEe,HEe,GEe,ZEe,VEe,KEe,JEe,XEe,QEe,tAe,rAe,oAe,sAe,aAe,cAe,lAe,uAe,dAe,fAe,PJ,mAe,hAe,yAe,_Ae,bAe,CJ,AJ,NJ,jJ,MJ=y(()=>{EJ=xEe(import.meta.url);REe=/[\\/]/g;IEe=/^[a-z]:[\\/]$/i;LEe=(t,e)=>{e.push(t||".")},zEe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},UEe=()=>{};BEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},HEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},GEe=(t,e,r,n)=>{r.files++},ZEe=(t,e)=>{e.push(t)},VEe=()=>{};KEe=t=>t,JEe=()=>[""].slice(0,0);XEe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},QEe=()=>{};tAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&IJ(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},rAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&IJ(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};oAe=t=>t.counts,sAe=t=>t.groups,aAe=t=>t.paths,cAe=t=>t.paths.slice(0,t.options.maxFiles),lAe=(t,e,r)=>(Nv(e,r,t.counts,t.options.suppressErrors),null),uAe=(t,e,r)=>(Nv(e,r,t.paths,t.options.suppressErrors),null),dAe=(t,e,r)=>(Nv(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),fAe=(t,e,r)=>(Nv(e,r,t.groups,t.options.suppressErrors),null);PJ={withFileTypes:!0},mAe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",PJ,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},hAe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",PJ)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};yAe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},_Ae=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},bAe=class{aborted=!1;abort(){this.aborted=!0}},CJ=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=pAe(e,this.isSynchronous),this.root=TP(t,e),this.state={root:PEe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new _Ae,options:e,queue:new yAe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new bAe,fs:e.fs||TEe},this.joinPath=jEe(this.root,e),this.pushDirectory=qEe(this.root,e),this.pushFile=WEe(e),this.getArray=YEe(e),this.groupFiles=eAe(e),this.resolveSymlink=nAe(e,this.isSynchronous),this.walkDirectory=gAe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(b.isDirectory()){if(_=TP(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let S=$Ee(_),x=TP(OP(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};AJ=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return vAe(this.root,this.options)}withCallback(t){DJ(this.root,this.options,t)}sync(){return SAe(this.root,this.options)}},NJ=null;try{EJ.resolve("picomatch"),NJ=EJ("picomatch")}catch{}jJ=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:TJ,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new AJ(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new AJ(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||NJ;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var hp=v((jut,qJ)=>{"use strict";var FJ="[^\\\\/]",wAe="(?=.)",LJ="[^/]",RP="(?:\\/|$)",zJ="(?:^|\\/)",IP=`\\.{1,2}${RP}`,xAe="(?!\\.)",$Ae=`(?!${zJ}${IP})`,kAe=`(?!\\.{0,1}${RP})`,EAe=`(?!${IP})`,AAe="[^.\\/]",TAe=`${LJ}*?`,OAe="/",UJ={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:wAe,QMARK:LJ,END_ANCHOR:RP,DOTS_SLASH:IP,NO_DOT:xAe,NO_DOTS:$Ae,NO_DOT_SLASH:kAe,NO_DOTS_SLASH:EAe,QMARK_NO_DOT:AAe,STAR:TAe,START_ANCHOR:zJ,SEP:OAe},RAe={...UJ,SLASH_LITERAL:"[\\\\/]",QMARK:FJ,STAR:`${FJ}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},IAe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};qJ.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:IAe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?RAe:UJ}}});var gp=v(Fr=>{"use strict";var{REGEX_BACKSLASH:PAe,REGEX_REMOVE_BACKSLASH:CAe,REGEX_SPECIAL_CHARS:DAe,REGEX_SPECIAL_CHARS_GLOBAL:NAe}=hp();Fr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Fr.hasRegexChars=t=>DAe.test(t);Fr.isRegexChar=t=>t.length===1&&Fr.hasRegexChars(t);Fr.escapeRegex=t=>t.replace(NAe,"\\$1");Fr.toPosixSlashes=t=>t.replace(PAe,"/");Fr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Fr.removeBackslashes=t=>t.replace(CAe,e=>e==="\\"?"":e);Fr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Fr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Fr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Fr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Fr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var JJ=v((Fut,KJ)=>{"use strict";var BJ=gp(),{CHAR_ASTERISK:PP,CHAR_AT:jAe,CHAR_BACKWARD_SLASH:yp,CHAR_COMMA:MAe,CHAR_DOT:CP,CHAR_EXCLAMATION_MARK:DP,CHAR_FORWARD_SLASH:WJ,CHAR_LEFT_CURLY_BRACE:NP,CHAR_LEFT_PARENTHESES:jP,CHAR_LEFT_SQUARE_BRACKET:FAe,CHAR_PLUS:LAe,CHAR_QUESTION_MARK:HJ,CHAR_RIGHT_CURLY_BRACE:zAe,CHAR_RIGHT_PARENTHESES:GJ,CHAR_RIGHT_SQUARE_BRACKET:UAe}=hp(),ZJ=t=>t===WJ||t===yp,VJ=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},qAe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,b=!1,_=!1,S=!1,x=!1,w=!1,O=0,T,A,D={value:"",depth:0,isGlob:!1},$=()=>l>=n,re=()=>c.charCodeAt(l+1),K=()=>(T=A,c.charCodeAt(++l));for(;l0&&(C=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),P=c.slice(d)):m===!0?(xe="",P=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&ZJ(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(P&&(P=BJ.removeBackslashes(P)),xe&&_===!0&&(xe=BJ.removeBackslashes(xe)));let Ir={prefix:C,input:t,start:u,base:xe,glob:P,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&(Ir.maxDepth=0,ZJ(A)||s.push(D),Ir.tokens=s),r.parts===!0||r.tokens===!0){let se;for(let Ce=0;Ce{"use strict";var _p=hp(),sn=gp(),{MAX_LENGTH:jv,POSIX_REGEX_SOURCE:BAe,REGEX_NON_SPECIAL_CHARS:HAe,REGEX_SPECIAL_CHARS_BACKREF:GAe,REPLACEMENTS:YJ}=_p,ZAe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>sn.escapeRegex(i)).join("..")}return r},zl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,XJ=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},VAe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},QJ=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(VAe(e))return e.replace(/\\(.)/g,"$1")},WAe=t=>{let e=t.map(QJ).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},KAe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=QJ(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?sn.escapeRegex(r[0]):`[${r.map(i=>sn.escapeRegex(i)).join("")}]`}*`},JAe=t=>{let e=0,r=t.trim(),n=MP(r);for(;n;)e++,r=n.body.trim(),n=MP(r);return e},YAe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:_p.DEFAULT_MAX_EXTGLOB_RECURSION,n=XJ(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||WAe(n)))return{risky:!0};for(let i of n){let o=KAe(i);if(o)return{risky:!0,safeOutput:o};if(JAe(i)>r)return{risky:!0}}return{risky:!1}},FP=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=YJ[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(jv,r.maxLength):jv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=_p.globChars(r.windows),l=_p.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:b,QMARK:_,QMARK_NO_DOT:S,STAR:x,START_ANCHOR:w}=c,O=B=>`(${a}(?:(?!${w}${B.dot?m:u}).)*?)`,T=r.dot?"":h,A=r.dot?_:S,D=r.bash===!0?O(r):x;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let $={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=sn.removePrefix(t,$),i=t.length;let re=[],K=[],xe=[],C=o,P,Ir=()=>$.index===i-1,se=$.peek=(B=1)=>t[$.index+B],Ce=$.advance=()=>t[++$.index]||"",Kt=()=>t.slice($.index+1),dr=(B="",ht=0)=>{$.consumed+=B,$.index+=ht},Yt=B=>{$.output+=B.output!=null?B.output:B.value,dr(B.value)},co=()=>{let B=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)Ce(),$.start++,B++;return B%2===0?!1:($.negated=!0,$.start++,!0)},wi=B=>{$[B]++,xe.push(B)},Yr=B=>{$[B]--,xe.pop()},de=B=>{if(C.type==="globstar"){let ht=$.braces>0&&(B.type==="comma"||B.type==="brace"),q=B.extglob===!0||re.length&&(B.type==="pipe"||B.type==="paren");B.type!=="slash"&&B.type!=="paren"&&!ht&&!q&&($.output=$.output.slice(0,-C.output.length),C.type="star",C.value="*",C.output=D,$.output+=C.output)}if(re.length&&B.type!=="paren"&&(re[re.length-1].inner+=B.value),(B.value||B.output)&&Yt(B),C&&C.type==="text"&&B.type==="text"){C.output=(C.output||C.value)+B.value,C.value+=B.value;return}B.prev=C,s.push(B),C=B},lo=(B,ht)=>{let q={...l[ht],conditions:1,inner:""};q.prev=C,q.parens=$.parens,q.output=$.output,q.startIndex=$.index,q.tokensIndex=s.length;let Oe=(r.capture?"(":"")+q.open;wi("parens"),de({type:B,value:ht,output:$.output?"":p}),de({type:"paren",extglob:!0,value:Ce(),output:Oe}),re.push(q)},Ode=B=>{let ht=t.slice(B.startIndex,$.index+1),q=t.slice(B.startIndex+2,$.index),Oe=YAe(q,r);if((B.type==="plus"||B.type==="star")&&Oe.risky){let lt=Oe.safeOutput?(B.output?"":p)+(r.capture?`(${Oe.safeOutput})`:Oe.safeOutput):void 0,xi=s[B.tokensIndex];xi.type="text",xi.value=ht,xi.output=lt||sn.escapeRegex(ht);for(let $i=B.tokensIndex+1;$i1&&B.inner.includes("/")&&(lt=O(r)),(lt!==D||Ir()||/^\)+$/.test(Kt()))&&(ut=B.close=`)$))${lt}`),B.inner.includes("*")&&(Lt=Kt())&&/^\.[^\\/.]+$/.test(Lt)){let xi=FP(Lt,{...e,fastpaths:!1}).output;ut=B.close=`)${xi})${lt})`}B.prev.type==="bos"&&($.negatedExtglob=!0)}de({type:"paren",extglob:!0,value:P,output:ut}),Yr("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let B=!1,ht=t.replace(GAe,(q,Oe,ut,Lt,lt,xi)=>Lt==="\\"?(B=!0,q):Lt==="?"?Oe?Oe+Lt+(lt?_.repeat(lt.length):""):xi===0?A+(lt?_.repeat(lt.length):""):_.repeat(ut.length):Lt==="."?u.repeat(ut.length):Lt==="*"?Oe?Oe+Lt+(lt?D:""):D:Oe?q:`\\${q}`);return B===!0&&(r.unescape===!0?ht=ht.replace(/\\/g,""):ht=ht.replace(/\\+/g,q=>q.length%2===0?"\\\\":q?"\\":"")),ht===t&&r.contains===!0?($.output=t,$):($.output=sn.wrapOutput(ht,$,e),$)}for(;!Ir();){if(P=Ce(),P==="\0")continue;if(P==="\\"){let q=se();if(q==="/"&&r.bash!==!0||q==="."||q===";")continue;if(!q){P+="\\",de({type:"text",value:P});continue}let Oe=/^\\+/.exec(Kt()),ut=0;if(Oe&&Oe[0].length>2&&(ut=Oe[0].length,$.index+=ut,ut%2!==0&&(P+="\\")),r.unescape===!0?P=Ce():P+=Ce(),$.brackets===0){de({type:"text",value:P});continue}}if($.brackets>0&&(P!=="]"||C.value==="["||C.value==="[^")){if(r.posix!==!1&&P===":"){let q=C.value.slice(1);if(q.includes("[")&&(C.posix=!0,q.includes(":"))){let Oe=C.value.lastIndexOf("["),ut=C.value.slice(0,Oe),Lt=C.value.slice(Oe+2),lt=BAe[Lt];if(lt){C.value=ut+lt,$.backtrack=!0,Ce(),!o.output&&s.indexOf(C)===1&&(o.output=p);continue}}}(P==="["&&se()!==":"||P==="-"&&se()==="]")&&(P=`\\${P}`),P==="]"&&(C.value==="["||C.value==="[^")&&(P=`\\${P}`),r.posix===!0&&P==="!"&&C.value==="["&&(P="^"),C.value+=P,Yt({value:P});continue}if($.quotes===1&&P!=='"'){P=sn.escapeRegex(P),C.value+=P,Yt({value:P});continue}if(P==='"'){$.quotes=$.quotes===1?0:1,r.keepQuotes===!0&&de({type:"text",value:P});continue}if(P==="("){wi("parens"),de({type:"paren",value:P});continue}if(P===")"){if($.parens===0&&r.strictBrackets===!0)throw new SyntaxError(zl("opening","("));let q=re[re.length-1];if(q&&$.parens===q.parens+1){Ode(re.pop());continue}de({type:"paren",value:P,output:$.parens?")":"\\)"}),Yr("parens");continue}if(P==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(zl("closing","]"));P=`\\${P}`}else wi("brackets");de({type:"bracket",value:P});continue}if(P==="]"){if(r.nobracket===!0||C&&C.type==="bracket"&&C.value.length===1){de({type:"text",value:P,output:`\\${P}`});continue}if($.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(zl("opening","["));de({type:"text",value:P,output:`\\${P}`});continue}Yr("brackets");let q=C.value.slice(1);if(C.posix!==!0&&q[0]==="^"&&!q.includes("/")&&(P=`/${P}`),C.value+=P,Yt({value:P}),r.literalBrackets===!1||sn.hasRegexChars(q))continue;let Oe=sn.escapeRegex(C.value);if($.output=$.output.slice(0,-C.value.length),r.literalBrackets===!0){$.output+=Oe,C.value=Oe;continue}C.value=`(${a}${Oe}|${C.value})`,$.output+=C.value;continue}if(P==="{"&&r.nobrace!==!0){wi("braces");let q={type:"brace",value:P,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};K.push(q),de(q);continue}if(P==="}"){let q=K[K.length-1];if(r.nobrace===!0||!q){de({type:"text",value:P,output:P});continue}let Oe=")";if(q.dots===!0){let ut=s.slice(),Lt=[];for(let lt=ut.length-1;lt>=0&&(s.pop(),ut[lt].type!=="brace");lt--)ut[lt].type!=="dots"&&Lt.unshift(ut[lt].value);Oe=ZAe(Lt,r),$.backtrack=!0}if(q.comma!==!0&&q.dots!==!0){let ut=$.output.slice(0,q.outputIndex),Lt=$.tokens.slice(q.tokensIndex);q.value=q.output="\\{",P=Oe="\\}",$.output=ut;for(let lt of Lt)$.output+=lt.output||lt.value}de({type:"brace",value:P,output:Oe}),Yr("braces"),K.pop();continue}if(P==="|"){re.length>0&&re[re.length-1].conditions++,de({type:"text",value:P});continue}if(P===","){let q=P,Oe=K[K.length-1];Oe&&xe[xe.length-1]==="braces"&&(Oe.comma=!0,q="|"),de({type:"comma",value:P,output:q});continue}if(P==="/"){if(C.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",s.pop(),C=o;continue}de({type:"slash",value:P,output:f});continue}if(P==="."){if($.braces>0&&C.type==="dot"){C.value==="."&&(C.output=u);let q=K[K.length-1];C.type="dots",C.output+=P,C.value+=P,q.dots=!0;continue}if($.braces+$.parens===0&&C.type!=="bos"&&C.type!=="slash"){de({type:"text",value:P,output:u});continue}de({type:"dot",value:P,output:u});continue}if(P==="?"){if(!(C&&C.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){lo("qmark",P);continue}if(C&&C.type==="paren"){let Oe=se(),ut=P;(C.value==="("&&!/[!=<:]/.test(Oe)||Oe==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(ut=`\\${P}`),de({type:"text",value:P,output:ut});continue}if(r.dot!==!0&&(C.type==="slash"||C.type==="bos")){de({type:"qmark",value:P,output:S});continue}de({type:"qmark",value:P,output:_});continue}if(P==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){lo("negate",P);continue}if(r.nonegate!==!0&&$.index===0){co();continue}}if(P==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){lo("plus",P);continue}if(C&&C.value==="("||r.regex===!1){de({type:"plus",value:P,output:d});continue}if(C&&(C.type==="bracket"||C.type==="paren"||C.type==="brace")||$.parens>0){de({type:"plus",value:P});continue}de({type:"plus",value:d});continue}if(P==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){de({type:"at",extglob:!0,value:P,output:""});continue}de({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let q=HAe.exec(Kt());q&&(P+=q[0],$.index+=q[0].length),de({type:"text",value:P});continue}if(C&&(C.type==="globstar"||C.star===!0)){C.type="star",C.star=!0,C.value+=P,C.output=D,$.backtrack=!0,$.globstar=!0,dr(P);continue}let B=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(B)){lo("star",P);continue}if(C.type==="star"){if(r.noglobstar===!0){dr(P);continue}let q=C.prev,Oe=q.prev,ut=q.type==="slash"||q.type==="bos",Lt=Oe&&(Oe.type==="star"||Oe.type==="globstar");if(r.bash===!0&&(!ut||B[0]&&B[0]!=="/")){de({type:"star",value:P,output:""});continue}let lt=$.braces>0&&(q.type==="comma"||q.type==="brace"),xi=re.length&&(q.type==="pipe"||q.type==="paren");if(!ut&&q.type!=="paren"&&!lt&&!xi){de({type:"star",value:P,output:""});continue}for(;B.slice(0,3)==="/**";){let $i=t[$.index+4];if($i&&$i!=="/")break;B=B.slice(3),dr("/**",3)}if(q.type==="bos"&&Ir()){C.type="globstar",C.value+=P,C.output=O(r),$.output=C.output,$.globstar=!0,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&!Lt&&Ir()){$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=O(r)+(r.strictSlashes?")":"|$)"),C.value+=P,$.globstar=!0,$.output+=q.output+C.output,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&B[0]==="/"){let $i=B[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=`${O(r)}${f}|${f}${$i})`,C.value+=P,$.output+=q.output+C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}if(q.type==="bos"&&B[0]==="/"){C.type="globstar",C.value+=P,C.output=`(?:^|${f}|${O(r)}${f})`,$.output=C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-C.output.length),C.type="globstar",C.output=O(r),C.value+=P,$.output+=C.output,$.globstar=!0,dr(P);continue}let ht={type:"star",value:P,output:D};if(r.bash===!0){ht.output=".*?",(C.type==="bos"||C.type==="slash")&&(ht.output=T+ht.output),de(ht);continue}if(C&&(C.type==="bracket"||C.type==="paren")&&r.regex===!0){ht.output=P,de(ht);continue}($.index===$.start||C.type==="slash"||C.type==="dot")&&(C.type==="dot"?($.output+=g,C.output+=g):r.dot===!0?($.output+=b,C.output+=b):($.output+=T,C.output+=T),se()!=="*"&&($.output+=p,C.output+=p)),de(ht)}for(;$.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(zl("closing","]"));$.output=sn.escapeLast($.output,"["),Yr("brackets")}for(;$.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(zl("closing",")"));$.output=sn.escapeLast($.output,"("),Yr("parens")}for(;$.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(zl("closing","}"));$.output=sn.escapeLast($.output,"{"),Yr("braces")}if(r.strictSlashes!==!0&&(C.type==="star"||C.type==="bracket")&&de({type:"maybe_slash",value:"",output:`${f}?`}),$.backtrack===!0){$.output="";for(let B of $.tokens)$.output+=B.output!=null?B.output:B.value,B.suffix&&($.output+=B.suffix)}return $};FP.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(jv,r.maxLength):jv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=YJ[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=_p.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=T=>T.noglobstar===!0?_:`(${g}(?:(?!${p}${T.dot?c:o}).)*?)`,x=T=>{switch(T){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${S(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${S(r)}${s})?${o}${a}${_}`;default:{let A=/^(.*?)\.(\w+)$/.exec(T);if(!A)return;let D=x(A[1]);return D?D+o+A[2]:void 0}}},w=sn.removePrefix(t,b),O=x(w);return O&&r.strictSlashes!==!0&&(O+=`${s}?`),O};e8.exports=FP});var i8=v((zut,n8)=>{"use strict";var XAe=JJ(),LP=t8(),r8=gp(),QAe=hp(),eTe=t=>t&&typeof t=="object"&&!Array.isArray(t),Rt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Rt(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=eTe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?Rt.compileRe(t,e):Rt.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Rt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Rt.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};Rt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?r8.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Rt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Rt.matchBase=(t,e,r)=>(e instanceof RegExp?e:Rt.makeRe(e,r)).test(r8.basename(t));Rt.isMatch=(t,e,r)=>Rt(e,r)(t);Rt.parse=(t,e)=>Array.isArray(t)?t.map(r=>Rt.parse(r,e)):LP(t,{...e,fastpaths:!1});Rt.scan=(t,e)=>XAe(t,e);Rt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Rt.toRegex(a,e);return n===!0&&(c.state=t),c};Rt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=LP.fastpaths(t,e)),i.output||(i=LP(t,e)),Rt.compileRe(i,e,r,n)};Rt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Rt.constants=QAe;n8.exports=Rt});var c8=v((Uut,a8)=>{"use strict";var o8=i8(),tTe=gp();function s8(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:tTe.isWindows()}),o8(t,e,r)}Object.assign(s8,o8);a8.exports=s8});import{readdir as rTe,readdirSync as nTe,realpath as iTe,realpathSync as oTe,stat as sTe,statSync as aTe}from"fs";import{isAbsolute as cTe,posix as Ha,resolve as lTe}from"path";import{fileURLToPath as uTe}from"url";function pTe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&fTe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>Ha.relative(t,n)||".":n=>Ha.relative(t,`${e}/${n}`)||"."}function gTe(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=Ha.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function f8(t){var e;let r=Ul.default.scan(t,yTe);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function xTe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Ul.default.scan(t);return r.isGlob||r.negated}function bp(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function p8(t){return typeof t=="string"?[t]:t??[]}function zP(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=wTe(o);s=cTe(s.replace(kTe,""))?Ha.relative(a,s):Ha.normalize(s);let c=(i=$Te.exec(s))===null||i===void 0?void 0:i[0],l=f8(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?Ha.join(o,...d):o}return s}function ETe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(zP(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(zP(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(zP(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function ATe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=ETe(t,e,n);t.debug&&bp("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(u8,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Ul.default)(i.match,f),m=(0,Ul.default)(i.ignore,f),h=pTe(i.match,f),g=l8(r,d,o),b=o?g:l8(r,d,!0),_=(w,O)=>{let T=b(O,!0);return T!=="."&&!h(T)||m(T)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let x=new jJ({filters:[a?(w,O)=>{let T=g(w,O),A=p(T)&&!m(T);return A&&bp(`matched ${T}`),A}:(w,O)=>{let T=g(w,O);return p(T)&&!m(T)}],exclude:a?(w,O)=>{let T=_(w,O);return bp(`${T?"skipped":"crawling"} ${O}`),T}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:S,signal:t.signal}).crawl(d);return t.debug&&bp("internal properties:",{...n,root:d}),[x,r!==d&&!o&&gTe(r,d)]}function TTe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function RTe(t){let e={...OTe,...t};return e.cwd=(e.cwd instanceof URL?uTe(e.cwd):lTe(e.cwd)).replace(u8,"/"),e.ignore=p8(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||rTe,readdirSync:e.fs.readdirSync||nTe,realpath:e.fs.realpath||iTe,realpathSync:e.fs.realpathSync||oTe,stat:e.fs.stat||sTe,statSync:e.fs.statSync||aTe}),e.debug&&bp("globbing with options:",e),e}function ITe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=dTe(t)||typeof t=="string",i=p8((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=RTe(n?e:t);return i.length>0?ATe(o,i):[]}function ys(t,e){let[r,n]=ITe(t,e);return r?TTe(r.sync(),n):[]}var Ul,dTe,u8,d8,fTe,mTe,hTe,yTe,_Te,bTe,vTe,STe,wTe,$Te,kTe,OTe,vp=y(()=>{MJ();Ul=St(c8(),1),dTe=Array.isArray,u8=/\\/g,d8=process.platform==="win32",fTe=/^(\/?\.\.)+$/;mTe=/^[A-Z]:\/$/i,hTe=d8?t=>mTe.test(t):t=>t==="/";yTe={parts:!0};_Te=/(?t.replace(_Te,"\\$&"),STe=t=>t.replace(bTe,"\\$&"),wTe=d8?STe:vTe;$Te=/^(\/?\.\.)+/,kTe=/\\(?=[()[\]{}!*+?@|])/g;OTe={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as Sp,readFileSync as PTe,readdirSync as CTe,statSync as m8}from"node:fs";import{join as Ga}from"node:path";function DTe(t){let{cwd:e="."}=t,r,n;try{let c=H(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=ji(e,n),o=[],{layers:s,forbiddenImports:a}=UP(r);return(s.size>0||a.length>0)&&!Sp(Ga(e,i.mainRoot))?[{detector:wp,severity:"info",path:`${i.mainRoot}/`,message:`architecture layers declared but ${i.mainRoot}/ not found \u2014 layer checks skipped (flat layout not yet supported)`}]:(s.size>0&&(NTe(e,i,s,o),jTe(e,i,s,o)),a.length>0&&MTe(e,i,a,o),o)}function UP(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function NTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of CTe(o)){let a=Ga(o,s);m8(a).isDirectory()&&(r.has(s)||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function jTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of r){let a=Ga(o,s);Sp(a)&&m8(a).isDirectory()||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function MTe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Ga(t,i,s.from);if(!Sp(a))continue;let c=ys([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Ga(a,l),d;try{d=PTe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];FTe(p,s.to,e.importStyle)&&n.push({detector:wp,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function FTe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var wp,h8,qP=y(()=>{"use strict";vp();Be();Ba();wp="ARCHITECTURE_FROM_SPEC";h8={name:wp,run:DTe}});import{existsSync as LTe,readFileSync as zTe}from"node:fs";import{join as UTe}from"node:path";function BTe(t){let{cwd:e="."}=t,r=UTe(e,"spec/capabilities.yaml");if(!LTe(r))return[];let n;try{let u=zTe(r,"utf8"),d=g8.default.parse(u);if(!d||typeof d!="object")return[];n=d}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o,s=!1;try{let u=H(e);o=new Set(u.features.map(d=>d.id)),s=u.project.onboarding_seeded===!0}catch{return[]}let a=[],c=new Set,l=s&&o.size{"use strict";g8=St(Qt(),1);Be();Mv="CAPABILITIES_FEATURE_MAPPING",qTe=8;y8={name:Mv,run:BTe}});import{existsSync as HTe,readFileSync as GTe}from"node:fs";import{join as ZTe}from"node:path";function VTe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")}function WTe(t){let{cwd:e="."}=t;return ge(e,BP,r=>KTe(r,e))}function KTe(t,e){let r=ji(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=ZTe(e,o);if(!HTe(s))continue;let a=GTe(s,"utf8");VTe(a)||n.push({detector:BP,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var BP,b8,v8=y(()=>{"use strict";Ba();wt();BP="CONVENTION_DRIFT";b8={name:BP,run:WTe}});import{existsSync as HP,readFileSync as S8}from"node:fs";import{join as Fv}from"node:path";function JTe(t){return JSON.parse(t).total?.lines?.pct??0}function w8(t){let e=/]*\bline-rate="([0-9]*\.?[0-9]+)"/.exec(t);return e?Number(e[1])*100:null}function QTe(t,e){if(!wv(dt(t).gates.coverage?.cmd))return null;let r;try{r=xv(t,e)}catch(c){return[{detector:xo,severity:"error",message:c.message}]}let n=0,i=0,o=0,s=[];for(let c of r){let l=SP.find(d=>HP(Fv(c.dir,d)));if(!l){s.push(c.path);continue}let u=w8(S8(Fv(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:xo,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=x8(n,i);return a0?[{detector:xo,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function eOe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let a=QTe(e,t.focusModules);if(a)return a}let r;try{r=H(e).project?.language}catch{}let n=ji(e,r),i=dt(e).language==="kotlin"?SP.find(a=>HP(Fv(e,a)))??iJ(e):n.coverageSummary,o=Fv(e,i);if(!HP(o))return[{detector:xo,severity:"info",message:`${i} not present \u2014 run stage_2.2 first`}];let s;try{let a=S8(o,"utf8");s=n.coverageFormat==="jacoco-xml"?YTe(a):n.coverageFormat==="cobertura-xml"?XTe(a):JTe(a)}catch(a){return[{detector:xo,severity:"warn",message:`${i} unparseable: ${a.message}`}]}return s===null?n.coverageFormat==="cobertura-xml"?[]:[{detector:xo,severity:"warn",message:`${i} contained no line-coverage counter`}]:s>=Lv?[]:[{detector:xo,severity:"warn",message:`line coverage ${s.toFixed(1)}% < floor ${Lv}%`}]}var xo,Lv,$8,k8=y(()=>{"use strict";Be();Ev();Ba();$v();on();xo="COVERAGE_DROP",Lv=70;$8={name:xo,run:eOe}});import{existsSync as tOe}from"node:fs";import{join as rOe}from"node:path";function iOe(t){let{cwd:e="."}=t;return ge(e,zv,r=>oOe(r,e))}function oOe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);if(!r){if(n.length===0)return[];let i=t.project.onboarding_seeded===!0&&t.features.length{"use strict";wt();zv="DELIVERABLE_INTEGRITY",nOe=8;E8={name:zv,run:iOe}});function sOe(t){let e=new Set((t.features??[]).map(n=>n.id)),r=[];for(let n of t.project?.smoke??[]){let i=n.feature;if(i===void 0||e.has(i))continue;let o=(n.run??[]).join(" ")||`kind:${n.kind}`;r.push({detector:Uv,severity:"warn",path:"spec.yaml",message:`smoke probe '${o}' binds feature ${i}, which is not in the spec \u2014 a dangling binding is annotation drift (the bound feature was renamed, archived, or never existed). Fix the id or drop the binding.`})}return r}function aOe(t){let e=sOe(t),r=(t.features??[]).filter(o=>o.status==="done");return r.length===0||!!!t.project?.deliverable||(t.project?.smoke??[]).length>0?e:[...e,{detector:Uv,severity:"warn",path:"spec.yaml",message:`${r.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function cOe(t){let{cwd:e="."}=t;return ge(e,Uv,r=>aOe(r))}var Uv,T8,O8=y(()=>{"use strict";wt();Uv="SMOKE_PROBE_DEMAND";T8={name:Uv,run:cOe}});function lOe(t){let{cwd:e="."}=t;return ge(e,qv,r=>uOe(r,e))}function uOe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=as(e);if(n===null)return[{detector:qv,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=q_(n,e,o);s.state!=="fresh"&&i.push({detector:qv,severity:"warn",path:"spec/attestation.yaml",message:s.state==="unattested"?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:s.module?`${o.id}'s module ${s.module} changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var qv,Bv,GP=y(()=>{"use strict";gl();wt();qv="STALE_ATTESTATION";Bv={name:qv,run:lOe}});function dOe(t){let{cwd:e="."}=t,r;try{r=H(e)}catch{return[]}return fOe(r)}function fOe(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:R8,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var R8,Hv,ZP=y(()=>{"use strict";Be();R8="DEPENDENCY_CYCLE";Hv={name:R8,run:dOe}});import{appendFileSync as pOe,existsSync as I8,mkdirSync as mOe,readFileSync as hOe}from"node:fs";import{dirname as gOe,join as yOe}from"node:path";function P8(t){return yOe(t,_Oe,bOe)}function C8(t){return VP.add(t),()=>VP.delete(t)}function Za(t,e){let r=P8(t),n=gOe(r);I8(n)||mOe(n,{recursive:!0}),pOe(r,`${JSON.stringify(e)} `,"utf8");for(let i of VP)try{i(t,e)}catch{}}function Rn(t){let e=P8(t);if(!I8(e))return[];let r=hOe(e,"utf8").trim();return r.length===0?[]:r.split(` `).filter(n=>n.length>0).map(n=>JSON.parse(n))}var _Oe,bOe,VP,ri=y(()=>{"use strict";_Oe=".cladding",bOe="audit.log.jsonl";VP=new Set});import{existsSync as vOe}from"node:fs";import{join as SOe}from"node:path";function wOe(t){let{cwd:e="."}=t,r=Rn(e);if(r.length===0)return[{detector:WP,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=[];for(let i of r)i.artifact&&(vOe(SOe(e,i.artifact))||n.push({detector:WP,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var WP,D8,N8=y(()=>{"use strict";ri();WP="EVIDENCE_MISMATCH";D8={name:WP,run:wOe}});import{existsSync as xOe,readFileSync as $Oe}from"node:fs";import{join as kOe}from"node:path";function EOe(t){let e=kOe(t,L8);if(!xOe(e))return null;try{let n=((0,F8.parse)($Oe(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*M8(t,e){for(let r of t??[])r.startsWith(j8)&&(yield{ref:r,name:r.slice(j8.length),field:e})}function AOe(t){let{cwd:e="."}=t,r=EOe(e);if(r===null)return[];let n;try{n=H(e)}catch(o){return[{detector:KP,severity:"info",message:`spec.yaml not loaded: ${o.message}`}]}let i=[];for(let o of n.features)for(let s of o.acceptance_criteria??[]){let a=[...M8(s.evidence_refs,"evidence_refs"),...M8(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:KP,severity:"warn",path:L8,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var F8,KP,j8,L8,z8,U8=y(()=>{"use strict";F8=St(Qt(),1);Be();KP="FIXTURE_REFERENCE_INVALID",j8="fixture:",L8="conformance/fixtures.yaml";z8={name:KP,run:AOe}});import{existsSync as ql,readFileSync as JP}from"node:fs";import{join as Va}from"node:path";function TOe(t){return ys(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec|spec-first-window)\.ts$/.test(r)).length}function xp(t){if(!ql(t))return null;try{return JSON.parse(JP(t,"utf8"))}catch{return null}}function OOe(t,e){let r=Va(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(JP(r,"utf8"))}catch(c){e.push({detector:$o,severity:"info",message:`plugin.json not loaded: ${c.message}`});return}let i=n.ironclad?.current?.detectors;if(!i)return;let o=i.match(/^(\d+)\/(\d+)$/);if(!o){e.push({detector:$o,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=TOe(t);s!==a&&e.push({detector:$o,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function ROe(t,e){for(let r of q8){let n=Va(t,r.path);if(!ql(n))continue;let i=xp(n);if(!i){e.push({detector:$o,severity:"warn",message:`${r.host}: ${r.path} could not be parsed as JSON`});continue}for(let o of r.required)(i[o]===void 0||i[o]===null||i[o]==="")&&e.push({detector:$o,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function IOe(t,e){let r=xp(Va(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of q8){let s=Va(t,o.path);if(!ql(s))continue;let a=xp(s);a?.version&&a.version!==n&&e.push({detector:$o,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=Va(t,".claude-plugin","marketplace.json");if(ql(i)){let o=xp(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:$o,severity:"error",message:`marketplace: .claude-plugin/marketplace.json plugin '${s.name??"?"}' version='${s.version}' but package.json version='${n}' \u2014 the catalog advertises a stale version; bump it in lockstep`})}}function POe(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function COe(t,e){let r=Va(t,"src","cli","clad.ts"),n=Va(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!ql(r)||!ql(n))return;let i=POe(JP(r,"utf8"));if(i.length===0)return;let s=xp(n)?.ironclad?.current?.["stages-implemented"];if(!Array.isArray(s))return;let a=new Set(i),c=new Set(s),l=i.filter(f=>!c.has(f)),u=s.filter(f=>!a.has(f));if(l.length===0&&u.length===0)return;let d=[l.length?`missing [${l.join(", ")}]`:"",u.length?`unexpected [${u.join(", ")}]`:""].filter(Boolean).join("; ");e.push({detector:$o,severity:"error",message:`plugins/claude-code/.claude-plugin/plugin.json stages-implemented disagrees with TIER_STAGES.all (src/cli/clad.ts): ${d} \u2014 run \`npm run build:plugin\` to re-derive`})}function DOe(t){let{cwd:e="."}=t,r=[];return OOe(e,r),COe(e,r),ROe(e,r),IOe(e,r),r}var $o,q8,B8,H8=y(()=>{"use strict";vp();$o="HARNESS_INTEGRITY",q8=[{host:"claude-code",path:"plugins/claude-code/.claude-plugin/plugin.json",required:["name","version"]},{host:"codex",path:"plugins/codex/.codex-plugin/plugin.json",required:["name","version","description"]},{host:"gemini-cli",path:"plugins/gemini-cli/gemini-extension.json",required:["name","version"]}];B8={name:$o,run:DOe}});import{existsSync as NOe,readFileSync as jOe}from"node:fs";import{join as MOe}from"node:path";function LOe(t){let{cwd:e="."}=t;return ge(e,Gv,r=>UOe(r,e))}function zOe(t){let e=MOe(t,"spec/capabilities.yaml");if(!NOe(e))return!1;try{let r=G8.default.parse(jOe(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function UOe(t,e){let r=t.features.length;if(r{"use strict";G8=St(Qt(),1);wt();Gv="HOLLOW_GOVERNANCE",FOe=8;Z8={name:Gv,run:LOe}});import{existsSync as W8,readFileSync as K8}from"node:fs";import{join as J8}from"node:path";function Y8(t,e){let r=t.match(e);if(!r)return null;try{let n=JSON.parse(r[1]),i={};for(let[o,s]of Object.entries(n))typeof s=="string"&&(i[o]=s);return i}catch{return null}}function HOe(t){switch(t){case"fail":case"wiring-fail":return 0;case"wiring-ok":case"wiring-only":return 1;case"verified":return 2;default:return null}}function GOe(t){switch(t){case"wiring-only":return 1;case"verified":return 2;default:return null}}function ZOe(t){let e=J8(t,"README.md"),r=J8(t,"docs","dogfood","matrix.md");if(!W8(e)||!W8(r))return[];let n=Y8(K8(e,"utf8"),qOe),i=Y8(K8(r,"utf8"),BOe);if(!n||!i)return[];let o=[];for(let[s,a]of Object.entries(n)){let c=GOe(a);if(c===null)continue;let l=i[s]??"not-run",u=HOe(l);u!==null&&c>u&&o.push({detector:X8,severity:"warn",path:"README.md",message:`README host-claims: '${s}' claims '${a}' but the newest matrix evidence is '${l}' \u2014 the claim exceeds the evidence. Re-run \`clad doctor --hosts\` (with consent) or lower the README claim for '${s}'.`})}return o}function VOe(t){let{cwd:e="."}=t;return ZOe(e)}var X8,qOe,BOe,Q8,e5=y(()=>{"use strict";X8="HOST_CLAIM_DRIFT",qOe=//,BOe=//;Q8={name:X8,run:VOe}});function WOe(t){let{cwd:e="."}=t,r;try{r=H(e)}catch{return[]}let n=[];return t5(r.features.map(i=>i.id),"feature","spec/features/",n),t5((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function t5(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:r5,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var r5,n5,i5=y(()=>{"use strict";Be();r5="ID_COLLISION";n5={name:r5,run:WOe}});import{existsSync as $p,readFileSync as YP,readdirSync as XP,statSync as KOe,writeFileSync as s5}from"node:fs";import{join as ko}from"node:path";function o5(t){if(!$p(t))return 0;try{return XP(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function JOe(t){if(!$p(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=XP(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=ko(n,o),a;try{a=KOe(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function YOe(t){let e=ko(t,"spec","capabilities.yaml");if(!$p(e))return 0;try{let r=Zv.default.parse(YP(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function _s(t="."){let e=o5(ko(t,"spec","features")),r=o5(ko(t,"spec","scenarios")),n=YOe(t),i=JOe(ko(t,"tests"));return{features:e,scenarios:r,capabilities:n,test_files:i}}function Bl(t,e){let r=ko(t,"spec.yaml");if(!$p(r))return;let n=YP(r,"utf8"),i=XOe(n,e);i!==n&&s5(r,i)}function XOe(t,e){let r=t.includes(`\r `)?`\r @@ -306,7 +306,7 @@ ${o}`:`[${t}]`),o&&s?`${o} ${s}`:o||s}function LC(t,{maxDepth:e=1e3,numbersAsFloat:r=!1}={}){if(Up(t)!=="object")throw new TypeError("stringify can only be called with an object");let n=FC(0,t,"",e,r);return n[n.length-1]!==` `?n+` `:n}var AY,TY=y(()=>{AY=/^[a-z0-9-_]+$/i});var zC={};Pr(zC,{TomlDate:()=>Ya,TomlError:()=>me,default:()=>NPe,parse:()=>NC,stringify:()=>LC});var NPe,UC=y(()=>{EY();TY();IC();Ja();NPe={parse:NC,stringify:LC,TomlDate:Ya,TomlError:me}});import KY from"node:process";function rc(t={}){let e=t.cwd??".",n=(H_(Ua.name,e)??Ua.run(t)).filter(s=>s.severity==="error"),i=n.length===0,o={stage:zCe,pass:i,exitCode:i?0:1};return i?o:{...o,stderr:n.map(s=>s.message).join(` -`)}}var zCe,UCe,bS=y(()=>{"use strict";yl();Ov();zCe="stage_1.5";UCe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${KY.argv[1]}`;if(UCe){let t=rc();console.log(JSON.stringify(t)),KY.exit(t.exitCode)}});var s7={};Pr(s7,{clearHostMcpServerForTesting:()=>fNe,getHostMcpServer:()=>ic,setHostMcpServer:()=>dNe});function dNe(t){let e=tu;return tu=t,()=>{tu===t&&(tu=e)}}function ic(){return tu}function fNe(){tu=null}var tu,Xp=y(()=>{"use strict";tu=null});var _t=v(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.__setModuleDefault=zi.__createBinding=void 0;zi.__classPrivateFieldSet=pNe;zi.__classPrivateFieldGet=mNe;zi.__importStar=hNe;zi.__exportStar=gNe;function pNe(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function mNe(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var P1=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};zi.__createBinding=P1;var a7=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};zi.__setModuleDefault=a7;var I1=function(t){return I1=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},I1(t)};function hNe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=I1(t),n=0;n{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});Qp.uuid4=void 0;var yNe=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return Qp.uuid4=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))};Qp.uuid4=yNe});var ru=v(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.castToError=void 0;em.isAbortError=_Ne;function _Ne(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var bNe=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};em.castToError=bNe});var fr=v(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.InternalServerError=Xe.RateLimitError=Xe.UnprocessableEntityError=Xe.ConflictError=Xe.NotFoundError=Xe.PermissionDeniedError=Xe.AuthenticationError=Xe.BadRequestError=Xe.APIConnectionTimeoutError=Xe.APIConnectionError=Xe.APIUserAbortError=Xe.APIError=Xe.AnthropicError=void 0;var vNe=ru(),AS=class extends Error{};Xe.AnthropicError=AS;var ln=class t extends AS{constructor(e,r,n,i,o){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=i,this.requestID=i?.get("request-id"),this.error=r,this.type=o??null}static makeMessage(e,r,n){let i=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&i?`${e} ${i}`:e?`${e} status code (no body)`:i||"(no status code or body)"}static generate(e,r,n,i){if(!e||!i)return new tm({message:n,cause:(0,vNe.castToError)(r)});let o=r,s=o?.error?.type;return e===400?new TS(e,o,n,i,s):e===401?new OS(e,o,n,i,s):e===403?new RS(e,o,n,i,s):e===404?new IS(e,o,n,i,s):e===409?new PS(e,o,n,i,s):e===422?new CS(e,o,n,i,s):e===429?new DS(e,o,n,i,s):e>=500?new NS(e,o,n,i,s):new t(e,o,n,i,s)}};Xe.APIError=ln;var D1=class extends ln{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}};Xe.APIUserAbortError=D1;var tm=class extends ln{constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}};Xe.APIConnectionError=tm;var N1=class extends tm{constructor({message:e}={}){super({message:e??"Request timed out."})}};Xe.APIConnectionTimeoutError=N1;var TS=class extends ln{};Xe.BadRequestError=TS;var OS=class extends ln{};Xe.AuthenticationError=OS;var RS=class extends ln{};Xe.PermissionDeniedError=RS;var IS=class extends ln{};Xe.NotFoundError=IS;var PS=class extends ln{};Xe.ConflictError=PS;var CS=class extends ln{};Xe.UnprocessableEntityError=CS;var DS=class extends ln{};Xe.RateLimitError=DS;var NS=class extends ln{};Xe.InternalServerError=NS});var Ui=v(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.pop=Ae.safeJSON=Ae.maybeCoerceBoolean=Ae.maybeCoerceFloat=Ae.maybeCoerceInteger=Ae.coerceBoolean=Ae.coerceFloat=Ae.coerceInteger=Ae.validatePositiveInteger=Ae.ensurePresent=Ae.isReadonlyArray=Ae.isArray=Ae.isAbsoluteURL=void 0;Ae.maybeObj=$Ne;Ae.isEmptyObj=kNe;Ae.hasOwn=ENe;Ae.isObj=ANe;var rm=fr(),SNe=/^[a-z][a-z0-9+.-]*:/i,wNe=t=>SNe.test(t);Ae.isAbsoluteURL=wNe;var xNe=t=>(Ae.isArray=Array.isArray,(0,Ae.isArray)(t));Ae.isArray=xNe;Ae.isReadonlyArray=Ae.isArray;function $Ne(t){return typeof t!="object"?{}:t??{}}function kNe(t){if(!t)return!0;for(let e in t)return!1;return!0}function ENe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ANe(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var TNe=t=>{if(t==null)throw new rm.AnthropicError(`Expected a value to be given but received ${t} instead.`);return t};Ae.ensurePresent=TNe;var ONe=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new rm.AnthropicError(`${t} must be an integer`);if(e<0)throw new rm.AnthropicError(`${t} must be a positive integer`);return e};Ae.validatePositiveInteger=ONe;var RNe=t=>{if(typeof t=="number")return Math.round(t);if(typeof t=="string")return parseInt(t,10);throw new rm.AnthropicError(`Could not coerce ${t} (type: ${typeof t}) into a number`)};Ae.coerceInteger=RNe;var INe=t=>{if(typeof t=="number")return t;if(typeof t=="string")return parseFloat(t);throw new rm.AnthropicError(`Could not coerce ${t} (type: ${typeof t}) into a number`)};Ae.coerceFloat=INe;var PNe=t=>typeof t=="boolean"?t:typeof t=="string"?t==="true":!!t;Ae.coerceBoolean=PNe;var CNe=t=>{if(t!=null)return(0,Ae.coerceInteger)(t)};Ae.maybeCoerceInteger=CNe;var DNe=t=>{if(t!=null)return(0,Ae.coerceFloat)(t)};Ae.maybeCoerceFloat=DNe;var NNe=t=>{if(t!=null)return(0,Ae.coerceBoolean)(t)};Ae.maybeCoerceBoolean=NNe;var jNe=t=>{try{return JSON.parse(t)}catch{return}};Ae.safeJSON=jNe;var MNe=(t,e)=>{let r=t[e];return delete t[e],r};Ae.pop=MNe});var j1=v(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});jS.sleep=void 0;var FNe=t=>new Promise(e=>setTimeout(e,t));jS.sleep=FNe});var nm=v(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});MS.VERSION=void 0;MS.VERSION="0.96.0"});var FS=v(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.getPlatformHeaders=nu.isRunningInBrowser=void 0;var im=nm(),LNe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";nu.isRunningInBrowser=LNe;function zNe(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}var UNe=()=>{let t=zNe();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":im.VERSION,"X-Stainless-OS":l7(Deno.build.os),"X-Stainless-Arch":c7(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":im.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":im.VERSION,"X-Stainless-OS":l7(globalThis.process.platform??"unknown"),"X-Stainless-Arch":c7(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=qNe();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":im.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":im.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function qNe(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let i=n[1]||0,o=n[2]||0,s=n[3]||0;return{browser:e,version:`${i}.${o}.${s}`}}}return null}var c7=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",l7=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),u7,BNe=()=>u7??(u7=UNe());nu.getPlatformHeaders=BNe});var iu=v(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.getDefaultFetch=HNe;oc.makeReadableStream=d7;oc.ReadableStreamFrom=GNe;oc.ReadableStreamToAsyncIterable=ZNe;oc.CancelReadableStream=VNe;function HNe(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function d7(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function GNe(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return d7({start(){},async pull(r){let{done:n,value:i}=await e.next();n?r.close():r.enqueue(i)},async cancel(){await e.return?.()}})}function ZNe(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function VNe(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}});var f7=v(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});LS.FallbackEncoder=void 0;var WNe=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});LS.FallbackEncoder=WNe});var M1=v(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.RFC3986=un.RFC1738=un.formatters=un.default_formatter=un.default_format=void 0;un.default_format="RFC3986";var KNe=t=>String(t);un.default_formatter=KNe;un.formatters={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:un.default_formatter};un.RFC1738="RFC1738";un.RFC3986="RFC3986"});var p7=v(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.encode=Bt.has=void 0;Bt.merge=L1;Bt.assign_single_source=eje;Bt.decode=tje;Bt.compact=nje;Bt.is_regexp=ije;Bt.is_buffer=oje;Bt.combine=sje;Bt.maybe_map=aje;var JNe=M1(),sc=Ui(),YNe=(t,e)=>(Bt.has=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),(0,Bt.has)(t,e));Bt.has=YNe;var qi=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})();function XNe(t){for(;t.length>1;){let e=t.pop();if(!e)continue;let r=e.obj[e.prop];if((0,sc.isArray)(r)){let n=[];for(let i=0;i{if(t.length===0)return t;let o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let s="";for(let a=0;a=F1?o.slice(a,a+F1):o,l=[];for(let u=0;u=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===JNe.RFC1738&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=qi[d];continue}if(d<2048){l[l.length]=qi[192|d>>6]+qi[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=qi[224|d>>12]+qi[128|d>>6&63]+qi[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=qi[240|d>>18]+qi[128|d>>12&63]+qi[128|d>>6&63]+qi[128|d&63]}s+=l.join("")}return s};Bt.encode=rje;function nje(t){let e=[{obj:{o:t},prop:"o"}],r=[];for(let n=0;n{"use strict";Object.defineProperty(U1,"__esModule",{value:!0});U1.stringify=uje;var om=p7(),sm=M1(),Bi=Ui(),h7={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},g7=function(t,e){Array.prototype.push.apply(t,(0,Bi.isArray)(e)?e:[e])},m7,Ht={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:om.encode,encodeValuesOnly:!1,format:sm.default_format,formatter:sm.default_formatter,indices:!1,serializeDate(t){return(m7??(m7=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};function cje(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}var z1={};function y7(t,e,r,n,i,o,s,a,c,l,u,d,f,p,m,h,g,b){let _=t,S=b,x=0,w=!1;for(;(S=S.get(z1))!==void 0&&!w;){let $=S.get(t);if(x+=1,typeof $<"u"){if($===x)throw new RangeError("Cyclic object value");w=!0}typeof S.get(z1)>"u"&&(x=0)}if(typeof l=="function"?_=l(e,_):_ instanceof Date?_=f?.(_):r==="comma"&&(0,Bi.isArray)(_)&&(_=(0,om.maybe_map)(_,function($){return $ instanceof Date?f?.($):$})),_===null){if(o)return c&&!h?c(e,Ht.encoder,g,"key",p):e;_=""}if(cje(_)||(0,om.is_buffer)(_)){if(c){let $=h?e:c(e,Ht.encoder,g,"key",p);return[m?.($)+"="+m?.(c(_,Ht.encoder,g,"value",p))]}return[m?.(e)+"="+m?.(String(_))]}let O=[];if(typeof _>"u")return O;let T;if(r==="comma"&&(0,Bi.isArray)(_))h&&c&&(_=(0,om.maybe_map)(_,c)),T=[{value:_.length>0?_.join(",")||null:void 0}];else if((0,Bi.isArray)(l))T=l;else{let $=Object.keys(_);T=u?$.sort(u):$}let A=a?String(e).replace(/\./g,"%2E"):String(e),D=n&&(0,Bi.isArray)(_)&&_.length===1?A+"[]":A;if(i&&(0,Bi.isArray)(_)&&_.length===0)return D+"[]";for(let $=0;$"u"?t.encodeDotInKeys?!0:Ht.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Ht.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Ht.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Ht.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Ht.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Ht.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Ht.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Ht.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Ht.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Ht.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Ht.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Ht.strictNullHandling}}function uje(t,e={}){let r=t,n=lje(e),i,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):(0,Bi.isArray)(n.filter)&&(o=n.filter,i=o);let s=[];if(typeof r!="object"||r===null)return"";let a=h7[n.arrayFormat],c=a==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);let l=new WeakMap;for(let f=0;f0?d+u:""}});var B1=v(q1=>{"use strict";Object.defineProperty(q1,"__esModule",{value:!0});q1.stringifyQuery=pje;var dje=_t(),fje=dje.__importStar(_7());function pje(t){return fje.stringify(t,{arrayFormat:"brackets"})}});var su=v(He=>{"use strict";var mje=He&&He.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hje=He&&He.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),G1=He&&He.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i`}return JSON.stringify(ou(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))bje.has(r)&&(e[r]=n);return e}return null}async function vje(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await Promise.resolve().then(()=>G1(Ge("node:fs"))),n=t,i;try{n=await r.promises.realpath(t),i=await r.promises.stat(n)}catch{return}let o=i.mode&511;if(o&18)throw new Hi(`Credentials file at ${n} is group/world-writable (mode 0o${o.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(o&36)throw new Hi(`Credentials file at ${n} is group/world-readable (mode 0o${o.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&i.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${i.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function Sje(t,e){let r=await Promise.resolve().then(()=>G1(Ge("node:fs"))),i=(await Promise.resolve().then(()=>G1(Ge("node:path")))).dirname(t);await r.promises.mkdir(i,{recursive:!0,mode:448});let o=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(e,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(o,t)}catch(s){throw await r.promises.unlink(o).catch(()=>{}),s}try{let s=await r.promises.open(i,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function wje(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:o,value:s}=await e.read();if(o)break;if(n+s.length>b7){let a=b7-n;a>0&&r.push(s.subarray(0,a)),await e.cancel();break}r.push(s),n+=s.length}let i;if(r.length===1)i=r[0];else{i=new Uint8Array(r.reduce((s,a)=>s+a.length,0));let o=0;for(let s of r)i.set(s,o),o+=s.length}return new TextDecoder("utf-8").decode(i)}var Hi=class extends gje.AnthropicError{constructor(e,r=null,n=null,i=null){super(e),this.statusCode=r,this.body=n,this.requestId=i}};He.WorkloadIdentityError=Hi});var am=v(Z1=>{"use strict";Object.defineProperty(Z1,"__esModule",{value:!0});Z1.nowAsSeconds=xje;function xje(){return Math.floor(Date.now()/1e3)}});var v7=v(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});zS.TokenCache=void 0;var V1=su(),W1=am(),K1=class{constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-(0,W1.nowAsSeconds)();return n>V1.ADVISORY_REFRESH_THRESHOLD_IN_SECONDS?r.token:n>V1.MANDATORY_REFRESH_THRESHOLD_IN_SECONDS?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||(0,W1.nowAsSeconds)()-this.lastAdvisoryError{this.lastAdvisoryError=(0,W1.nowAsSeconds)(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}};zS.TokenCache=K1});var qS=v(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});US.readEnv=void 0;var $je=t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0};US.readEnv=$je});var BS=v(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.concatBytes=kje;cm.encodeUTF8=Eje;cm.decodeUTF8=Aje;function kje(t){let e=0;for(let i of t)e+=i.length;let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}var S7;function Eje(t){let e;return(S7??(e=new globalThis.TextEncoder,S7=e.encode.bind(e)))(t)}var w7;function Aje(t){let e;return(w7??(e=new globalThis.TextDecoder,w7=e.decode.bind(e)))(t)}});var $7=v(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.fromBase64=au.toBase64=void 0;var x7=fr(),Tje=BS(),Oje=t=>{if(!t)return"";if(typeof globalThis.Buffer<"u")return globalThis.Buffer.from(t).toString("base64");if(typeof t=="string"&&(t=(0,Tje.encodeUTF8)(t)),typeof btoa<"u")return btoa(String.fromCharCode.apply(null,t));throw new x7.AnthropicError("Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined")};au.toBase64=Oje;var Rje=t=>{if(typeof globalThis.Buffer<"u"){let e=globalThis.Buffer.from(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}if(typeof atob<"u"){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.formatRequestDetails=ac.parseLogLevel=void 0;ac.loggerFor=E7;var Ije=Ui(),GS={off:0,error:200,warn:300,info:400,debug:500},Pje=(t,e,r)=>{if(t){if((0,Ije.hasOwn)(GS,t))return t;E7(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(GS))}`)}};ac.parseLogLevel=Pje;function lm(){}function HS(t,e,r){return!e||GS[t]>GS[r]?lm:e[t].bind(e)}var Cje={error:lm,warn:lm,info:lm,debug:lm},k7=new WeakMap;function E7(t){let e=t.logger,r=t.logLevel??"off";if(!e)return Cje;let n=k7.get(e);if(n&&n[0]===r)return n[1];let i={error:HS("error",e,r),warn:HS("warn",e,r),info:HS("info",e,r),debug:HS("debug",e,r)};return k7.set(e,[r,i]),i}var Dje=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t);ac.formatRequestDetails=Dje});var A7=v(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});var cc=_t();cc.__exportStar(Ui(),To);cc.__exportStar($7(),To);cc.__exportStar(qS(),To);cc.__exportStar(um(),To);cc.__exportStar(C1(),To);cc.__exportStar(j1(),To);cc.__exportStar(B1(),To)});var Y1=v(bt=>{"use strict";var Nje=bt&&bt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jje=bt&&bt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),lc=bt&&bt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i(await(0,bt.loadConfigWithSource)(t))?.config??null;bt.loadConfig=Fje;var Lje=async t=>{var e,r;let n=await J1();if(n===null)return null;let i=t??await R7();if(i===null)return null;O7(i);let o=await Promise.resolve().then(()=>lc(Ge("node:fs"))),a=(await Promise.resolve().then(()=>lc(Ge("node:path")))).join(n,"configs",`${i}.json`),c;try{c=await o.promises.readFile(a,"utf-8")}catch(d){if(d?.code!=="ENOENT")throw new Error(`failed to read config file ${a}: ${d}`);c=null}if(c===null){let d=(0,Nt.readEnv)("ANTHROPIC_ORGANIZATION_ID"),f=(0,Nt.readEnv)("ANTHROPIC_IDENTITY_TOKEN_FILE"),p=(0,Nt.readEnv)("ANTHROPIC_FEDERATION_RULE_ID");return p&&d?{fromFile:!1,config:{organization_id:d,workspace_id:(0,Nt.readEnv)("ANTHROPIC_WORKSPACE_ID"),base_url:(0,Nt.readEnv)("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:p,service_account_id:(0,Nt.readEnv)("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:f?{source:"file",path:f}:void 0,scope:(0,Nt.readEnv)("ANTHROPIC_SCOPE")}}}:null}let l;try{l=JSON.parse(c)}catch(d){throw new Error(`failed to parse config file ${a}: ${d}`)}if(!l.authentication)throw new Error(`config file ${a} is missing "authentication"`);let u=l.authentication.type;if(u!=="oidc_federation"&&u!=="user_oauth")throw new Error(`authentication.type "${u}" is not a known authentication type`);if(l.organization_id??(l.organization_id=(0,Nt.readEnv)("ANTHROPIC_ORGANIZATION_ID")),l.workspace_id??(l.workspace_id=(0,Nt.readEnv)("ANTHROPIC_WORKSPACE_ID")),l.base_url??(l.base_url=(0,Nt.readEnv)("ANTHROPIC_BASE_URL")),(e=l.authentication).scope??(e.scope=(0,Nt.readEnv)("ANTHROPIC_SCOPE")),l.authentication.type==="oidc_federation"){if(!l.authentication.identity_token){let d=(0,Nt.readEnv)("ANTHROPIC_IDENTITY_TOKEN_FILE");d&&(l.authentication.identity_token={source:"file",path:d})}l.authentication.federation_rule_id||(l.authentication.federation_rule_id=(0,Nt.readEnv)("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=l.authentication).service_account_id??(r.service_account_id=(0,Nt.readEnv)("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:l,fromFile:!0}};bt.loadConfigWithSource=Lje;var zje=async()=>{let t=await(0,bt.loadConfig)(),e=await(0,bt.getCredentialsPath)(t);if(!e)return null;let r=await Promise.resolve().then(()=>lc(Ge("node:fs"))),n;try{n=await r.promises.readFile(e,"utf-8")}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read credentials file ${e}: ${o}`);return null}let i;try{i=JSON.parse(n)}catch(o){throw new Error(`failed to parse credentials file ${e}: ${o}`)}if(i.type&&i.type!=="oauth_token")throw new Error(`credentials file ${e} has unsupported type "${i.type}" (want "oauth_token")`);return i};bt.loadCredentials=zje;var Uje=async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await J1();if(!r)return null;let n=e??await R7();return n?(O7(n),(await Promise.resolve().then(()=>lc(Ge("node:path")))).join(r,"credentials",`${n}.json`)):null};bt.getCredentialsPath=Uje;var J1=async()=>{if(!qje())return null;let t=await Promise.resolve().then(()=>lc(Ge("node:path"))),e=(0,Nt.readEnv)("ANTHROPIC_CONFIG_DIR");if(e)return e;if((0,T7.getPlatformHeaders)()["X-Stainless-OS"]==="Windows"){let o=(0,Nt.readEnv)("APPDATA");if(o)return t.join(o,"Anthropic");let s=(0,Nt.readEnv)("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let n=(0,Nt.readEnv)("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let i=(0,Nt.readEnv)("HOME");return i?t.join(i,".config","anthropic"):null},qje=()=>{let t=(0,T7.getPlatformHeaders)()["X-Stainless-Runtime"];return t==="node"||t==="deno"},R7=async()=>{let t=await J1();if(!t)return null;let e=(0,Nt.readEnv)("ANTHROPIC_PROFILE");if(e)return e;let r=await Promise.resolve().then(()=>lc(Ge("node:fs"))),i=(await Promise.resolve().then(()=>lc(Ge("node:path")))).join(t,"active_config");try{return(await r.promises.readFile(i,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read ${i}: ${o}`);return"default"}}});var I7=v(Gi=>{"use strict";var Bje=Gi&&Gi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hje=Gi&&Gi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Gje=Gi&&Gi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i{let e=await Promise.resolve().then(()=>Gje(Ge("node:fs"))),r;try{r=await e.promises.readFile(t,"utf-8")}catch(i){throw new ZS.AnthropicError(`Failed to read identity token file at ${t}: ${i}`)}let n=r.trim();if(!n)throw new ZS.AnthropicError(`Identity token file at ${t} is empty`);return n}}function Vje(t){if(!t)throw new ZS.AnthropicError("Identity token value is empty");return()=>t}});var P7=v(X1=>{"use strict";Object.defineProperty(X1,"__esModule",{value:!0});X1.oidcFederationProvider=Jje;var dn=su(),Wje=am(),Kje=nm();function Jje(t){return async()=>{(0,dn.requireSecureTokenEndpoint)(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new dn.WorkloadIdentityError(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:dn.GRANT_TYPE_JWT_BEARER,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${dn.TOKEN_ENDPOINT}`,i;try{i=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${dn.OAUTH_API_BETA_HEADER},${dn.FEDERATION_BETA_HEADER}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${Kje.VERSION} oidcFederationProvider`},body:JSON.stringify(r)})}catch(c){throw new dn.WorkloadIdentityError(`Failed to reach token endpoint ${n}: ${c}`)}let o=i.headers.get("Request-Id");if(!i.ok){let c=await i.text().catch(()=>""),l=(0,dn.redactSensitive)(c),u="";throw i.status===401&&(u=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new dn.WorkloadIdentityError(`Token exchange failed with status ${i.status}${o?` (request-id ${o})`:""}: ${l}${u}`,i.status,l,o)}let s=await(0,dn.parseTokenResponse)(i,o),a=Number(s.expires_in);if(!Number.isFinite(a))throw new dn.WorkloadIdentityError(`Token endpoint response missing required fields: ${JSON.stringify((0,dn.redactSensitive)(s))}`,i.status,(0,dn.redactSensitive)(s),o);return{token:s.access_token,expiresAt:(0,Wje.nowAsSeconds)()+a}}}});var D7=v(Oo=>{"use strict";var Yje=Oo&&Oo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xje=Oo&&Oo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Qje=Oo&&Oo.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i{let r=await Promise.resolve().then(()=>Qje(Ge("node:fs")));await(0,Gt.checkCredentialsFileSafety)(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(g){throw new Gt.WorkloadIdentityError(`Credentials file not found at ${t.credentialsPath}: ${g}`)}let i;try{i=JSON.parse(n)}catch(g){throw new Gt.WorkloadIdentityError(`Credentials file at ${t.credentialsPath} is not valid JSON: ${g}`)}let o=i.access_token;if(!o)throw new Gt.WorkloadIdentityError(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let s=i.expires_at;if(!e?.forceRefresh&&(s==null||(0,C7.nowAsSeconds)()"");throw new Gt.WorkloadIdentityError(`User OAuth refresh failed (HTTP ${u.status}): ${(0,Gt.redactSensitive)(g)}`,u.status,(0,Gt.redactSensitive)(g),d)}let f=await(0,Gt.parseTokenResponse)(u,d),p=Number(f.expires_in);if(!Number.isFinite(p))throw new Gt.WorkloadIdentityError(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify((0,Gt.redactSensitive)(f))}`,u.status,(0,Gt.redactSensitive)(f),d);let m=(0,C7.nowAsSeconds)()+p,h=f.refresh_token||a;return await(0,Gt.writeCredentialsFileAtomic)(t.credentialsPath,{...i,version:eMe.CREDENTIALS_FILE_VERSION,type:"oauth_token",access_token:f.access_token,expires_at:m,refresh_token:h}),{token:f.access_token,expiresAt:m}}}});var M7=v(Vi=>{"use strict";var nMe=Vi&&Vi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),iMe=Vi&&Vi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),oMe=Vi&&Vi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i/credentials/.json)");return(0,cMe.userOAuthProvider)({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let i=t.authentication.type;throw new Zi.WorkloadIdentityError(`authentication.type "${i}" is not a known authentication type`)}}}function dMe(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Zi.WorkloadIdentityError(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Zi.WorkloadIdentityError('identity_token.source "file" requires a non-empty path');return(0,Q1.identityTokenFromFile)(t.identity_token.path)}let e=(0,N7.readEnv)("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return(0,Q1.identityTokenFromFile)(e);let r=(0,N7.readEnv)("ANTHROPIC_IDENTITY_TOKEN");return r?(0,Q1.identityTokenFromValue)(r):null}function fMe(t,e,r,n){return async i=>{let o=await Promise.resolve().then(()=>oMe(Ge("node:fs")));await(0,Zi.checkCredentialsFileSafety)(e,n);let s;try{let c=await o.promises.readFile(e,"utf-8");s=JSON.parse(c);let l=s?.access_token;if(l&&!i?.forceRefresh){let u=s?.expires_at;if(u==null||(0,sMe.nowAsSeconds)(){"use strict";var fn,pn;Object.defineProperty(fm,"__esModule",{value:!0});fm.LineDecoder=void 0;fm.findDoubleNewlineIndex=mMe;var $t=_t(),VS=BS(),dm=class{constructor(){fn.set(this,void 0),pn.set(this,void 0),$t.__classPrivateFieldSet(this,fn,new Uint8Array,"f"),$t.__classPrivateFieldSet(this,pn,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?(0,VS.encodeUTF8)(e):e;$t.__classPrivateFieldSet(this,fn,(0,VS.concatBytes)([$t.__classPrivateFieldGet(this,fn,"f"),r]),"f");let n=[],i;for(;(i=pMe($t.__classPrivateFieldGet(this,fn,"f"),$t.__classPrivateFieldGet(this,pn,"f")))!=null;){if(i.carriage&&$t.__classPrivateFieldGet(this,pn,"f")==null){$t.__classPrivateFieldSet(this,pn,i.index,"f");continue}if($t.__classPrivateFieldGet(this,pn,"f")!=null&&(i.index!==$t.__classPrivateFieldGet(this,pn,"f")+1||i.carriage)){n.push((0,VS.decodeUTF8)($t.__classPrivateFieldGet(this,fn,"f").subarray(0,$t.__classPrivateFieldGet(this,pn,"f")-1))),$t.__classPrivateFieldSet(this,fn,$t.__classPrivateFieldGet(this,fn,"f").subarray($t.__classPrivateFieldGet(this,pn,"f")),"f"),$t.__classPrivateFieldSet(this,pn,null,"f");continue}let o=$t.__classPrivateFieldGet(this,pn,"f")!==null?i.preceding-1:i.preceding,s=(0,VS.decodeUTF8)($t.__classPrivateFieldGet(this,fn,"f").subarray(0,o));n.push(s),$t.__classPrivateFieldSet(this,fn,$t.__classPrivateFieldGet(this,fn,"f").subarray(i.index),"f"),$t.__classPrivateFieldSet(this,pn,null,"f")}return n}flush(){return $t.__classPrivateFieldGet(this,fn,"f").length?this.decode(` +`)}}var zCe,UCe,bS=y(()=>{"use strict";yl();Ov();zCe="stage_1.5";UCe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${KY.argv[1]}`;if(UCe){let t=rc();console.log(JSON.stringify(t)),KY.exit(t.exitCode)}});var s7={};Pr(s7,{clearHostMcpServerForTesting:()=>fNe,getHostMcpServer:()=>ic,setHostMcpServer:()=>dNe});function dNe(t){let e=tu;return tu=t,()=>{tu===t&&(tu=e)}}function ic(){return tu}function fNe(){tu=null}var tu,Xp=y(()=>{"use strict";tu=null});var _t=v(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.__setModuleDefault=zi.__createBinding=void 0;zi.__classPrivateFieldSet=pNe;zi.__classPrivateFieldGet=mNe;zi.__importStar=hNe;zi.__exportStar=gNe;function pNe(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function mNe(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var P1=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};zi.__createBinding=P1;var a7=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};zi.__setModuleDefault=a7;var I1=function(t){return I1=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},I1(t)};function hNe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=I1(t),n=0;n{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});Qp.uuid4=void 0;var yNe=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return Qp.uuid4=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))};Qp.uuid4=yNe});var ru=v(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.castToError=void 0;em.isAbortError=_Ne;function _Ne(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var bNe=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};em.castToError=bNe});var fr=v(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.InternalServerError=Xe.RateLimitError=Xe.UnprocessableEntityError=Xe.ConflictError=Xe.NotFoundError=Xe.PermissionDeniedError=Xe.AuthenticationError=Xe.BadRequestError=Xe.APIConnectionTimeoutError=Xe.APIConnectionError=Xe.APIUserAbortError=Xe.APIError=Xe.AnthropicError=void 0;var vNe=ru(),AS=class extends Error{};Xe.AnthropicError=AS;var ln=class t extends AS{constructor(e,r,n,i,o){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=i,this.requestID=i?.get("request-id"),this.error=r,this.type=o??null}static makeMessage(e,r,n){let i=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&i?`${e} ${i}`:e?`${e} status code (no body)`:i||"(no status code or body)"}static generate(e,r,n,i){if(!e||!i)return new tm({message:n,cause:(0,vNe.castToError)(r)});let o=r,s=o?.error?.type;return e===400?new TS(e,o,n,i,s):e===401?new OS(e,o,n,i,s):e===403?new RS(e,o,n,i,s):e===404?new IS(e,o,n,i,s):e===409?new PS(e,o,n,i,s):e===422?new CS(e,o,n,i,s):e===429?new DS(e,o,n,i,s):e>=500?new NS(e,o,n,i,s):new t(e,o,n,i,s)}};Xe.APIError=ln;var D1=class extends ln{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}};Xe.APIUserAbortError=D1;var tm=class extends ln{constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}};Xe.APIConnectionError=tm;var N1=class extends tm{constructor({message:e}={}){super({message:e??"Request timed out."})}};Xe.APIConnectionTimeoutError=N1;var TS=class extends ln{};Xe.BadRequestError=TS;var OS=class extends ln{};Xe.AuthenticationError=OS;var RS=class extends ln{};Xe.PermissionDeniedError=RS;var IS=class extends ln{};Xe.NotFoundError=IS;var PS=class extends ln{};Xe.ConflictError=PS;var CS=class extends ln{};Xe.UnprocessableEntityError=CS;var DS=class extends ln{};Xe.RateLimitError=DS;var NS=class extends ln{};Xe.InternalServerError=NS});var Ui=v(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.pop=Ae.safeJSON=Ae.maybeCoerceBoolean=Ae.maybeCoerceFloat=Ae.maybeCoerceInteger=Ae.coerceBoolean=Ae.coerceFloat=Ae.coerceInteger=Ae.validatePositiveInteger=Ae.ensurePresent=Ae.isReadonlyArray=Ae.isArray=Ae.isAbsoluteURL=void 0;Ae.maybeObj=$Ne;Ae.isEmptyObj=kNe;Ae.hasOwn=ENe;Ae.isObj=ANe;var rm=fr(),SNe=/^[a-z][a-z0-9+.-]*:/i,wNe=t=>SNe.test(t);Ae.isAbsoluteURL=wNe;var xNe=t=>(Ae.isArray=Array.isArray,(0,Ae.isArray)(t));Ae.isArray=xNe;Ae.isReadonlyArray=Ae.isArray;function $Ne(t){return typeof t!="object"?{}:t??{}}function kNe(t){if(!t)return!0;for(let e in t)return!1;return!0}function ENe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ANe(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var TNe=t=>{if(t==null)throw new rm.AnthropicError(`Expected a value to be given but received ${t} instead.`);return t};Ae.ensurePresent=TNe;var ONe=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new rm.AnthropicError(`${t} must be an integer`);if(e<0)throw new rm.AnthropicError(`${t} must be a positive integer`);return e};Ae.validatePositiveInteger=ONe;var RNe=t=>{if(typeof t=="number")return Math.round(t);if(typeof t=="string")return parseInt(t,10);throw new rm.AnthropicError(`Could not coerce ${t} (type: ${typeof t}) into a number`)};Ae.coerceInteger=RNe;var INe=t=>{if(typeof t=="number")return t;if(typeof t=="string")return parseFloat(t);throw new rm.AnthropicError(`Could not coerce ${t} (type: ${typeof t}) into a number`)};Ae.coerceFloat=INe;var PNe=t=>typeof t=="boolean"?t:typeof t=="string"?t==="true":!!t;Ae.coerceBoolean=PNe;var CNe=t=>{if(t!=null)return(0,Ae.coerceInteger)(t)};Ae.maybeCoerceInteger=CNe;var DNe=t=>{if(t!=null)return(0,Ae.coerceFloat)(t)};Ae.maybeCoerceFloat=DNe;var NNe=t=>{if(t!=null)return(0,Ae.coerceBoolean)(t)};Ae.maybeCoerceBoolean=NNe;var jNe=t=>{try{return JSON.parse(t)}catch{return}};Ae.safeJSON=jNe;var MNe=(t,e)=>{let r=t[e];return delete t[e],r};Ae.pop=MNe});var j1=v(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});jS.sleep=void 0;var FNe=t=>new Promise(e=>setTimeout(e,t));jS.sleep=FNe});var nm=v(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});MS.VERSION=void 0;MS.VERSION="0.96.0"});var FS=v(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.getPlatformHeaders=nu.isRunningInBrowser=void 0;var im=nm(),LNe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";nu.isRunningInBrowser=LNe;function zNe(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}var UNe=()=>{let t=zNe();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":im.VERSION,"X-Stainless-OS":l7(Deno.build.os),"X-Stainless-Arch":c7(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":im.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":im.VERSION,"X-Stainless-OS":l7(globalThis.process.platform??"unknown"),"X-Stainless-Arch":c7(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=qNe();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":im.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":im.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function qNe(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let i=n[1]||0,o=n[2]||0,s=n[3]||0;return{browser:e,version:`${i}.${o}.${s}`}}}return null}var c7=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",l7=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),u7,BNe=()=>u7??(u7=UNe());nu.getPlatformHeaders=BNe});var iu=v(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.getDefaultFetch=HNe;oc.makeReadableStream=d7;oc.ReadableStreamFrom=GNe;oc.ReadableStreamToAsyncIterable=ZNe;oc.CancelReadableStream=VNe;function HNe(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function d7(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function GNe(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return d7({start(){},async pull(r){let{done:n,value:i}=await e.next();n?r.close():r.enqueue(i)},async cancel(){await e.return?.()}})}function ZNe(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function VNe(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}});var f7=v(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});LS.FallbackEncoder=void 0;var WNe=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});LS.FallbackEncoder=WNe});var M1=v(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.RFC3986=un.RFC1738=un.formatters=un.default_formatter=un.default_format=void 0;un.default_format="RFC3986";var KNe=t=>String(t);un.default_formatter=KNe;un.formatters={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:un.default_formatter};un.RFC1738="RFC1738";un.RFC3986="RFC3986"});var p7=v(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.encode=Bt.has=void 0;Bt.merge=L1;Bt.assign_single_source=eje;Bt.decode=tje;Bt.compact=nje;Bt.is_regexp=ije;Bt.is_buffer=oje;Bt.combine=sje;Bt.maybe_map=aje;var JNe=M1(),sc=Ui(),YNe=(t,e)=>(Bt.has=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),(0,Bt.has)(t,e));Bt.has=YNe;var qi=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})();function XNe(t){for(;t.length>1;){let e=t.pop();if(!e)continue;let r=e.obj[e.prop];if((0,sc.isArray)(r)){let n=[];for(let i=0;i{if(t.length===0)return t;let o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let s="";for(let a=0;a=F1?o.slice(a,a+F1):o,l=[];for(let u=0;u=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===JNe.RFC1738&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=qi[d];continue}if(d<2048){l[l.length]=qi[192|d>>6]+qi[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=qi[224|d>>12]+qi[128|d>>6&63]+qi[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=qi[240|d>>18]+qi[128|d>>12&63]+qi[128|d>>6&63]+qi[128|d&63]}s+=l.join("")}return s};Bt.encode=rje;function nje(t){let e=[{obj:{o:t},prop:"o"}],r=[];for(let n=0;n{"use strict";Object.defineProperty(U1,"__esModule",{value:!0});U1.stringify=uje;var om=p7(),sm=M1(),Bi=Ui(),h7={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},g7=function(t,e){Array.prototype.push.apply(t,(0,Bi.isArray)(e)?e:[e])},m7,Ht={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:om.encode,encodeValuesOnly:!1,format:sm.default_format,formatter:sm.default_formatter,indices:!1,serializeDate(t){return(m7??(m7=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};function cje(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}var z1={};function y7(t,e,r,n,i,o,s,a,c,l,u,d,f,p,m,h,g,b){let _=t,S=b,x=0,w=!1;for(;(S=S.get(z1))!==void 0&&!w;){let $=S.get(t);if(x+=1,typeof $<"u"){if($===x)throw new RangeError("Cyclic object value");w=!0}typeof S.get(z1)>"u"&&(x=0)}if(typeof l=="function"?_=l(e,_):_ instanceof Date?_=f?.(_):r==="comma"&&(0,Bi.isArray)(_)&&(_=(0,om.maybe_map)(_,function($){return $ instanceof Date?f?.($):$})),_===null){if(o)return c&&!h?c(e,Ht.encoder,g,"key",p):e;_=""}if(cje(_)||(0,om.is_buffer)(_)){if(c){let $=h?e:c(e,Ht.encoder,g,"key",p);return[m?.($)+"="+m?.(c(_,Ht.encoder,g,"value",p))]}return[m?.(e)+"="+m?.(String(_))]}let O=[];if(typeof _>"u")return O;let T;if(r==="comma"&&(0,Bi.isArray)(_))h&&c&&(_=(0,om.maybe_map)(_,c)),T=[{value:_.length>0?_.join(",")||null:void 0}];else if((0,Bi.isArray)(l))T=l;else{let $=Object.keys(_);T=u?$.sort(u):$}let A=a?String(e).replace(/\./g,"%2E"):String(e),D=n&&(0,Bi.isArray)(_)&&_.length===1?A+"[]":A;if(i&&(0,Bi.isArray)(_)&&_.length===0)return D+"[]";for(let $=0;$"u"?t.encodeDotInKeys?!0:Ht.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Ht.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Ht.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Ht.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Ht.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Ht.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Ht.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Ht.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Ht.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Ht.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Ht.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Ht.strictNullHandling}}function uje(t,e={}){let r=t,n=lje(e),i,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):(0,Bi.isArray)(n.filter)&&(o=n.filter,i=o);let s=[];if(typeof r!="object"||r===null)return"";let a=h7[n.arrayFormat],c=a==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);let l=new WeakMap;for(let f=0;f0?d+u:""}});var B1=v(q1=>{"use strict";Object.defineProperty(q1,"__esModule",{value:!0});q1.stringifyQuery=pje;var dje=_t(),fje=dje.__importStar(_7());function pje(t){return fje.stringify(t,{arrayFormat:"brackets"})}});var su=v(He=>{"use strict";var mje=He&&He.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hje=He&&He.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),G1=He&&He.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i`}return JSON.stringify(ou(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))bje.has(r)&&(e[r]=n);return e}return null}async function vje(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await Promise.resolve().then(()=>G1(Ge("node:fs"))),n=t,i;try{n=await r.promises.realpath(t),i=await r.promises.stat(n)}catch{return}let o=i.mode&511;if(o&18)throw new Hi(`Credentials file at ${n} is group/world-writable (mode 0o${o.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(o&36)throw new Hi(`Credentials file at ${n} is group/world-readable (mode 0o${o.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&i.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${i.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function Sje(t,e){let r=await Promise.resolve().then(()=>G1(Ge("node:fs"))),i=(await Promise.resolve().then(()=>G1(Ge("node:path")))).dirname(t);await r.promises.mkdir(i,{recursive:!0,mode:448});let o=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(e,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(o,t)}catch(s){throw await r.promises.unlink(o).catch(()=>{}),s}try{let s=await r.promises.open(i,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function wje(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:o,value:s}=await e.read();if(o)break;if(n+s.length>b7){let a=b7-n;a>0&&r.push(s.subarray(0,a)),await e.cancel();break}r.push(s),n+=s.length}let i;if(r.length===1)i=r[0];else{i=new Uint8Array(r.reduce((s,a)=>s+a.length,0));let o=0;for(let s of r)i.set(s,o),o+=s.length}return new TextDecoder("utf-8").decode(i)}var Hi=class extends gje.AnthropicError{constructor(e,r=null,n=null,i=null){super(e),this.statusCode=r,this.body=n,this.requestId=i}};He.WorkloadIdentityError=Hi});var am=v(Z1=>{"use strict";Object.defineProperty(Z1,"__esModule",{value:!0});Z1.nowAsSeconds=xje;function xje(){return Math.floor(Date.now()/1e3)}});var v7=v(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});zS.TokenCache=void 0;var V1=su(),W1=am(),K1=class{constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-(0,W1.nowAsSeconds)();return n>V1.ADVISORY_REFRESH_THRESHOLD_IN_SECONDS?r.token:n>V1.MANDATORY_REFRESH_THRESHOLD_IN_SECONDS?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||(0,W1.nowAsSeconds)()-this.lastAdvisoryError{this.lastAdvisoryError=(0,W1.nowAsSeconds)(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}};zS.TokenCache=K1});var qS=v(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});US.readEnv=void 0;var $je=t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0};US.readEnv=$je});var BS=v(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.concatBytes=kje;cm.encodeUTF8=Eje;cm.decodeUTF8=Aje;function kje(t){let e=0;for(let i of t)e+=i.length;let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}var S7;function Eje(t){let e;return(S7??(e=new globalThis.TextEncoder,S7=e.encode.bind(e)))(t)}var w7;function Aje(t){let e;return(w7??(e=new globalThis.TextDecoder,w7=e.decode.bind(e)))(t)}});var $7=v(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.fromBase64=au.toBase64=void 0;var x7=fr(),Tje=BS(),Oje=t=>{if(!t)return"";if(typeof globalThis.Buffer<"u")return globalThis.Buffer.from(t).toString("base64");if(typeof t=="string"&&(t=(0,Tje.encodeUTF8)(t)),typeof btoa<"u")return btoa(String.fromCharCode.apply(null,t));throw new x7.AnthropicError("Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined")};au.toBase64=Oje;var Rje=t=>{if(typeof globalThis.Buffer<"u"){let e=globalThis.Buffer.from(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}if(typeof atob<"u"){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.formatRequestDetails=ac.parseLogLevel=void 0;ac.loggerFor=E7;var Ije=Ui(),GS={off:0,error:200,warn:300,info:400,debug:500},Pje=(t,e,r)=>{if(t){if((0,Ije.hasOwn)(GS,t))return t;E7(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(GS))}`)}};ac.parseLogLevel=Pje;function lm(){}function HS(t,e,r){return!e||GS[t]>GS[r]?lm:e[t].bind(e)}var Cje={error:lm,warn:lm,info:lm,debug:lm},k7=new WeakMap;function E7(t){let e=t.logger,r=t.logLevel??"off";if(!e)return Cje;let n=k7.get(e);if(n&&n[0]===r)return n[1];let i={error:HS("error",e,r),warn:HS("warn",e,r),info:HS("info",e,r),debug:HS("debug",e,r)};return k7.set(e,[r,i]),i}var Dje=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t);ac.formatRequestDetails=Dje});var A7=v(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});var cc=_t();cc.__exportStar(Ui(),To);cc.__exportStar($7(),To);cc.__exportStar(qS(),To);cc.__exportStar(um(),To);cc.__exportStar(C1(),To);cc.__exportStar(j1(),To);cc.__exportStar(B1(),To)});var Y1=v(bt=>{"use strict";var Nje=bt&&bt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jje=bt&&bt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),lc=bt&&bt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i(await(0,bt.loadConfigWithSource)(t))?.config??null;bt.loadConfig=Fje;var Lje=async t=>{var e,r;let n=await J1();if(n===null)return null;let i=t??await R7();if(i===null)return null;O7(i);let o=await Promise.resolve().then(()=>lc(Ge("node:fs"))),a=(await Promise.resolve().then(()=>lc(Ge("node:path")))).join(n,"configs",`${i}.json`),c;try{c=await o.promises.readFile(a,"utf-8")}catch(d){if(d?.code!=="ENOENT")throw new Error(`failed to read config file ${a}: ${d}`);c=null}if(c===null){let d=(0,Nt.readEnv)("ANTHROPIC_ORGANIZATION_ID"),f=(0,Nt.readEnv)("ANTHROPIC_IDENTITY_TOKEN_FILE"),p=(0,Nt.readEnv)("ANTHROPIC_FEDERATION_RULE_ID");return p&&d?{fromFile:!1,config:{organization_id:d,workspace_id:(0,Nt.readEnv)("ANTHROPIC_WORKSPACE_ID"),base_url:(0,Nt.readEnv)("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:p,service_account_id:(0,Nt.readEnv)("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:f?{source:"file",path:f}:void 0,scope:(0,Nt.readEnv)("ANTHROPIC_SCOPE")}}}:null}let l;try{l=JSON.parse(c)}catch(d){throw new Error(`failed to parse config file ${a}: ${d}`)}if(!l.authentication)throw new Error(`config file ${a} is missing "authentication"`);let u=l.authentication.type;if(u!=="oidc_federation"&&u!=="user_oauth")throw new Error(`authentication.type "${u}" is not a known authentication type`);if(l.organization_id??(l.organization_id=(0,Nt.readEnv)("ANTHROPIC_ORGANIZATION_ID")),l.workspace_id??(l.workspace_id=(0,Nt.readEnv)("ANTHROPIC_WORKSPACE_ID")),l.base_url??(l.base_url=(0,Nt.readEnv)("ANTHROPIC_BASE_URL")),(e=l.authentication).scope??(e.scope=(0,Nt.readEnv)("ANTHROPIC_SCOPE")),l.authentication.type==="oidc_federation"){if(!l.authentication.identity_token){let d=(0,Nt.readEnv)("ANTHROPIC_IDENTITY_TOKEN_FILE");d&&(l.authentication.identity_token={source:"file",path:d})}l.authentication.federation_rule_id||(l.authentication.federation_rule_id=(0,Nt.readEnv)("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=l.authentication).service_account_id??(r.service_account_id=(0,Nt.readEnv)("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:l,fromFile:!0}};bt.loadConfigWithSource=Lje;var zje=async()=>{let t=await(0,bt.loadConfig)(),e=await(0,bt.getCredentialsPath)(t);if(!e)return null;let r=await Promise.resolve().then(()=>lc(Ge("node:fs"))),n;try{n=await r.promises.readFile(e,"utf-8")}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read credentials file ${e}: ${o}`);return null}let i;try{i=JSON.parse(n)}catch(o){throw new Error(`failed to parse credentials file ${e}: ${o}`)}if(i.type&&i.type!=="oauth_token")throw new Error(`credentials file ${e} has unsupported type "${i.type}" (want "oauth_token")`);return i};bt.loadCredentials=zje;var Uje=async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await J1();if(!r)return null;let n=e??await R7();return n?(O7(n),(await Promise.resolve().then(()=>lc(Ge("node:path")))).join(r,"credentials",`${n}.json`)):null};bt.getCredentialsPath=Uje;var J1=async()=>{if(!qje())return null;let t=await Promise.resolve().then(()=>lc(Ge("node:path"))),e=(0,Nt.readEnv)("ANTHROPIC_CONFIG_DIR");if(e)return e;if((0,T7.getPlatformHeaders)()["X-Stainless-OS"]==="Windows"){let o=(0,Nt.readEnv)("APPDATA");if(o)return t.join(o,"Anthropic");let s=(0,Nt.readEnv)("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let n=(0,Nt.readEnv)("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let i=(0,Nt.readEnv)("HOME");return i?t.join(i,".config","anthropic"):null},qje=()=>{let t=(0,T7.getPlatformHeaders)()["X-Stainless-Runtime"];return t==="node"||t==="deno"},R7=async()=>{let t=await J1();if(!t)return null;let e=(0,Nt.readEnv)("ANTHROPIC_PROFILE");if(e)return e;let r=await Promise.resolve().then(()=>lc(Ge("node:fs"))),i=(await Promise.resolve().then(()=>lc(Ge("node:path")))).join(t,"active_config");try{return(await r.promises.readFile(i,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read ${i}: ${o}`);return"default"}}});var I7=v(Gi=>{"use strict";var Bje=Gi&&Gi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hje=Gi&&Gi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Gje=Gi&&Gi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i{let e=await Promise.resolve().then(()=>Gje(Ge("node:fs"))),r;try{r=await e.promises.readFile(t,"utf-8")}catch(i){throw new ZS.AnthropicError(`Failed to read identity token file at ${t}: ${i}`)}let n=r.trim();if(!n)throw new ZS.AnthropicError(`Identity token file at ${t} is empty`);return n}}function Vje(t){if(!t)throw new ZS.AnthropicError("Identity token value is empty");return()=>t}});var P7=v(X1=>{"use strict";Object.defineProperty(X1,"__esModule",{value:!0});X1.oidcFederationProvider=Jje;var dn=su(),Wje=am(),Kje=nm();function Jje(t){return async()=>{(0,dn.requireSecureTokenEndpoint)(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new dn.WorkloadIdentityError(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:dn.GRANT_TYPE_JWT_BEARER,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${dn.TOKEN_ENDPOINT}`,i;try{i=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${dn.OAUTH_API_BETA_HEADER},${dn.FEDERATION_BETA_HEADER}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${Kje.VERSION} oidcFederationProvider`},body:JSON.stringify(r)})}catch(c){throw new dn.WorkloadIdentityError(`Failed to reach token endpoint ${n}: ${c}`)}let o=i.headers.get("Request-Id");if(!i.ok){let c=await i.text().catch(()=>""),l=(0,dn.redactSensitive)(c),u="";throw i.status===401&&(u=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new dn.WorkloadIdentityError(`Token exchange failed with status ${i.status}${o?` (request-id ${o})`:""}: ${l}${u}`,i.status,l,o)}let s=await(0,dn.parseTokenResponse)(i,o),a=Number(s.expires_in);if(!Number.isFinite(a))throw new dn.WorkloadIdentityError(`Token endpoint response missing required fields: ${JSON.stringify((0,dn.redactSensitive)(s))}`,i.status,(0,dn.redactSensitive)(s),o);return{token:s.access_token,expiresAt:(0,Wje.nowAsSeconds)()+a}}}});var D7=v(Oo=>{"use strict";var Yje=Oo&&Oo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xje=Oo&&Oo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Qje=Oo&&Oo.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i{let r=await Promise.resolve().then(()=>Qje(Ge("node:fs")));await(0,Gt.checkCredentialsFileSafety)(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(g){throw new Gt.WorkloadIdentityError(`Credentials file not found at ${t.credentialsPath}: ${g}`)}let i;try{i=JSON.parse(n)}catch(g){throw new Gt.WorkloadIdentityError(`Credentials file at ${t.credentialsPath} is not valid JSON: ${g}`)}let o=i.access_token;if(!o)throw new Gt.WorkloadIdentityError(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let s=i.expires_at;if(!e?.forceRefresh&&(s==null||(0,C7.nowAsSeconds)()"");throw new Gt.WorkloadIdentityError(`User OAuth refresh failed (HTTP ${u.status}): ${(0,Gt.redactSensitive)(g)}`,u.status,(0,Gt.redactSensitive)(g),d)}let f=await(0,Gt.parseTokenResponse)(u,d),p=Number(f.expires_in);if(!Number.isFinite(p))throw new Gt.WorkloadIdentityError(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify((0,Gt.redactSensitive)(f))}`,u.status,(0,Gt.redactSensitive)(f),d);let m=(0,C7.nowAsSeconds)()+p,h=f.refresh_token||a;return await(0,Gt.writeCredentialsFileAtomic)(t.credentialsPath,{...i,version:eMe.CREDENTIALS_FILE_VERSION,type:"oauth_token",access_token:f.access_token,expires_at:m,refresh_token:h}),{token:f.access_token,expiresAt:m}}}});var M7=v(Vi=>{"use strict";var nMe=Vi&&Vi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),iMe=Vi&&Vi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),oMe=Vi&&Vi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i/credentials/.json)");return(0,cMe.userOAuthProvider)({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let i=t.authentication.type;throw new Zi.WorkloadIdentityError(`authentication.type "${i}" is not a known authentication type`)}}}function dMe(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Zi.WorkloadIdentityError(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Zi.WorkloadIdentityError('identity_token.source "file" requires a non-empty path');return(0,Q1.identityTokenFromFile)(t.identity_token.path)}let e=(0,N7.readEnv)("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return(0,Q1.identityTokenFromFile)(e);let r=(0,N7.readEnv)("ANTHROPIC_IDENTITY_TOKEN");return r?(0,Q1.identityTokenFromValue)(r):null}function fMe(t,e,r,n){return async i=>{let o=await Promise.resolve().then(()=>oMe(Ge("node:fs")));await(0,Zi.checkCredentialsFileSafety)(e,n);let s;try{let c=await o.promises.readFile(e,"utf-8");s=JSON.parse(c);let l=s?.access_token;if(l&&!i?.forceRefresh){let u=s?.expires_at;if(u==null||(0,sMe.nowAsSeconds)(){"use strict";var fn,pn;Object.defineProperty(fm,"__esModule",{value:!0});fm.LineDecoder=void 0;fm.findDoubleNewlineIndex=mMe;var $t=_t(),VS=BS(),dm=class{constructor(){fn.set(this,void 0),pn.set(this,void 0),$t.__classPrivateFieldSet(this,fn,new Uint8Array,"f"),$t.__classPrivateFieldSet(this,pn,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?(0,VS.encodeUTF8)(e):e;$t.__classPrivateFieldSet(this,fn,(0,VS.concatBytes)([$t.__classPrivateFieldGet(this,fn,"f"),r]),"f");let n=[],i;for(;(i=pMe($t.__classPrivateFieldGet(this,fn,"f"),$t.__classPrivateFieldGet(this,pn,"f")))!=null;){if(i.carriage&&$t.__classPrivateFieldGet(this,pn,"f")==null){$t.__classPrivateFieldSet(this,pn,i.index,"f");continue}if($t.__classPrivateFieldGet(this,pn,"f")!=null&&(i.index!==$t.__classPrivateFieldGet(this,pn,"f")+1||i.carriage)){n.push((0,VS.decodeUTF8)($t.__classPrivateFieldGet(this,fn,"f").subarray(0,$t.__classPrivateFieldGet(this,pn,"f")-1))),$t.__classPrivateFieldSet(this,fn,$t.__classPrivateFieldGet(this,fn,"f").subarray($t.__classPrivateFieldGet(this,pn,"f")),"f"),$t.__classPrivateFieldSet(this,pn,null,"f");continue}let o=$t.__classPrivateFieldGet(this,pn,"f")!==null?i.preceding-1:i.preceding,s=(0,VS.decodeUTF8)($t.__classPrivateFieldGet(this,fn,"f").subarray(0,o));n.push(s),$t.__classPrivateFieldSet(this,fn,$t.__classPrivateFieldGet(this,fn,"f").subarray(i.index),"f"),$t.__classPrivateFieldSet(this,pn,null,"f")}return n}flush(){return $t.__classPrivateFieldGet(this,fn,"f").length?this.decode(` `):[]}};fm.LineDecoder=dm;fn=new WeakMap,pn=new WeakMap;dm.NEWLINE_CHARS=new Set([` `,"\r"]);dm.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function pMe(t,e){for(let i=e??0;i{"use strict";var pm;Object.defineProperty(mm,"__esModule",{value:!0});mm.Stream=void 0;mm._iterSSEMessages=U7;var rD=_t(),WS=fr(),hMe=iu(),oD=tD(),L7=iu(),F7=ru(),gMe=Ui(),z7=BS(),yMe=um(),_Me=fr(),nD=class t{constructor(e,r,n){this.iterator=e,pm.set(this,void 0),this.controller=r,rD.__classPrivateFieldSet(this,pm,n,"f")}static fromSSEResponse(e,r,n){let i=!1,o=n?(0,yMe.loggerFor)(n):console;async function*s(){if(i)throw new WS.AnthropicError("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let a=!1;try{for await(let c of U7(e,r)){if(c.event==="completion")try{yield JSON.parse(c.data)}catch(l){throw o.error("Could not parse message into JSON:",c.data),o.error("From chunk:",c.raw),l}if(c.event==="message_start"||c.event==="message_delta"||c.event==="message_stop"||c.event==="content_block_start"||c.event==="content_block_delta"||c.event==="content_block_stop"||c.event==="message"||c.event==="user.message"||c.event==="user.interrupt"||c.event==="user.tool_confirmation"||c.event==="user.custom_tool_result"||c.event==="agent.message"||c.event==="agent.thinking"||c.event==="agent.tool_use"||c.event==="agent.tool_result"||c.event==="agent.mcp_tool_use"||c.event==="agent.mcp_tool_result"||c.event==="agent.custom_tool_use"||c.event==="agent.thread_context_compacted"||c.event==="session.status_running"||c.event==="session.status_idle"||c.event==="session.status_rescheduled"||c.event==="session.status_terminated"||c.event==="session.error"||c.event==="session.deleted"||c.event==="span.model_request_start"||c.event==="span.model_request_end"||c.event==="span.outcome_evaluation_start"||c.event==="span.outcome_evaluation_ongoing"||c.event==="span.outcome_evaluation_end"||c.event==="user.define_outcome"||c.event==="agent.thread_message_received"||c.event==="agent.thread_message_sent"||c.event==="agent.session_thread_message_received"||c.event==="agent.session_thread_message_sent"||c.event==="session.thread_created"||c.event==="session.thread_status_created"||c.event==="session.thread_status_running"||c.event==="session.thread_status_idle"||c.event==="session.thread_status_rescheduled"||c.event==="session.thread_status_terminated")try{yield JSON.parse(c.data)}catch(l){throw o.error("Could not parse message into JSON:",c.data),o.error("From chunk:",c.raw),l}if(c.event!=="ping"&&c.event==="error"){let l=(0,gMe.safeJSON)(c.data)??c.data,u=l?.error?.type;throw new _Me.APIError(void 0,l,void 0,e.headers,u)}}a=!0}catch(c){if((0,F7.isAbortError)(c))return;throw c}finally{a||r.abort()}}return new t(s,r,n)}static fromReadableStream(e,r,n){let i=!1;async function*o(){let a=new oD.LineDecoder,c=(0,L7.ReadableStreamToAsyncIterable)(e);for await(let l of c)for(let u of a.decode(l))yield u;for(let l of a.flush())yield l}async function*s(){if(i)throw new WS.AnthropicError("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let a=!1;try{for await(let c of o())a||c&&(yield JSON.parse(c));a=!0}catch(c){if((0,F7.isAbortError)(c))return;throw c}finally{a||r.abort()}}return new t(s,r,n)}[(pm=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),i=o=>({next:()=>{if(o.length===0){let s=n.next();e.push(s),r.push(s)}return o.shift()}});return[new t(()=>i(e),this.controller,rD.__classPrivateFieldGet(this,pm,"f")),new t(()=>i(r),this.controller,rD.__classPrivateFieldGet(this,pm,"f"))]}toReadableStream(){let e=this,r;return(0,hMe.makeReadableStream)({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:i,done:o}=await r.next();if(o)return n.close();let s=(0,z7.encodeUTF8)(JSON.stringify(i)+` `);n.enqueue(s)}catch(i){n.error(i)}},async cancel(){await r.return?.()}})}};mm.Stream=nD;async function*U7(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new WS.AnthropicError("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new WS.AnthropicError("Attempted to iterate over a response with no body");let r=new iD,n=new oD.LineDecoder,i=(0,L7.ReadableStreamToAsyncIterable)(t.body);for await(let o of bMe(i))for(let s of n.decode(o)){let a=r.decode(s);a&&(yield a)}for(let o of n.flush()){let s=r.decode(o);s&&(yield s)}}async function*bMe(t){let e=new Uint8Array;for await(let r of t){if(r==null)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):typeof r=="string"?(0,z7.encodeUTF8)(r):r,i=new Uint8Array(e.length+n.length);i.set(e),i.set(n,e.length),e=i;let o;for(;(o=(0,oD.findDoubleNewlineIndex)(e))!==-1;)yield e.slice(0,o),e=e.slice(o)}e.length>0&&(yield e)}var iD=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(` @@ -314,7 +314,7 @@ ${s}`:o||s}function LC(t,{maxDepth:e=1e3,numbersAsFloat:r=!1}={}){if(Up(t)!=="ob ${o.map(f=>f.error).join(` `)} ${s} -${d}`)}return s};xs.createPathTagFunction=BMe;xs.path=(0,xs.createPathTagFunction)(SD)});var xD=v(ow=>{"use strict";Object.defineProperty(ow,"__esModule",{value:!0});ow.Environments=void 0;var HMe=ot(),GMe=gt(),du=st(),iw=kt(),wD=class extends HMe.APIResource{create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/environments?beta=true",{body:i,...r,headers:(0,du.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,iw.path)`/v1/environments/${e}?beta=true`,{...n,headers:(0,du.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,iw.path)`/v1/environments/${e}?beta=true`,{body:o,...n,headers:(0,du.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/environments?beta=true",GMe.PageCursor,{query:i,...r,headers:(0,du.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,iw.path)`/v1/environments/${e}?beta=true`,{...n,headers:(0,du.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:i}=r??{};return this._client.post((0,iw.path)`/v1/environments/${e}/archive?beta=true`,{...n,headers:(0,du.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};ow.Environments=wD});var _m=v(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.SDK_HELPER_SYMBOL=void 0;mn.wasCreatedByStainlessHelper=ym;mn.collectStainlessHelpers=tQ;mn.stainlessHelperHeader=ZMe;mn.stainlessHelperHeaderFromFile=VMe;mn.SDK_HELPER_SYMBOL=Symbol("anthropic.sdk.stainlessHelper");function ym(t){return typeof t=="object"&&t!==null&&mn.SDK_HELPER_SYMBOL in t}function tQ(t,e){let r=new Set;if(t)for(let n of t)ym(n)&&r.add(n[mn.SDK_HELPER_SYMBOL]);if(e){for(let n of e)if(ym(n)&&r.add(n[mn.SDK_HELPER_SYMBOL]),Array.isArray(n.content))for(let i of n.content)ym(i)&&r.add(i[mn.SDK_HELPER_SYMBOL])}return Array.from(r)}function ZMe(t,e){let r=tQ(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function VMe(t){return ym(t)?{"x-stainless-helper":t[mn.SDK_HELPER_SYMBOL]}:{}}});var ED=v(sw=>{"use strict";Object.defineProperty(sw,"__esModule",{value:!0});sw.Files=void 0;var WMe=ot(),KMe=gt(),bm=st(),JMe=_m(),YMe=lu(),$D=kt(),kD=class extends WMe.APIResource{list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/files?beta=true",KMe.Page,{query:i,...r,headers:(0,bm.buildHeaders)([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,$D.path)`/v1/files/${e}?beta=true`,{...n,headers:(0,bm.buildHeaders)([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:i}=r??{};return this._client.get((0,$D.path)`/v1/files/${e}/content?beta=true`,{...n,headers:(0,bm.buildHeaders)([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:i}=r??{};return this._client.get((0,$D.path)`/v1/files/${e}?beta=true`,{...n,headers:(0,bm.buildHeaders)([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...i}=e;return this._client.post("/v1/files?beta=true",(0,YMe.multipartFormRequestOptions)({body:i,...r,headers:(0,bm.buildHeaders)([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},(0,JMe.stainlessHelperHeaderFromFile)(i.file),r?.headers])},this._client))}};sw.Files=kD});var TD=v(aw=>{"use strict";Object.defineProperty(aw,"__esModule",{value:!0});aw.Models=void 0;var XMe=ot(),QMe=gt(),rQ=st(),eFe=kt(),AD=class extends XMe.APIResource{retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,eFe.path)`/v1/models/${e}?beta=true`,{...n,headers:(0,rQ.buildHeaders)([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/models?beta=true",QMe.Page,{query:i,...r,headers:(0,rQ.buildHeaders)([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}};aw.Models=AD});var ID=v(cw=>{"use strict";Object.defineProperty(cw,"__esModule",{value:!0});cw.UserProfiles=void 0;var tFe=ot(),rFe=gt(),vm=st(),OD=kt(),RD=class extends tFe.APIResource{create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/user_profiles?beta=true",{body:i,...r,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,OD.path)`/v1/user_profiles/${e}?beta=true`,{...n,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,OD.path)`/v1/user_profiles/${e}?beta=true`,{body:o,...n,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",rFe.PageCursor,{query:i,...r,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:i}=r??{};return this._client.post((0,OD.path)`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}};cw.UserProfiles=RD});var iQ=v(lw=>{"use strict";Object.defineProperty(lw,"__esModule",{value:!0});lw.timingSafeEqual=void 0;function nQ(t,e=""){if(!t)throw new Error(e)}function nFe(t,e){if(t.byteLength!==e.byteLength)return!1;t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),nQ(t instanceof DataView),nQ(e instanceof DataView);let r=t.byteLength,n=0,i=-1;for(;++i{"use strict";var iFe=hn&&hn.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(hn,"__esModule",{value:!0});var jt=256,PD=(function(){function t(e){e===void 0&&(e="="),this._paddingCharacter=e}return t.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},t.prototype.encode=function(e){for(var r="",n=0;n>>18&63),r+=this._encodeByte(i>>>12&63),r+=this._encodeByte(i>>>6&63),r+=this._encodeByte(i>>>0&63)}var o=e.length-n;if(o>0){var i=e[n]<<16|(o===2?e[n+1]<<8:0);r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),o===2?r+=this._encodeByte(i>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},t.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},t.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},t.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(e),n=e.length-r,i=new Uint8Array(this.maxDecodedLength(n)),o=0,s=0,a=0,c=0,l=0,u=0,d=0;s>>4,i[o++]=l<<4|u>>>2,i[o++]=u<<6|d,a|=c&jt,a|=l&jt,a|=u&jt,a|=d&jt;if(s>>4,a|=c&jt,a|=l&jt),s>>2,a|=u&jt),s>>8&6,r+=51-e>>>8&-75,r+=61-e>>>8&-15,r+=62-e>>>8&3,String.fromCharCode(r)},t.prototype._decodeChar=function(e){var r=jt;return r+=(42-e&e-44)>>>8&-jt+e-43+62,r+=(46-e&e-48)>>>8&-jt+e-47+63,r+=(47-e&e-58)>>>8&-jt+e-48+52,r+=(64-e&e-91)>>>8&-jt+e-65+0,r+=(96-e&e-123)>>>8&-jt+e-97+26,r},t.prototype._getPaddingLength=function(e){var r=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)r++;if(e.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},t})();hn.Coder=PD;var Sm=new PD;function oFe(t){return Sm.encode(t)}hn.encode=oFe;function sFe(t){return Sm.decode(t)}hn.decode=sFe;var oQ=(function(t){iFe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},e.prototype._decodeChar=function(r){var n=jt;return n+=(44-r&r-46)>>>8&-jt+r-45+62,n+=(94-r&r-96)>>>8&-jt+r-95+63,n+=(47-r&r-58)>>>8&-jt+r-48+52,n+=(64-r&r-91)>>>8&-jt+r-65+0,n+=(96-r&r-123)>>>8&-jt+r-97+26,n},e})(PD);hn.URLSafeCoder=oQ;var sQ=new oQ;function aFe(t){return sQ.encode(t)}hn.encodeURLSafe=aFe;function cFe(t){return sQ.decode(t)}hn.decodeURLSafe=cFe;hn.encodedLength=function(t){return Sm.encodedLength(t)};hn.maxDecodedLength=function(t){return Sm.maxDecodedLength(t)};hn.decodedLength=function(t){return Sm.decodedLength(t)}});var lQ=v((cQ,uw)=>{(function(t,e){var r={};e(r);var n=r.default;for(var i in r)n[i]=r[i];typeof uw=="object"&&typeof uw.exports=="object"?uw.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(cQ,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(d,f,p,m,h){for(var g,b,_,S,x,w,O,T,A,D,$,ie,K;h>=64;){for(g=f[0],b=f[1],_=f[2],S=f[3],x=f[4],w=f[5],O=f[6],T=f[7],D=0;D<16;D++)$=m+D*4,d[D]=(p[$]&255)<<24|(p[$+1]&255)<<16|(p[$+2]&255)<<8|p[$+3]&255;for(D=16;D<64;D++)A=d[D-2],ie=(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10,A=d[D-15],K=(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3,d[D]=(ie+d[D-7]|0)+(K+d[D-16]|0);for(D=0;D<64;D++)ie=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&w^~x&O)|0)+(T+(e[D]+d[D]|0)|0)|0,K=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&b^g&_^b&_)|0,T=O,O=w,w=x,x=S+ie|0,S=_,_=b,b=g,g=ie+K|0;f[0]+=g,f[1]+=b,f[2]+=_,f[3]+=S,f[4]+=x,f[5]+=w,f[6]+=O,f[7]+=T,m+=64,h-=64}return m}var n=(function(){function d(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var f=0;f0){for(;this.bufferLength<64&&p>0;)this.buffer[this.bufferLength++]=f[m++],p--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(p>=64&&(m=r(this.temp,this.state,f,m,p),p%=64);p>0;)this.buffer[this.bufferLength++]=f[m++],p--;return this},d.prototype.finish=function(f){if(!this.finished){var p=this.bytesHashed,m=this.bufferLength,h=p/536870912|0,g=p<<3,b=p%64<56?64:128;this.buffer[m]=128;for(var _=m+1;_>>24&255,this.buffer[b-7]=h>>>16&255,this.buffer[b-6]=h>>>8&255,this.buffer[b-5]=h>>>0&255,this.buffer[b-4]=g>>>24&255,this.buffer[b-3]=g>>>16&255,this.buffer[b-2]=g>>>8&255,this.buffer[b-1]=g>>>0&255,r(this.temp,this.state,this.buffer,0,b),this.finished=!0}for(var _=0;_<8;_++)f[_*4+0]=this.state[_]>>>24&255,f[_*4+1]=this.state[_]>>>16&255,f[_*4+2]=this.state[_]>>>8&255,f[_*4+3]=this.state[_]>>>0&255;return this},d.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},d.prototype._saveState=function(f){for(var p=0;pthis.blockSize)new n().update(f).finish(p).clean();else for(var m=0;m1&&f.update(d),p&&f.update(p),f.update(m),f.finish(d),m[0]++}var c=new Uint8Array(t.digestLength);function l(d,f,p,m){f===void 0&&(f=c),m===void 0&&(m=32);for(var h=new Uint8Array([1]),g=s(f,d),b=new i(g),_=new Uint8Array(b.digestLength),S=_.length,x=new Uint8Array(m),w=0;w>>24&255,b[1]=O>>>16&255,b[2]=O>>>8&255,b[3]=O>>>0&255,h.reset(),h.update(f),h.update(b),h.finish(S);for(var T=0;T{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.Webhook=fu.WebhookVerificationError=void 0;var lFe=iQ(),uQ=aQ(),uFe=lQ(),dQ=300,CD=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},$s=class t extends CD{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};fu.WebhookVerificationError=$s;var dw=class t{constructor(e,r){if(!e)throw new Error("Secret can't be empty.");if(r?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,n=>n.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(t.prefix)&&(e=e.substring(t.prefix.length)),this.key=uQ.decode(e)}}verify(e,r){let n={};for(let f of Object.keys(r))n[f.toLowerCase()]=r[f];let i=n["webhook-id"],o=n["webhook-signature"],s=n["webhook-timestamp"];if(!o||!i||!s)throw new $s("Missing required headers");let a=this.verifyTimestamp(s),l=this.sign(i,a,e).split(",")[1],u=o.split(" "),d=new globalThis.TextEncoder;for(let f of u){let[p,m]=f.split(",");if(p==="v1"&&(0,lFe.timingSafeEqual)(d.encode(m),d.encode(l)))return JSON.parse(e.toString())}throw new $s("No matching signature found")}sign(e,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,o=Math.floor(r.getTime()/1e3),s=i.encode(`${e}.${o}.${n}`);return`v1,${uQ.encode(uFe.hmac(this.key,s))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new $s("Invalid Signature Headers");if(r-n>dQ)throw new $s("Message timestamp too old");if(n>r+dQ)throw new $s("Message timestamp too new");return new Date(n*1e3)}};fu.Webhook=dw;dw.prefix="whsec_"});var ND=v(fw=>{"use strict";Object.defineProperty(fw,"__esModule",{value:!0});fw.Webhooks=void 0;var dFe=ot(),fFe=fQ(),DD=class extends dFe.APIResource{unwrap(e,{headers:r,key:n}){if(r!==void 0){let i=n===void 0?this._client.webhookKey:n;if(i===null)throw new Error("Webhook key must not be null in order to unwrap");new fFe.Webhook(i).verify(e,r)}return JSON.parse(e)}};fw.Webhooks=DD});var MD=v(pw=>{"use strict";Object.defineProperty(pw,"__esModule",{value:!0});pw.Versions=void 0;var pFe=ot(),mFe=gt(),hFe=st(),gFe=kt(),jD=class extends pFe.APIResource{list(e,r={},n){let{betas:i,...o}=r??{};return this._client.getAPIList((0,gFe.path)`/v1/agents/${e}/versions?beta=true`,mFe.PageCursor,{query:o,...n,headers:(0,hFe.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};pw.Versions=jD});var LD=v(hw=>{"use strict";Object.defineProperty(hw,"__esModule",{value:!0});hw.Agents=void 0;var yFe=_t(),_Fe=ot(),bFe=yFe.__importStar(MD()),vFe=MD(),SFe=gt(),wm=st(),FD=kt(),mw=class extends _Fe.APIResource{constructor(){super(...arguments),this.versions=new bFe.Versions(this._client)}create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/agents?beta=true",{body:i,...r,headers:(0,wm.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i,...o}=r??{};return this._client.get((0,FD.path)`/v1/agents/${e}?beta=true`,{query:o,...n,headers:(0,wm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,FD.path)`/v1/agents/${e}?beta=true`,{body:o,...n,headers:(0,wm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/agents?beta=true",SFe.PageCursor,{query:i,...r,headers:(0,wm.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:i}=r??{};return this._client.post((0,FD.path)`/v1/agents/${e}/archive?beta=true`,{...n,headers:(0,wm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};hw.Agents=mw;mw.Versions=vFe.Versions});var UD=v(gw=>{"use strict";Object.defineProperty(gw,"__esModule",{value:!0});gw.Memories=void 0;var wFe=ot(),xFe=gt(),xm=st(),$m=kt(),zD=class extends wFe.APIResource{create(e,r,n){let{view:i,betas:o,...s}=r;return this._client.post((0,$m.path)`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:i},body:s,...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:i,betas:o,...s}=r;return this._client.get((0,$m.path)`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:s,...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:i,view:o,betas:s,...a}=r;return this._client.post((0,$m.path)`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:{view:o},body:a,...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:i,...o}=r??{};return this._client.getAPIList((0,$m.path)`/v1/memory_stores/${e}/memories?beta=true`,xFe.PageCursor,{query:o,...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:i,expected_content_sha256:o,betas:s}=r;return this._client.delete((0,$m.path)`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:{expected_content_sha256:o},...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};gw.Memories=zD});var GD=v(yw=>{"use strict";Object.defineProperty(yw,"__esModule",{value:!0});yw.MemoryVersions=void 0;var $Fe=ot(),kFe=gt(),qD=st(),BD=kt(),HD=class extends $Fe.APIResource{retrieve(e,r,n){let{memory_store_id:i,betas:o,...s}=r;return this._client.get((0,BD.path)`/v1/memory_stores/${i}/memory_versions/${e}?beta=true`,{query:s,...n,headers:(0,qD.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:i,...o}=r??{};return this._client.getAPIList((0,BD.path)`/v1/memory_stores/${e}/memory_versions?beta=true`,kFe.PageCursor,{query:o,...n,headers:(0,qD.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:i,betas:o}=r;return this._client.post((0,BD.path)`/v1/memory_stores/${i}/memory_versions/${e}/redact?beta=true`,{...n,headers:(0,qD.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};yw.MemoryVersions=HD});var ZD=v(bw=>{"use strict";Object.defineProperty(bw,"__esModule",{value:!0});bw.MemoryStores=void 0;var pQ=_t(),EFe=ot(),AFe=pQ.__importStar(UD()),TFe=UD(),OFe=pQ.__importStar(GD()),RFe=GD(),IFe=gt(),pu=st(),_w=kt(),km=class extends EFe.APIResource{constructor(){super(...arguments),this.memories=new AFe.Memories(this._client),this.memoryVersions=new OFe.MemoryVersions(this._client)}create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/memory_stores?beta=true",{body:i,...r,headers:(0,pu.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,_w.path)`/v1/memory_stores/${e}?beta=true`,{...n,headers:(0,pu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,_w.path)`/v1/memory_stores/${e}?beta=true`,{body:o,...n,headers:(0,pu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",IFe.PageCursor,{query:i,...r,headers:(0,pu.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,_w.path)`/v1/memory_stores/${e}?beta=true`,{...n,headers:(0,pu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:i}=r??{};return this._client.post((0,_w.path)`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:(0,pu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};bw.MemoryStores=km;km.Memories=TFe.Memories;km.MemoryVersions=RFe.MemoryVersions});var mu=v(VD=>{"use strict";Object.defineProperty(VD,"__esModule",{value:!0});var PFe=_t();PFe.__exportStar(fr(),VD)});var KD=v(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0});vw.JSONLDecoder=void 0;var mQ=fr(),CFe=iu(),DFe=tD(),WD=class t{constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new DFe.LineDecoder;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new mQ.AnthropicError("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new mQ.AnthropicError("Attempted to iterate over a response with no body");return new t((0,CFe.ReadableStreamToAsyncIterable)(e.body),r)}};vw.JSONLDecoder=WD});var XD=v(Sw=>{"use strict";Object.defineProperty(Sw,"__esModule",{value:!0});Sw.Batches=void 0;var NFe=ot(),jFe=gt(),hu=st(),MFe=KD(),FFe=mu(),JD=kt(),YD=class extends NFe.APIResource{create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/messages/batches?beta=true",{body:i,...r,headers:(0,hu.buildHeaders)([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,JD.path)`/v1/messages/batches/${e}?beta=true`,{...n,headers:(0,hu.buildHeaders)([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",jFe.Page,{query:i,...r,headers:(0,hu.buildHeaders)([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,JD.path)`/v1/messages/batches/${e}?beta=true`,{...n,headers:(0,hu.buildHeaders)([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:i}=r??{};return this._client.post((0,JD.path)`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:(0,hu.buildHeaders)([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let i=await this.retrieve(e);if(!i.results_url)throw new FFe.AnthropicError(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{betas:o}=r??{};return this._client.get(i.results_url,{...n,headers:(0,hu.buildHeaders)([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,a)=>MFe.JSONLDecoder.fromResponse(a.response,a.controller))}};Sw.Batches=YD});var QD=v(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});ww.MODEL_NONSTREAMING_TOKENS=void 0;ww.MODEL_NONSTREAMING_TOKENS={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});var eN=v(xw=>{"use strict";Object.defineProperty(xw,"__esModule",{value:!0});xw.maybeParseBetaMessage=zFe;xw.parseBetaMessage=gQ;var LFe=fr();function hQ(t){return t?.output_format??t?.output_config?.format}function zFe(t,e,r){let n=hQ(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(i=>{if(i.type==="text"){let o=Object.defineProperty({...i},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return i}),parsed_output:null}:gQ(t,e,r)}function gQ(t,e,r){let n=null,i=t.content.map(o=>{if(o.type==="text"){let s=UFe(e,o.text);n===null&&(n=s);let a=Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),s},enumerable:!1})}return o});return{...t,content:i,parsed_output:n}}function UFe(t,e){let r=hQ(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new LFe.AnthropicError(`Failed to parse structured output: ${n}`)}}});var tN=v($w=>{"use strict";Object.defineProperty($w,"__esModule",{value:!0});$w.partialParse=void 0;var qFe=t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),gu(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),gu(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),gu(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),gu(t);break;case"delimiter":return t=t.slice(0,t.length-1),gu(t);break}return t},BFe=t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},HFe=t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},GFe=t=>JSON.parse(HFe(BFe(gu(qFe(t)))));$w.partialParse=GFe});var nN=v(rN=>{"use strict";Object.defineProperty(rN,"__esModule",{value:!0});var ZFe=_t();ZFe.__exportStar(sD(),rN)});var xQ=v(Pw=>{"use strict";var Dn,ks,yu,Em,kw,Am,Tm,Ew,Om,Ro,Rm,Aw,Tw,uc,Ow,Rw,Im,iN,yQ,Iw,oN,sN,aN,_Q;Object.defineProperty(Pw,"__esModule",{value:!0});Pw.BetaMessageStream=void 0;var X=_t(),VFe=tN(),xr=mu(),WFe=ru(),bQ=nN(),vQ=eN(),SQ="__json_buf";function wQ(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var cN=class t{constructor(e,r){Dn.add(this),this.messages=[],this.receivedMessages=[],ks.set(this,void 0),yu.set(this,null),this.controller=new AbortController,Em.set(this,void 0),kw.set(this,()=>{}),Am.set(this,()=>{}),Tm.set(this,void 0),Ew.set(this,()=>{}),Om.set(this,()=>{}),Ro.set(this,{}),Rm.set(this,!1),Aw.set(this,!1),Tw.set(this,!1),uc.set(this,!1),Ow.set(this,void 0),Rw.set(this,void 0),Im.set(this,void 0),Iw.set(this,n=>{if(X.__classPrivateFieldSet(this,Aw,!0,"f"),(0,WFe.isAbortError)(n)&&(n=new xr.APIUserAbortError),n instanceof xr.APIUserAbortError)return X.__classPrivateFieldSet(this,Tw,!0,"f"),this._emit("abort",n);if(n instanceof xr.AnthropicError)return this._emit("error",n);if(n instanceof Error){let i=new xr.AnthropicError(n.message);return i.cause=n,this._emit("error",i)}return this._emit("error",new xr.AnthropicError(String(n)))}),X.__classPrivateFieldSet(this,Em,new Promise((n,i)=>{X.__classPrivateFieldSet(this,kw,n,"f"),X.__classPrivateFieldSet(this,Am,i,"f")}),"f"),X.__classPrivateFieldSet(this,Tm,new Promise((n,i)=>{X.__classPrivateFieldSet(this,Ew,n,"f"),X.__classPrivateFieldSet(this,Om,i,"f")}),"f"),X.__classPrivateFieldGet(this,Em,"f").catch(()=>{}),X.__classPrivateFieldGet(this,Tm,"f").catch(()=>{}),X.__classPrivateFieldSet(this,yu,e,"f"),X.__classPrivateFieldSet(this,Im,r?.logger??console,"f")}get response(){return X.__classPrivateFieldGet(this,Ow,"f")}get request_id(){return X.__classPrivateFieldGet(this,Rw,"f")}async withResponse(){X.__classPrivateFieldSet(this,uc,!0,"f");let e=await X.__classPrivateFieldGet(this,Em,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:i}={}){let o=new t(r,{logger:i});for(let s of r.messages)o._addMessageParam(s);return X.__classPrivateFieldSet(o,yu,{...r,stream:!0},"f"),o._run(()=>o._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),o}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},X.__classPrivateFieldGet(this,Iw,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let i=n?.signal,o;i&&(i.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),i.addEventListener("abort",o));try{X.__classPrivateFieldGet(this,Dn,"m",oN).call(this);let{response:s,data:a}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(s);for await(let c of a)X.__classPrivateFieldGet(this,Dn,"m",sN).call(this,c);if(a.controller.signal?.aborted)throw new xr.APIUserAbortError;X.__classPrivateFieldGet(this,Dn,"m",aN).call(this)}finally{i&&o&&i.removeEventListener("abort",o)}}_connected(e){this.ended||(X.__classPrivateFieldSet(this,Ow,e,"f"),X.__classPrivateFieldSet(this,Rw,e?.headers.get("request-id"),"f"),X.__classPrivateFieldGet(this,kw,"f").call(this,e),this._emit("connect"))}get ended(){return X.__classPrivateFieldGet(this,Rm,"f")}get errored(){return X.__classPrivateFieldGet(this,Aw,"f")}get aborted(){return X.__classPrivateFieldGet(this,Tw,"f")}abort(){this.controller.abort()}on(e,r){return(X.__classPrivateFieldGet(this,Ro,"f")[e]||(X.__classPrivateFieldGet(this,Ro,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=X.__classPrivateFieldGet(this,Ro,"f")[e];if(!n)return this;let i=n.findIndex(o=>o.listener===r);return i>=0&&n.splice(i,1),this}once(e,r){return(X.__classPrivateFieldGet(this,Ro,"f")[e]||(X.__classPrivateFieldGet(this,Ro,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{X.__classPrivateFieldSet(this,uc,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){X.__classPrivateFieldSet(this,uc,!0,"f"),await X.__classPrivateFieldGet(this,Tm,"f")}get currentMessage(){return X.__classPrivateFieldGet(this,ks,"f")}async finalMessage(){return await this.done(),X.__classPrivateFieldGet(this,Dn,"m",iN).call(this)}async finalText(){return await this.done(),X.__classPrivateFieldGet(this,Dn,"m",yQ).call(this)}_emit(e,...r){if(X.__classPrivateFieldGet(this,Rm,"f"))return;e==="end"&&(X.__classPrivateFieldSet(this,Rm,!0,"f"),X.__classPrivateFieldGet(this,Ew,"f").call(this));let n=X.__classPrivateFieldGet(this,Ro,"f")[e];if(n&&(X.__classPrivateFieldGet(this,Ro,"f")[e]=n.filter(i=>!i.once),n.forEach(({listener:i})=>i(...r))),e==="abort"){let i=r[0];!X.__classPrivateFieldGet(this,uc,"f")&&!n?.length&&Promise.reject(i),X.__classPrivateFieldGet(this,Am,"f").call(this,i),X.__classPrivateFieldGet(this,Om,"f").call(this,i),this._emit("end");return}if(e==="error"){let i=r[0];!X.__classPrivateFieldGet(this,uc,"f")&&!n?.length&&Promise.reject(i),X.__classPrivateFieldGet(this,Am,"f").call(this,i),X.__classPrivateFieldGet(this,Om,"f").call(this,i),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",X.__classPrivateFieldGet(this,Dn,"m",iN).call(this))}async _fromReadableStream(e,r){let n=r?.signal,i;n&&(n.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),n.addEventListener("abort",i));try{X.__classPrivateFieldGet(this,Dn,"m",oN).call(this),this._connected(null);let o=bQ.Stream.fromReadableStream(e,this.controller);for await(let s of o)X.__classPrivateFieldGet(this,Dn,"m",sN).call(this,s);if(o.controller.signal?.aborted)throw new xr.APIUserAbortError;X.__classPrivateFieldGet(this,Dn,"m",aN).call(this)}finally{n&&i&&n.removeEventListener("abort",i)}}[(ks=new WeakMap,yu=new WeakMap,Em=new WeakMap,kw=new WeakMap,Am=new WeakMap,Tm=new WeakMap,Ew=new WeakMap,Om=new WeakMap,Ro=new WeakMap,Rm=new WeakMap,Aw=new WeakMap,Tw=new WeakMap,uc=new WeakMap,Ow=new WeakMap,Rw=new WeakMap,Im=new WeakMap,Iw=new WeakMap,Dn=new WeakSet,iN=function(){if(this.receivedMessages.length===0)throw new xr.AnthropicError("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},yQ=function(){if(this.receivedMessages.length===0)throw new xr.AnthropicError("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new xr.AnthropicError("stream ended without producing a content block with type=text");return r.join(" ")},oN=function(){this.ended||X.__classPrivateFieldSet(this,ks,void 0,"f")},sN=function(r){if(this.ended)return;let n=X.__classPrivateFieldGet(this,Dn,"m",_Q).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let i=n.content.at(-1);switch(r.delta.type){case"text_delta":{i.type==="text"&&this._emit("text",r.delta.text,i.text||"");break}case"citations_delta":{i.type==="text"&&this._emit("citation",r.delta.citation,i.citations??[]);break}case"input_json_delta":{wQ(i)&&i.input&&this._emit("inputJson",r.delta.partial_json,i.input);break}case"thinking_delta":{i.type==="thinking"&&this._emit("thinking",r.delta.thinking,i.thinking);break}case"signature_delta":{i.type==="thinking"&&this._emit("signature",i.signature);break}case"compaction_delta":{i.type==="compaction"&&i.content&&this._emit("compaction",i.content);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage((0,vQ.maybeParseBetaMessage)(n,X.__classPrivateFieldGet(this,yu,"f"),{logger:X.__classPrivateFieldGet(this,Im,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{X.__classPrivateFieldSet(this,ks,n,"f");break}case"content_block_start":case"message_delta":break}},aN=function(){if(this.ended)throw new xr.AnthropicError("stream has ended, this shouldn't happen");let r=X.__classPrivateFieldGet(this,ks,"f");if(!r)throw new xr.AnthropicError("request ended without sending any chunks");return X.__classPrivateFieldSet(this,ks,void 0,"f"),(0,vQ.maybeParseBetaMessage)(r,X.__classPrivateFieldGet(this,yu,"f"),{logger:X.__classPrivateFieldGet(this,Im,"f")})},_Q=function(r){let n=X.__classPrivateFieldGet(this,ks,"f");if(r.type==="message_start"){if(n)throw new xr.AnthropicError(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new xr.AnthropicError(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.container=r.delta.container,n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,n.context_management=r.context_management,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),r.usage.iterations!=null&&(n.usage.iterations=r.usage.iterations),n;case"content_block_start":return n.content.push(r.content_block),n;case"content_block_delta":{let i=n.content.at(r.index);switch(r.delta.type){case"text_delta":{i?.type==="text"&&(n.content[r.index]={...i,text:(i.text||"")+r.delta.text});break}case"citations_delta":{i?.type==="text"&&(n.content[r.index]={...i,citations:[...i.citations??[],r.delta.citation]});break}case"input_json_delta":{if(i&&wQ(i)){let o=i[SQ]||"";o+=r.delta.partial_json;let s={...i};if(Object.defineProperty(s,SQ,{value:o,enumerable:!1,writable:!0}),o)try{s.input=(0,VFe.partialParse)(o)}catch(a){let c=new xr.AnthropicError(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${a}. JSON: ${o}`);X.__classPrivateFieldGet(this,Iw,"f").call(this,c)}n.content[r.index]=s}break}case"thinking_delta":{i?.type==="thinking"&&(n.content[r.index]={...i,thinking:i.thinking+r.delta.thinking});break}case"signature_delta":{i?.type==="thinking"&&(n.content[r.index]={...i,signature:r.delta.signature});break}case"compaction_delta":{i?.type==="compaction"&&(n.content[r.index]={...i,content:(i.content||"")+r.delta.content});break}default:r.delta}return n}case"content_block_stop":return n}},Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",i=>{let o=r.shift();o?o.resolve(i):e.push(i)}),this.on("end",()=>{n=!0;for(let i of r)i.resolve(void 0);r.length=0}),this.on("abort",i=>{n=!0;for(let o of r)o.reject(i);r.length=0}),this.on("error",i=>{n=!0;for(let o of r)o.reject(i);r.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new bQ.Stream(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}};Pw.BetaMessageStream=cN});var Dw=v(Cw=>{"use strict";Object.defineProperty(Cw,"__esModule",{value:!0});Cw.ToolError=void 0;var lN=class extends Error{constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}};Cw.ToolError=lN});var $Q=v(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.DEFAULT_SUMMARY_PROMPT=_u.DEFAULT_TOKEN_THRESHOLD=void 0;_u.DEFAULT_TOKEN_THRESHOLD=1e5;_u.DEFAULT_SUMMARY_PROMPT=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: +${d}`)}return s};xs.createPathTagFunction=BMe;xs.path=(0,xs.createPathTagFunction)(SD)});var xD=v(ow=>{"use strict";Object.defineProperty(ow,"__esModule",{value:!0});ow.Environments=void 0;var HMe=ot(),GMe=gt(),du=st(),iw=kt(),wD=class extends HMe.APIResource{create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/environments?beta=true",{body:i,...r,headers:(0,du.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,iw.path)`/v1/environments/${e}?beta=true`,{...n,headers:(0,du.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,iw.path)`/v1/environments/${e}?beta=true`,{body:o,...n,headers:(0,du.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/environments?beta=true",GMe.PageCursor,{query:i,...r,headers:(0,du.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,iw.path)`/v1/environments/${e}?beta=true`,{...n,headers:(0,du.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:i}=r??{};return this._client.post((0,iw.path)`/v1/environments/${e}/archive?beta=true`,{...n,headers:(0,du.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};ow.Environments=wD});var _m=v(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.SDK_HELPER_SYMBOL=void 0;mn.wasCreatedByStainlessHelper=ym;mn.collectStainlessHelpers=tQ;mn.stainlessHelperHeader=ZMe;mn.stainlessHelperHeaderFromFile=VMe;mn.SDK_HELPER_SYMBOL=Symbol("anthropic.sdk.stainlessHelper");function ym(t){return typeof t=="object"&&t!==null&&mn.SDK_HELPER_SYMBOL in t}function tQ(t,e){let r=new Set;if(t)for(let n of t)ym(n)&&r.add(n[mn.SDK_HELPER_SYMBOL]);if(e){for(let n of e)if(ym(n)&&r.add(n[mn.SDK_HELPER_SYMBOL]),Array.isArray(n.content))for(let i of n.content)ym(i)&&r.add(i[mn.SDK_HELPER_SYMBOL])}return Array.from(r)}function ZMe(t,e){let r=tQ(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function VMe(t){return ym(t)?{"x-stainless-helper":t[mn.SDK_HELPER_SYMBOL]}:{}}});var ED=v(sw=>{"use strict";Object.defineProperty(sw,"__esModule",{value:!0});sw.Files=void 0;var WMe=ot(),KMe=gt(),bm=st(),JMe=_m(),YMe=lu(),$D=kt(),kD=class extends WMe.APIResource{list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/files?beta=true",KMe.Page,{query:i,...r,headers:(0,bm.buildHeaders)([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,$D.path)`/v1/files/${e}?beta=true`,{...n,headers:(0,bm.buildHeaders)([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:i}=r??{};return this._client.get((0,$D.path)`/v1/files/${e}/content?beta=true`,{...n,headers:(0,bm.buildHeaders)([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:i}=r??{};return this._client.get((0,$D.path)`/v1/files/${e}?beta=true`,{...n,headers:(0,bm.buildHeaders)([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...i}=e;return this._client.post("/v1/files?beta=true",(0,YMe.multipartFormRequestOptions)({body:i,...r,headers:(0,bm.buildHeaders)([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},(0,JMe.stainlessHelperHeaderFromFile)(i.file),r?.headers])},this._client))}};sw.Files=kD});var TD=v(aw=>{"use strict";Object.defineProperty(aw,"__esModule",{value:!0});aw.Models=void 0;var XMe=ot(),QMe=gt(),rQ=st(),eFe=kt(),AD=class extends XMe.APIResource{retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,eFe.path)`/v1/models/${e}?beta=true`,{...n,headers:(0,rQ.buildHeaders)([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/models?beta=true",QMe.Page,{query:i,...r,headers:(0,rQ.buildHeaders)([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}};aw.Models=AD});var ID=v(cw=>{"use strict";Object.defineProperty(cw,"__esModule",{value:!0});cw.UserProfiles=void 0;var tFe=ot(),rFe=gt(),vm=st(),OD=kt(),RD=class extends tFe.APIResource{create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/user_profiles?beta=true",{body:i,...r,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,OD.path)`/v1/user_profiles/${e}?beta=true`,{...n,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,OD.path)`/v1/user_profiles/${e}?beta=true`,{body:o,...n,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",rFe.PageCursor,{query:i,...r,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:i}=r??{};return this._client.post((0,OD.path)`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}};cw.UserProfiles=RD});var iQ=v(lw=>{"use strict";Object.defineProperty(lw,"__esModule",{value:!0});lw.timingSafeEqual=void 0;function nQ(t,e=""){if(!t)throw new Error(e)}function nFe(t,e){if(t.byteLength!==e.byteLength)return!1;t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),nQ(t instanceof DataView),nQ(e instanceof DataView);let r=t.byteLength,n=0,i=-1;for(;++i{"use strict";var iFe=hn&&hn.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(hn,"__esModule",{value:!0});var jt=256,PD=(function(){function t(e){e===void 0&&(e="="),this._paddingCharacter=e}return t.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},t.prototype.encode=function(e){for(var r="",n=0;n>>18&63),r+=this._encodeByte(i>>>12&63),r+=this._encodeByte(i>>>6&63),r+=this._encodeByte(i>>>0&63)}var o=e.length-n;if(o>0){var i=e[n]<<16|(o===2?e[n+1]<<8:0);r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),o===2?r+=this._encodeByte(i>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},t.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},t.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},t.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(e),n=e.length-r,i=new Uint8Array(this.maxDecodedLength(n)),o=0,s=0,a=0,c=0,l=0,u=0,d=0;s>>4,i[o++]=l<<4|u>>>2,i[o++]=u<<6|d,a|=c&jt,a|=l&jt,a|=u&jt,a|=d&jt;if(s>>4,a|=c&jt,a|=l&jt),s>>2,a|=u&jt),s>>8&6,r+=51-e>>>8&-75,r+=61-e>>>8&-15,r+=62-e>>>8&3,String.fromCharCode(r)},t.prototype._decodeChar=function(e){var r=jt;return r+=(42-e&e-44)>>>8&-jt+e-43+62,r+=(46-e&e-48)>>>8&-jt+e-47+63,r+=(47-e&e-58)>>>8&-jt+e-48+52,r+=(64-e&e-91)>>>8&-jt+e-65+0,r+=(96-e&e-123)>>>8&-jt+e-97+26,r},t.prototype._getPaddingLength=function(e){var r=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)r++;if(e.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},t})();hn.Coder=PD;var Sm=new PD;function oFe(t){return Sm.encode(t)}hn.encode=oFe;function sFe(t){return Sm.decode(t)}hn.decode=sFe;var oQ=(function(t){iFe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},e.prototype._decodeChar=function(r){var n=jt;return n+=(44-r&r-46)>>>8&-jt+r-45+62,n+=(94-r&r-96)>>>8&-jt+r-95+63,n+=(47-r&r-58)>>>8&-jt+r-48+52,n+=(64-r&r-91)>>>8&-jt+r-65+0,n+=(96-r&r-123)>>>8&-jt+r-97+26,n},e})(PD);hn.URLSafeCoder=oQ;var sQ=new oQ;function aFe(t){return sQ.encode(t)}hn.encodeURLSafe=aFe;function cFe(t){return sQ.decode(t)}hn.decodeURLSafe=cFe;hn.encodedLength=function(t){return Sm.encodedLength(t)};hn.maxDecodedLength=function(t){return Sm.maxDecodedLength(t)};hn.decodedLength=function(t){return Sm.decodedLength(t)}});var lQ=v((cQ,uw)=>{(function(t,e){var r={};e(r);var n=r.default;for(var i in r)n[i]=r[i];typeof uw=="object"&&typeof uw.exports=="object"?uw.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(cQ,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(d,f,p,m,h){for(var g,b,_,S,x,w,O,T,A,D,$,re,K;h>=64;){for(g=f[0],b=f[1],_=f[2],S=f[3],x=f[4],w=f[5],O=f[6],T=f[7],D=0;D<16;D++)$=m+D*4,d[D]=(p[$]&255)<<24|(p[$+1]&255)<<16|(p[$+2]&255)<<8|p[$+3]&255;for(D=16;D<64;D++)A=d[D-2],re=(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10,A=d[D-15],K=(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3,d[D]=(re+d[D-7]|0)+(K+d[D-16]|0);for(D=0;D<64;D++)re=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&w^~x&O)|0)+(T+(e[D]+d[D]|0)|0)|0,K=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&b^g&_^b&_)|0,T=O,O=w,w=x,x=S+re|0,S=_,_=b,b=g,g=re+K|0;f[0]+=g,f[1]+=b,f[2]+=_,f[3]+=S,f[4]+=x,f[5]+=w,f[6]+=O,f[7]+=T,m+=64,h-=64}return m}var n=(function(){function d(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var f=0;f0){for(;this.bufferLength<64&&p>0;)this.buffer[this.bufferLength++]=f[m++],p--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(p>=64&&(m=r(this.temp,this.state,f,m,p),p%=64);p>0;)this.buffer[this.bufferLength++]=f[m++],p--;return this},d.prototype.finish=function(f){if(!this.finished){var p=this.bytesHashed,m=this.bufferLength,h=p/536870912|0,g=p<<3,b=p%64<56?64:128;this.buffer[m]=128;for(var _=m+1;_>>24&255,this.buffer[b-7]=h>>>16&255,this.buffer[b-6]=h>>>8&255,this.buffer[b-5]=h>>>0&255,this.buffer[b-4]=g>>>24&255,this.buffer[b-3]=g>>>16&255,this.buffer[b-2]=g>>>8&255,this.buffer[b-1]=g>>>0&255,r(this.temp,this.state,this.buffer,0,b),this.finished=!0}for(var _=0;_<8;_++)f[_*4+0]=this.state[_]>>>24&255,f[_*4+1]=this.state[_]>>>16&255,f[_*4+2]=this.state[_]>>>8&255,f[_*4+3]=this.state[_]>>>0&255;return this},d.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},d.prototype._saveState=function(f){for(var p=0;pthis.blockSize)new n().update(f).finish(p).clean();else for(var m=0;m1&&f.update(d),p&&f.update(p),f.update(m),f.finish(d),m[0]++}var c=new Uint8Array(t.digestLength);function l(d,f,p,m){f===void 0&&(f=c),m===void 0&&(m=32);for(var h=new Uint8Array([1]),g=s(f,d),b=new i(g),_=new Uint8Array(b.digestLength),S=_.length,x=new Uint8Array(m),w=0;w>>24&255,b[1]=O>>>16&255,b[2]=O>>>8&255,b[3]=O>>>0&255,h.reset(),h.update(f),h.update(b),h.finish(S);for(var T=0;T{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.Webhook=fu.WebhookVerificationError=void 0;var lFe=iQ(),uQ=aQ(),uFe=lQ(),dQ=300,CD=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},$s=class t extends CD{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};fu.WebhookVerificationError=$s;var dw=class t{constructor(e,r){if(!e)throw new Error("Secret can't be empty.");if(r?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,n=>n.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(t.prefix)&&(e=e.substring(t.prefix.length)),this.key=uQ.decode(e)}}verify(e,r){let n={};for(let f of Object.keys(r))n[f.toLowerCase()]=r[f];let i=n["webhook-id"],o=n["webhook-signature"],s=n["webhook-timestamp"];if(!o||!i||!s)throw new $s("Missing required headers");let a=this.verifyTimestamp(s),l=this.sign(i,a,e).split(",")[1],u=o.split(" "),d=new globalThis.TextEncoder;for(let f of u){let[p,m]=f.split(",");if(p==="v1"&&(0,lFe.timingSafeEqual)(d.encode(m),d.encode(l)))return JSON.parse(e.toString())}throw new $s("No matching signature found")}sign(e,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,o=Math.floor(r.getTime()/1e3),s=i.encode(`${e}.${o}.${n}`);return`v1,${uQ.encode(uFe.hmac(this.key,s))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new $s("Invalid Signature Headers");if(r-n>dQ)throw new $s("Message timestamp too old");if(n>r+dQ)throw new $s("Message timestamp too new");return new Date(n*1e3)}};fu.Webhook=dw;dw.prefix="whsec_"});var ND=v(fw=>{"use strict";Object.defineProperty(fw,"__esModule",{value:!0});fw.Webhooks=void 0;var dFe=ot(),fFe=fQ(),DD=class extends dFe.APIResource{unwrap(e,{headers:r,key:n}){if(r!==void 0){let i=n===void 0?this._client.webhookKey:n;if(i===null)throw new Error("Webhook key must not be null in order to unwrap");new fFe.Webhook(i).verify(e,r)}return JSON.parse(e)}};fw.Webhooks=DD});var MD=v(pw=>{"use strict";Object.defineProperty(pw,"__esModule",{value:!0});pw.Versions=void 0;var pFe=ot(),mFe=gt(),hFe=st(),gFe=kt(),jD=class extends pFe.APIResource{list(e,r={},n){let{betas:i,...o}=r??{};return this._client.getAPIList((0,gFe.path)`/v1/agents/${e}/versions?beta=true`,mFe.PageCursor,{query:o,...n,headers:(0,hFe.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};pw.Versions=jD});var LD=v(hw=>{"use strict";Object.defineProperty(hw,"__esModule",{value:!0});hw.Agents=void 0;var yFe=_t(),_Fe=ot(),bFe=yFe.__importStar(MD()),vFe=MD(),SFe=gt(),wm=st(),FD=kt(),mw=class extends _Fe.APIResource{constructor(){super(...arguments),this.versions=new bFe.Versions(this._client)}create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/agents?beta=true",{body:i,...r,headers:(0,wm.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i,...o}=r??{};return this._client.get((0,FD.path)`/v1/agents/${e}?beta=true`,{query:o,...n,headers:(0,wm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,FD.path)`/v1/agents/${e}?beta=true`,{body:o,...n,headers:(0,wm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/agents?beta=true",SFe.PageCursor,{query:i,...r,headers:(0,wm.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:i}=r??{};return this._client.post((0,FD.path)`/v1/agents/${e}/archive?beta=true`,{...n,headers:(0,wm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};hw.Agents=mw;mw.Versions=vFe.Versions});var UD=v(gw=>{"use strict";Object.defineProperty(gw,"__esModule",{value:!0});gw.Memories=void 0;var wFe=ot(),xFe=gt(),xm=st(),$m=kt(),zD=class extends wFe.APIResource{create(e,r,n){let{view:i,betas:o,...s}=r;return this._client.post((0,$m.path)`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:i},body:s,...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:i,betas:o,...s}=r;return this._client.get((0,$m.path)`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:s,...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:i,view:o,betas:s,...a}=r;return this._client.post((0,$m.path)`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:{view:o},body:a,...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:i,...o}=r??{};return this._client.getAPIList((0,$m.path)`/v1/memory_stores/${e}/memories?beta=true`,xFe.PageCursor,{query:o,...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:i,expected_content_sha256:o,betas:s}=r;return this._client.delete((0,$m.path)`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:{expected_content_sha256:o},...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};gw.Memories=zD});var GD=v(yw=>{"use strict";Object.defineProperty(yw,"__esModule",{value:!0});yw.MemoryVersions=void 0;var $Fe=ot(),kFe=gt(),qD=st(),BD=kt(),HD=class extends $Fe.APIResource{retrieve(e,r,n){let{memory_store_id:i,betas:o,...s}=r;return this._client.get((0,BD.path)`/v1/memory_stores/${i}/memory_versions/${e}?beta=true`,{query:s,...n,headers:(0,qD.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:i,...o}=r??{};return this._client.getAPIList((0,BD.path)`/v1/memory_stores/${e}/memory_versions?beta=true`,kFe.PageCursor,{query:o,...n,headers:(0,qD.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:i,betas:o}=r;return this._client.post((0,BD.path)`/v1/memory_stores/${i}/memory_versions/${e}/redact?beta=true`,{...n,headers:(0,qD.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};yw.MemoryVersions=HD});var ZD=v(bw=>{"use strict";Object.defineProperty(bw,"__esModule",{value:!0});bw.MemoryStores=void 0;var pQ=_t(),EFe=ot(),AFe=pQ.__importStar(UD()),TFe=UD(),OFe=pQ.__importStar(GD()),RFe=GD(),IFe=gt(),pu=st(),_w=kt(),km=class extends EFe.APIResource{constructor(){super(...arguments),this.memories=new AFe.Memories(this._client),this.memoryVersions=new OFe.MemoryVersions(this._client)}create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/memory_stores?beta=true",{body:i,...r,headers:(0,pu.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,_w.path)`/v1/memory_stores/${e}?beta=true`,{...n,headers:(0,pu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,_w.path)`/v1/memory_stores/${e}?beta=true`,{body:o,...n,headers:(0,pu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",IFe.PageCursor,{query:i,...r,headers:(0,pu.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,_w.path)`/v1/memory_stores/${e}?beta=true`,{...n,headers:(0,pu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:i}=r??{};return this._client.post((0,_w.path)`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:(0,pu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};bw.MemoryStores=km;km.Memories=TFe.Memories;km.MemoryVersions=RFe.MemoryVersions});var mu=v(VD=>{"use strict";Object.defineProperty(VD,"__esModule",{value:!0});var PFe=_t();PFe.__exportStar(fr(),VD)});var KD=v(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0});vw.JSONLDecoder=void 0;var mQ=fr(),CFe=iu(),DFe=tD(),WD=class t{constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new DFe.LineDecoder;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new mQ.AnthropicError("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new mQ.AnthropicError("Attempted to iterate over a response with no body");return new t((0,CFe.ReadableStreamToAsyncIterable)(e.body),r)}};vw.JSONLDecoder=WD});var XD=v(Sw=>{"use strict";Object.defineProperty(Sw,"__esModule",{value:!0});Sw.Batches=void 0;var NFe=ot(),jFe=gt(),hu=st(),MFe=KD(),FFe=mu(),JD=kt(),YD=class extends NFe.APIResource{create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/messages/batches?beta=true",{body:i,...r,headers:(0,hu.buildHeaders)([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,JD.path)`/v1/messages/batches/${e}?beta=true`,{...n,headers:(0,hu.buildHeaders)([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",jFe.Page,{query:i,...r,headers:(0,hu.buildHeaders)([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,JD.path)`/v1/messages/batches/${e}?beta=true`,{...n,headers:(0,hu.buildHeaders)([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:i}=r??{};return this._client.post((0,JD.path)`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:(0,hu.buildHeaders)([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let i=await this.retrieve(e);if(!i.results_url)throw new FFe.AnthropicError(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{betas:o}=r??{};return this._client.get(i.results_url,{...n,headers:(0,hu.buildHeaders)([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,a)=>MFe.JSONLDecoder.fromResponse(a.response,a.controller))}};Sw.Batches=YD});var QD=v(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});ww.MODEL_NONSTREAMING_TOKENS=void 0;ww.MODEL_NONSTREAMING_TOKENS={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});var eN=v(xw=>{"use strict";Object.defineProperty(xw,"__esModule",{value:!0});xw.maybeParseBetaMessage=zFe;xw.parseBetaMessage=gQ;var LFe=fr();function hQ(t){return t?.output_format??t?.output_config?.format}function zFe(t,e,r){let n=hQ(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(i=>{if(i.type==="text"){let o=Object.defineProperty({...i},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return i}),parsed_output:null}:gQ(t,e,r)}function gQ(t,e,r){let n=null,i=t.content.map(o=>{if(o.type==="text"){let s=UFe(e,o.text);n===null&&(n=s);let a=Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),s},enumerable:!1})}return o});return{...t,content:i,parsed_output:n}}function UFe(t,e){let r=hQ(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new LFe.AnthropicError(`Failed to parse structured output: ${n}`)}}});var tN=v($w=>{"use strict";Object.defineProperty($w,"__esModule",{value:!0});$w.partialParse=void 0;var qFe=t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),gu(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),gu(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),gu(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),gu(t);break;case"delimiter":return t=t.slice(0,t.length-1),gu(t);break}return t},BFe=t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},HFe=t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},GFe=t=>JSON.parse(HFe(BFe(gu(qFe(t)))));$w.partialParse=GFe});var nN=v(rN=>{"use strict";Object.defineProperty(rN,"__esModule",{value:!0});var ZFe=_t();ZFe.__exportStar(sD(),rN)});var xQ=v(Pw=>{"use strict";var Dn,ks,yu,Em,kw,Am,Tm,Ew,Om,Ro,Rm,Aw,Tw,uc,Ow,Rw,Im,iN,yQ,Iw,oN,sN,aN,_Q;Object.defineProperty(Pw,"__esModule",{value:!0});Pw.BetaMessageStream=void 0;var X=_t(),VFe=tN(),xr=mu(),WFe=ru(),bQ=nN(),vQ=eN(),SQ="__json_buf";function wQ(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var cN=class t{constructor(e,r){Dn.add(this),this.messages=[],this.receivedMessages=[],ks.set(this,void 0),yu.set(this,null),this.controller=new AbortController,Em.set(this,void 0),kw.set(this,()=>{}),Am.set(this,()=>{}),Tm.set(this,void 0),Ew.set(this,()=>{}),Om.set(this,()=>{}),Ro.set(this,{}),Rm.set(this,!1),Aw.set(this,!1),Tw.set(this,!1),uc.set(this,!1),Ow.set(this,void 0),Rw.set(this,void 0),Im.set(this,void 0),Iw.set(this,n=>{if(X.__classPrivateFieldSet(this,Aw,!0,"f"),(0,WFe.isAbortError)(n)&&(n=new xr.APIUserAbortError),n instanceof xr.APIUserAbortError)return X.__classPrivateFieldSet(this,Tw,!0,"f"),this._emit("abort",n);if(n instanceof xr.AnthropicError)return this._emit("error",n);if(n instanceof Error){let i=new xr.AnthropicError(n.message);return i.cause=n,this._emit("error",i)}return this._emit("error",new xr.AnthropicError(String(n)))}),X.__classPrivateFieldSet(this,Em,new Promise((n,i)=>{X.__classPrivateFieldSet(this,kw,n,"f"),X.__classPrivateFieldSet(this,Am,i,"f")}),"f"),X.__classPrivateFieldSet(this,Tm,new Promise((n,i)=>{X.__classPrivateFieldSet(this,Ew,n,"f"),X.__classPrivateFieldSet(this,Om,i,"f")}),"f"),X.__classPrivateFieldGet(this,Em,"f").catch(()=>{}),X.__classPrivateFieldGet(this,Tm,"f").catch(()=>{}),X.__classPrivateFieldSet(this,yu,e,"f"),X.__classPrivateFieldSet(this,Im,r?.logger??console,"f")}get response(){return X.__classPrivateFieldGet(this,Ow,"f")}get request_id(){return X.__classPrivateFieldGet(this,Rw,"f")}async withResponse(){X.__classPrivateFieldSet(this,uc,!0,"f");let e=await X.__classPrivateFieldGet(this,Em,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:i}={}){let o=new t(r,{logger:i});for(let s of r.messages)o._addMessageParam(s);return X.__classPrivateFieldSet(o,yu,{...r,stream:!0},"f"),o._run(()=>o._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),o}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},X.__classPrivateFieldGet(this,Iw,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let i=n?.signal,o;i&&(i.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),i.addEventListener("abort",o));try{X.__classPrivateFieldGet(this,Dn,"m",oN).call(this);let{response:s,data:a}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(s);for await(let c of a)X.__classPrivateFieldGet(this,Dn,"m",sN).call(this,c);if(a.controller.signal?.aborted)throw new xr.APIUserAbortError;X.__classPrivateFieldGet(this,Dn,"m",aN).call(this)}finally{i&&o&&i.removeEventListener("abort",o)}}_connected(e){this.ended||(X.__classPrivateFieldSet(this,Ow,e,"f"),X.__classPrivateFieldSet(this,Rw,e?.headers.get("request-id"),"f"),X.__classPrivateFieldGet(this,kw,"f").call(this,e),this._emit("connect"))}get ended(){return X.__classPrivateFieldGet(this,Rm,"f")}get errored(){return X.__classPrivateFieldGet(this,Aw,"f")}get aborted(){return X.__classPrivateFieldGet(this,Tw,"f")}abort(){this.controller.abort()}on(e,r){return(X.__classPrivateFieldGet(this,Ro,"f")[e]||(X.__classPrivateFieldGet(this,Ro,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=X.__classPrivateFieldGet(this,Ro,"f")[e];if(!n)return this;let i=n.findIndex(o=>o.listener===r);return i>=0&&n.splice(i,1),this}once(e,r){return(X.__classPrivateFieldGet(this,Ro,"f")[e]||(X.__classPrivateFieldGet(this,Ro,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{X.__classPrivateFieldSet(this,uc,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){X.__classPrivateFieldSet(this,uc,!0,"f"),await X.__classPrivateFieldGet(this,Tm,"f")}get currentMessage(){return X.__classPrivateFieldGet(this,ks,"f")}async finalMessage(){return await this.done(),X.__classPrivateFieldGet(this,Dn,"m",iN).call(this)}async finalText(){return await this.done(),X.__classPrivateFieldGet(this,Dn,"m",yQ).call(this)}_emit(e,...r){if(X.__classPrivateFieldGet(this,Rm,"f"))return;e==="end"&&(X.__classPrivateFieldSet(this,Rm,!0,"f"),X.__classPrivateFieldGet(this,Ew,"f").call(this));let n=X.__classPrivateFieldGet(this,Ro,"f")[e];if(n&&(X.__classPrivateFieldGet(this,Ro,"f")[e]=n.filter(i=>!i.once),n.forEach(({listener:i})=>i(...r))),e==="abort"){let i=r[0];!X.__classPrivateFieldGet(this,uc,"f")&&!n?.length&&Promise.reject(i),X.__classPrivateFieldGet(this,Am,"f").call(this,i),X.__classPrivateFieldGet(this,Om,"f").call(this,i),this._emit("end");return}if(e==="error"){let i=r[0];!X.__classPrivateFieldGet(this,uc,"f")&&!n?.length&&Promise.reject(i),X.__classPrivateFieldGet(this,Am,"f").call(this,i),X.__classPrivateFieldGet(this,Om,"f").call(this,i),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",X.__classPrivateFieldGet(this,Dn,"m",iN).call(this))}async _fromReadableStream(e,r){let n=r?.signal,i;n&&(n.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),n.addEventListener("abort",i));try{X.__classPrivateFieldGet(this,Dn,"m",oN).call(this),this._connected(null);let o=bQ.Stream.fromReadableStream(e,this.controller);for await(let s of o)X.__classPrivateFieldGet(this,Dn,"m",sN).call(this,s);if(o.controller.signal?.aborted)throw new xr.APIUserAbortError;X.__classPrivateFieldGet(this,Dn,"m",aN).call(this)}finally{n&&i&&n.removeEventListener("abort",i)}}[(ks=new WeakMap,yu=new WeakMap,Em=new WeakMap,kw=new WeakMap,Am=new WeakMap,Tm=new WeakMap,Ew=new WeakMap,Om=new WeakMap,Ro=new WeakMap,Rm=new WeakMap,Aw=new WeakMap,Tw=new WeakMap,uc=new WeakMap,Ow=new WeakMap,Rw=new WeakMap,Im=new WeakMap,Iw=new WeakMap,Dn=new WeakSet,iN=function(){if(this.receivedMessages.length===0)throw new xr.AnthropicError("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},yQ=function(){if(this.receivedMessages.length===0)throw new xr.AnthropicError("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new xr.AnthropicError("stream ended without producing a content block with type=text");return r.join(" ")},oN=function(){this.ended||X.__classPrivateFieldSet(this,ks,void 0,"f")},sN=function(r){if(this.ended)return;let n=X.__classPrivateFieldGet(this,Dn,"m",_Q).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let i=n.content.at(-1);switch(r.delta.type){case"text_delta":{i.type==="text"&&this._emit("text",r.delta.text,i.text||"");break}case"citations_delta":{i.type==="text"&&this._emit("citation",r.delta.citation,i.citations??[]);break}case"input_json_delta":{wQ(i)&&i.input&&this._emit("inputJson",r.delta.partial_json,i.input);break}case"thinking_delta":{i.type==="thinking"&&this._emit("thinking",r.delta.thinking,i.thinking);break}case"signature_delta":{i.type==="thinking"&&this._emit("signature",i.signature);break}case"compaction_delta":{i.type==="compaction"&&i.content&&this._emit("compaction",i.content);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage((0,vQ.maybeParseBetaMessage)(n,X.__classPrivateFieldGet(this,yu,"f"),{logger:X.__classPrivateFieldGet(this,Im,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{X.__classPrivateFieldSet(this,ks,n,"f");break}case"content_block_start":case"message_delta":break}},aN=function(){if(this.ended)throw new xr.AnthropicError("stream has ended, this shouldn't happen");let r=X.__classPrivateFieldGet(this,ks,"f");if(!r)throw new xr.AnthropicError("request ended without sending any chunks");return X.__classPrivateFieldSet(this,ks,void 0,"f"),(0,vQ.maybeParseBetaMessage)(r,X.__classPrivateFieldGet(this,yu,"f"),{logger:X.__classPrivateFieldGet(this,Im,"f")})},_Q=function(r){let n=X.__classPrivateFieldGet(this,ks,"f");if(r.type==="message_start"){if(n)throw new xr.AnthropicError(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new xr.AnthropicError(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.container=r.delta.container,n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,n.context_management=r.context_management,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),r.usage.iterations!=null&&(n.usage.iterations=r.usage.iterations),n;case"content_block_start":return n.content.push(r.content_block),n;case"content_block_delta":{let i=n.content.at(r.index);switch(r.delta.type){case"text_delta":{i?.type==="text"&&(n.content[r.index]={...i,text:(i.text||"")+r.delta.text});break}case"citations_delta":{i?.type==="text"&&(n.content[r.index]={...i,citations:[...i.citations??[],r.delta.citation]});break}case"input_json_delta":{if(i&&wQ(i)){let o=i[SQ]||"";o+=r.delta.partial_json;let s={...i};if(Object.defineProperty(s,SQ,{value:o,enumerable:!1,writable:!0}),o)try{s.input=(0,VFe.partialParse)(o)}catch(a){let c=new xr.AnthropicError(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${a}. JSON: ${o}`);X.__classPrivateFieldGet(this,Iw,"f").call(this,c)}n.content[r.index]=s}break}case"thinking_delta":{i?.type==="thinking"&&(n.content[r.index]={...i,thinking:i.thinking+r.delta.thinking});break}case"signature_delta":{i?.type==="thinking"&&(n.content[r.index]={...i,signature:r.delta.signature});break}case"compaction_delta":{i?.type==="compaction"&&(n.content[r.index]={...i,content:(i.content||"")+r.delta.content});break}default:r.delta}return n}case"content_block_stop":return n}},Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",i=>{let o=r.shift();o?o.resolve(i):e.push(i)}),this.on("end",()=>{n=!0;for(let i of r)i.resolve(void 0);r.length=0}),this.on("abort",i=>{n=!0;for(let o of r)o.reject(i);r.length=0}),this.on("error",i=>{n=!0;for(let o of r)o.reject(i);r.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new bQ.Stream(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}};Pw.BetaMessageStream=cN});var Dw=v(Cw=>{"use strict";Object.defineProperty(Cw,"__esModule",{value:!0});Cw.ToolError=void 0;var lN=class extends Error{constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}};Cw.ToolError=lN});var $Q=v(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.DEFAULT_SUMMARY_PROMPT=_u.DEFAULT_TOKEN_THRESHOLD=void 0;_u.DEFAULT_TOKEN_THRESHOLD=1e5;_u.DEFAULT_SUMMARY_PROMPT=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: 1. Task Overview The user's core request and success criteria Any clarifications or constraints they specified @@ -420,18 +420,18 @@ new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); `)}p.write("payload.value = newResult;"),p.write("return payload;");let _=p.compile();return(S,x)=>_(f,S,x)},o,s=$c,a=!wc.jitless,l=a&&lM.value,u=e.catchall,d;t._zod.parse=(f,p)=>{d??(d=n.value);let m=f.value;return s(m)?a&&l&&p?.async===!1&&p.jitless!==!0?(o||(o=i(e.shape)),f=o(f,p),u?Nre([],m,f,p,d,t):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),f)}});ed=k("$ZodUnion",(t,e)=>{ue.init(t,e),ve(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),ve(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ve(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),ve(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>_h(i.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let o=!1,s=[];for(let a of e.options){let c=a._zod.run({value:n.value,issues:[]},i);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>bre(a,n,t,i)):bre(s,n,t,i)}});n$=k("$ZodXor",(t,e)=>{ed.init(t,e),e.inclusive=!1;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let o=!1,s=[];for(let a of e.options){let c=a._zod.run({value:n.value,issues:[]},i);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>vre(a,n,t,i)):vre(s,n,t,i)}}),i$=k("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ed.init(t,e);let r=t._zod.parse;ve(t._zod,"propValues",()=>{let i={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,c]of Object.entries(s)){i[a]||(i[a]=new Set);for(let l of c)i[a].add(l)}}return i});let n=Zu(()=>{let i=e.options,o=new Map;for(let s of i){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});t._zod.parse=(i,o)=>{let s=i.value;if(!$c(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),i;let a=n.value.get(s?.[e.discriminator]);return a?a._zod.run(i,o):e.unionFallback||o.direction==="backward"?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:s,path:[e.discriminator],inst:t}),i)}}),o$=k("$ZodIntersection",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>{let i=r.value,o=e.left._zod.run({value:i,issues:[]},n),s=e.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>Sre(r,c,l)):Sre(r,o,s)}});Rh=k("$ZodTuple",(t,e)=>{ue.init(t,e);let r=e.items;t._zod.parse=(n,i)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];let s=[],a=wre(r,"optin"),c=wre(r,"optout");if(!e.rest){if(o.lengthr.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:o,inst:t,origin:"array"})}let l=new Array(r.length);for(let u=0;u{l[u]=f})):l[u]=d}if(e.rest){let u=r.length-1,d=o.slice(r.length);for(let f of d){u++;let p=e.rest._zod.run({value:f,issues:[]},i);p instanceof Promise?s.push(p.then(m=>xre(m,n,u))):xre(p,n,u)}}return s.length?Promise.all(s).then(()=>$re(l,n,r,o,c)):$re(l,n,r,o,c)}});s$=k("$ZodRecord",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Ms(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let u=e.keyType._zod.run({value:l,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>kr(p,n,Tt())),input:l,path:[l],inst:t});continue}let d=u.value,f=e.valueType._zod.run({value:i[l],issues:[]},n);f instanceof Promise?o.push(f.then(p=>{p.issues.length&&r.issues.push(...Br(l,p.issues)),r.value[d]=p.value})):(f.issues.length&&r.issues.push(...Br(l,f.issues)),r.value[d]=f.value)}let c;for(let l in i)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(i)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&h0.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=i[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>kr(d,n,Tt())),input:a,path:[a],inst:t});continue}let u=e.valueType._zod.run({value:i[a],issues:[]},n);u instanceof Promise?o.push(u.then(d=>{d.issues.length&&r.issues.push(...Br(a,d.issues)),r.value[c.value]=d.value})):(u.issues.length&&r.issues.push(...Br(a,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),a$=k("$ZodMap",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:t}),r;let o=[];r.value=new Map;for(let[s,a]of i){let c=e.keyType._zod.run({value:s,issues:[]},n),l=e.valueType._zod.run({value:a,issues:[]},n);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([u,d])=>{kre(u,d,r,s,i,t,n)})):kre(c,l,r,s,i,t,n)}return o.length?Promise.all(o).then(()=>r):r}});c$=k("$ZodSet",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:t,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of i){let a=e.valueType._zod.run({value:s,issues:[]},n);a instanceof Promise?o.push(a.then(c=>Ere(c,r))):Ere(a,r)}return o.length?Promise.all(o).then(()=>r):r}});l$=k("$ZodEnum",(t,e)=>{ue.init(t,e);let r=yh(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>bh.has(typeof i)).map(i=>typeof i=="string"?Fn(i):i.toString()).join("|")})$`),t._zod.parse=(i,o)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:t}),i}}),u$=k("$ZodLiteral",(t,e)=>{if(ue.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Fn(n):n?Fn(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),n}}),d$=k("$ZodFile",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:t}),r}}),f$=k("$ZodTransform",(t,e)=>{ue.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(r.value=s,r.fallback=!0,r));if(i instanceof Promise)throw new fi;return r.value=i,r.fallback=!0,r}});Ih=k("$ZodOptional",(t,e)=>{ue.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ve(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ve(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${_h(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=r.value,o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Are(s,i)):Are(o,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),p$=k("$ZodExactOptional",(t,e)=>{Ih.init(t,e),ve(t._zod,"values",()=>e.innerType._zod.values),ve(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),m$=k("$ZodNullable",(t,e)=>{ue.init(t,e),ve(t._zod,"optin",()=>e.innerType._zod.optin),ve(t._zod,"optout",()=>e.innerType._zod.optout),ve(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${_h(r.source)}|null)$`):void 0}),ve(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),h$=k("$ZodDefault",(t,e)=>{ue.init(t,e),t._zod.optin="optional",ve(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>Tre(o,e)):Tre(i,e)}});g$=k("$ZodPrefault",(t,e)=>{ue.init(t,e),t._zod.optin="optional",ve(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),y$=k("$ZodNonOptional",(t,e)=>{ue.init(t,e),ve(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>Ore(o,t)):Ore(i,t)}});_$=k("$ZodSuccess",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds("ZodSuccess");let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.issues.length===0,r)):(r.value=i.issues.length===0,r)}}),b$=k("$ZodCatch",(t,e)=>{ue.init(t,e),t._zod.optin="optional",ve(t._zod,"optout",()=>e.innerType._zod.optout),ve(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>kr(s,n,Tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(o=>kr(o,n,Tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),v$=k("$ZodNaN",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),Ph=k("$ZodPipe",(t,e)=>{ue.init(t,e),ve(t._zod,"values",()=>e.in._zod.values),ve(t._zod,"optin",()=>e.in._zod.optin),ve(t._zod,"optout",()=>e.out._zod.optout),ve(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let o=e.out._zod.run(r,n);return o instanceof Promise?o.then(s=>v0(s,e.in,n)):v0(o,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(o=>v0(o,e.out,n)):v0(i,e.out,n)}});td=k("$ZodCodec",(t,e)=>{ue.init(t,e),ve(t._zod,"values",()=>e.in._zod.values),ve(t._zod,"optin",()=>e.in._zod.optin),ve(t._zod,"optout",()=>e.out._zod.optout),ve(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>S0(s,e,n)):S0(o,e,n)}else{let o=e.out._zod.run(r,n);return o instanceof Promise?o.then(s=>S0(s,e,n)):S0(o,e,n)}}});wF=k("$ZodPreprocess",(t,e)=>{Ph.init(t,e)}),S$=k("$ZodReadonly",(t,e)=>{ue.init(t,e),ve(t._zod,"propValues",()=>e.innerType._zod.propValues),ve(t._zod,"values",()=>e.innerType._zod.values),ve(t._zod,"optin",()=>e.innerType?._zod?.optin),ve(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(Rre):Rre(i)}});w$=k("$ZodTemplateLiteral",(t,e)=>{ue.init(t,e);let r=[];for(let n of e.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let o=i.startsWith("^")?1:0,s=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(o,s))}else if(n===null||uM.has(typeof n))r.push(Fn(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"string",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),n)}),x$=k("$ZodFunction",(t,e)=>(ue.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let i=t._def.input?kc(t._def.input,n):n,o=Reflect.apply(r,this,i);return t._def.output?kc(t._def.output,o):o}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let i=t._def.input?await Ec(t._def.input,n):n,o=await Reflect.apply(r,this,i);return t._def.output?await Ec(t._def.output,o):o}},t._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let n=t.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Rh({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new n({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let n=t.constructor;return new n({type:"function",input:t._def.input,output:r})},t)),$$=k("$ZodPromise",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(i=>e.innerType._zod.run({value:i,issues:[]},n))}),k$=k("$ZodLazy",(t,e)=>{ue.init(t,e),ve(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),ve(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),ve(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),ve(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),ve(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),E$=k("$ZodCustom",(t,e)=>{Qe.init(t,e),ue.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(o=>Ire(o,r,n,t));Ire(i,r,n,t)}})});function jre(){return{localeError:k6e()}}var k6e,Mre=y(()=>{ee();k6e=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(i){return t[i]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${i.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return i.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${N(i.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${i.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${i.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${r[o.format]??i.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${i.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${i.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${i.keys.length>1?"\u0629":""}: ${R(i.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function Fre(){return{localeError:E6e()}}var E6e,Lre=y(()=>{ee();E6e=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${i.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return i.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${N(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.format]??i.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${i.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${i.keys.length>1?"lar":""}: ${R(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${i.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function zre(t,e,r,n){let i=Math.abs(t),o=i%10,s=i%100;return s>=11&&s<=19?n:o===1?e:o>=2&&o<=4?r:n}function Ure(){return{localeError:A6e()}}var A6e,qre=y(()=>{ee();A6e=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(i){return t[i]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},n={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${i.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${N(i.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),c=zre(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${i.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),c=zre(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${i.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${i.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${R(i.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${i.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function Bre(){return{localeError:T6e()}}var T6e,Hre=y(()=>{ee();T6e=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${N(i.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${i.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${i.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u043E\u0432\u0435":""}: ${R(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function Gre(){return{localeError:O6e()}}var O6e,Zre=y(()=>{ee();O6e=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(i){return t[i]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${i.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return i.values.length===1?`Valor inv\xE0lid: s'esperava ${N(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${R(i.values," o ")}`;case"too_big":{let o=i.inclusive?"com a m\xE0xim":"menys de",s=e(i.origin);return s?`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xE9s ${o} ${i.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(i.origin);return s?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${o} ${i.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${i.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${i.origin}`;default:return"Entrada inv\xE0lida"}}}});function Vre(){return{localeError:R6e()}}var R6e,Wre=y(()=>{ee();R6e=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(i){return t[i]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},n={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${i.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${N(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${R(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${i.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${i.origin}`;default:return"Neplatn\xFD vstup"}}}});function Kre(){return{localeError:I6e()}}var I6e,Jre=y(()=>{ee();I6e=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(i){return t[i]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldigt input: forventede instanceof ${i.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return i.values.length===1?`Ugyldig v\xE6rdi: forventede ${N(i.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin),a=n[i.origin]??i.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin),a=n[i.origin]??i.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${i.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${R(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${i.origin}`;default:return"Ugyldigt input"}}}});function Yre(){return{localeError:P6e()}}var P6e,Xre=y(()=>{ee();P6e=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(i){return t[i]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},n={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${i.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return i.values.length===1?`Ung\xFCltige Eingabe: erwartet ${N(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ist`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ist`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.format]??i.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${R(i.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${i.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${i.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function Qre(){return{localeError:C6e()}}var C6e,ene=y(()=>{ee();C6e=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(i){return t[i]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return typeof i.expected=="string"&&/^[A-Z]/.test(i.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${i.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return i.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${N(i.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${i.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${i.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${o.prefix}"`:o.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${o.suffix}"`:o.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${o.includes}"`:o.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[o.format]??i.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${i.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${i.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${i.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${R(i.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${i.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${i.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}}});function A$(){return{localeError:D6e()}}var D6e,$F=y(()=>{ee();D6e=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${N(i.values[0])}`:`Invalid option: expected one of ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${s.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}}});function tne(){return{localeError:N6e()}}var N6e,rne=y(()=>{ee();N6e=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(i){return t[i]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${i.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${N(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${o}${i.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}}});function nne(){return{localeError:j6e()}}var j6e,ine=y(()=>{ee();j6e=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(i){return t[i]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${i.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: se esperaba ${N(i.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin),a=n[i.origin]??i.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${i.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin),a=n[i.origin]??i.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${i.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n[i.origin]??i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n[i.origin]??i.origin}`;default:return"Entrada inv\xE1lida"}}}});function one(){return{localeError:M6e()}}var M6e,sne=y(()=>{ee();M6e=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(i){return t[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${i.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return i.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${N(i.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${R(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.format]??i.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${i.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${i.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${R(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${i.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${i.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function ane(){return{localeError:F6e()}}var F6e,cne=y(()=>{ee();F6e=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(i){return t[i]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return i.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${N(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${i.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${i.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${R(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function lne(){return{localeError:L6e()}}var L6e,une=y(()=>{ee();L6e=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return t[i]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : instanceof ${i.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : ${N(i.values[0])} attendu`:`Option invalide : une valeur parmi ${R(i.values,"|")} attendue`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Trop grand : ${n[i.origin]??"valeur"} doit ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n[i.origin]??"valeur"} doit \xEAtre ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Trop petit : ${n[i.origin]??"valeur"} doit ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Trop petit : ${n[i.origin]??"valeur"} doit \xEAtre ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${r[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${R(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}}});function dne(){return{localeError:z6e()}}var z6e,fne=y(()=>{ee();z6e=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return t[i]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : attendu instanceof ${i.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : attendu ${N(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"\u2264":"<",s=e(i.origin);return s?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${o}${i.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"\u2265":">",s=e(i.origin);return s?`Trop petit : attendu que ${i.origin} ait ${o}${i.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${i.origin} soit ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${R(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}}});function pne(){return{localeError:U6e()}}var U6e,mne=y(()=>{ee();U6e=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?t[l]:void 0,n=l=>{let u=r(l);return u?u.label:l??t.unknown.label},i=l=>`\u05D4${n(l)}`,o=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?e[l]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,d=c[u??""]??n(u),f=j(l.input),p=c[f]??t[f]?.label??f;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${N(l.values[0])}`;let u=l.values.map(p=>N(p));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=s(l.origin),d=i(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let f=l.inclusive?"<=":"<",p=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),d=i(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let g=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`}let h=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let f=l.inclusive?">=":">",p=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let d=a[u.format],f=d?.label??u.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${m}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${R(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function hne(){return{localeError:q6e()}}var q6e,gne=y(()=>{ee();q6e=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(i){return t[i]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},n={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${i.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return i.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${N(i.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin),a=n[i.origin]??i.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${o}${i.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin),a=n[i.origin]??i.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${o}${i.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${r[o.format]??i.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${i.divisor}`;case"unrecognized_keys":return`Neprepoznat${i.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${R(i.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${n[i.origin]??i.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${n[i.origin]??i.origin}`;default:return"Neispravan unos"}}}});function yne(){return{localeError:B6e()}}var B6e,_ne=y(()=>{ee();B6e=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(i){return t[i]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},n={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${i.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return i.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${N(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${i.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${o}${i.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.format]??i.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${i.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${i.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${i.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function bne(t,e,r){return Math.abs(t)===1?e:r}function rd(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}function vne(){return{localeError:H6e()}}var H6e,Sne=y(()=>{ee();H6e=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(i){return t[i]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},n={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${i.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return i.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${N(i.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),c=bne(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rd(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${i.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rd(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),c=bne(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rd(i.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${i.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rd(i.origin)} \u056C\u056B\u0576\u056B ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.format]??i.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${i.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${i.keys.length>1?"\u0576\u0565\u0580":""}. ${R(i.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${rd(i.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${rd(i.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function wne(){return{localeError:G6e()}}var G6e,xne=y(()=>{ee();G6e=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(i){return t[i]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${N(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${o}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Terlalu kecil: diharapkan ${i.origin} memiliki ${o}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}}});function $ne(){return{localeError:Z6e()}}var Z6e,kne=y(()=>{ee();Z6e=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(i){return t[i]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},n={nan:"NaN",number:"n\xFAmer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${i.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return i.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${N(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${o}${i.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${o}${i.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.format]??i.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${R(i.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${i.origin}`;default:return"Rangt gildi"}}}});function Ene(){return{localeError:V6e()}}var V6e,Ane=y(()=>{ee();V6e=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(i){return t[i]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Input non valido: atteso instanceof ${i.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return i.values.length===1?`Input non valido: atteso ${N(i.values[0])}`:`Opzione non valida: atteso uno tra ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Troppo grande: ${i.origin??"valore"} deve avere ${o}${i.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Troppo piccolo: ${i.origin} deve avere ${o}${i.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${i.origin} deve essere ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${r[o.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${R(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}}});function Tne(){return{localeError:W6e()}}var W6e,One=y(()=>{ee();W6e=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(i){return t[i]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},n={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${i.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return i.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${N(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${R(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=i.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(i.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=i.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(i.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.format]??i.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${i.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${i.keys.length>1?"\u7FA4":""}: ${R(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function Rne(){return{localeError:K6e()}}var K6e,Ine=y(()=>{ee();K6e=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(i){return t[i]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},n={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return i.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${N(i.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${R(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${i.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${i.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${R(i.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${i.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${i.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function T$(){return{localeError:J6e()}}var J6e,kF=y(()=>{ee();J6e=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(i){return t[i]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},n={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${i.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return i.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${N(i.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${i.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${o} ${i.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${i.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${R(i.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function Pne(){return T$()}var Cne=y(()=>{kF()});function Dne(){return{localeError:Y6e()}}var Y6e,Nne=y(()=>{ee();Y6e=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${i.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return i.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${N(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${R(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),c=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${c} ${o}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${o}${s}`}case"too_small":{let o=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),c=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${c} ${o}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.format]??i.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${i.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${R(i.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${i.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${i.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function jne(t){let e=Math.abs(t),r=e%10,n=e%100;return n>=11&&n<=19||r===0?"many":r===1?"one":"few"}function Mne(){return{localeError:X6e()}}var Ch,X6e,Fne=y(()=>{ee();Ch=t=>t.charAt(0).toUpperCase()+t.slice(1);X6e=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(i,o,s,a){let c=t[i]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},n={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${i.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${N(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${R(i.values,"|")} pasirinkim\u0173`;case"too_big":{let o=n[i.origin]??i.origin,s=e(i.origin,jne(Number(i.maximum)),i.inclusive??!1,"smaller");if(s?.verb)return`${Ch(o??i.origin??"reik\u0161m\u0117")} ${s.verb} ${i.maximum.toString()} ${s.unit??"element\u0173"}`;let a=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Ch(o??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.maximum.toString()} ${s?.unit}`}case"too_small":{let o=n[i.origin]??i.origin,s=e(i.origin,jne(Number(i.minimum)),i.inclusive??!1,"bigger");if(s?.verb)return`${Ch(o??i.origin??"reik\u0161m\u0117")} ${s.verb} ${i.minimum.toString()} ${s.unit??"element\u0173"}`;let a=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Ch(o??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.format]??i.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${R(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=n[i.origin]??i.origin;return`${Ch(o??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function Lne(){return{localeError:Q6e()}}var Q6e,zne=y(()=>{ee();Q6e=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(i){return t[i]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},n={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${i.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${N(i.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${i.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${r[o.format]??i.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${R(i.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${i.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${i.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function Une(){return{localeError:eBe()}}var eBe,qne=y(()=>{ee();eBe=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(i){return t[i]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${N(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Terlalu besar: dijangka ${i.origin??"nilai"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Terlalu kecil: dijangka ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${R(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}}});function Bne(){return{localeError:tBe()}}var tBe,Hne=y(()=>{ee();tBe=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(i){return t[i]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},n={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${N(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin),a=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} is`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin),a=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${i.origin} ${o}${i.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${i.origin} ${o}${i.minimum.toString()} is`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}}});function Gne(){return{localeError:rBe()}}var rBe,Zne=y(()=>{ee();rBe=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(i){return t[i]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventet instanceof ${i.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${N(i.values[0])}`:`Ugyldig valg: forventet en av ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${R(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}}});function Vne(){return{localeError:nBe()}}var nBe,Wne=y(()=>{ee();nBe=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(i){return t[i]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`F\xE2sit giren: umulan instanceof ${i.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return i.values.length===1?`F\xE2sit giren: umulan ${N(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=i;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.format]??i.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${i.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${i.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function Kne(){return{localeError:iBe()}}var iBe,Jne=y(()=>{ee();iBe=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(i){return t[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${i.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return i.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${N(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${R(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.format]??i.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${i.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${i.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${R(i.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${i.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${i.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function Yne(){return{localeError:oBe()}}var oBe,Xne=y(()=>{ee();oBe=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(i){return t[i]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},n={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${i.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return i.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${N(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${i.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${i.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.format]??i.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${i.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${i.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function Qne(){return{localeError:sBe()}}var sBe,eie=y(()=>{ee();sBe=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(i){return t[i]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",number:"n\xFAmero",null:"nulo"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Tipo inv\xE1lido: esperado instanceof ${i.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: esperado ${N(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${o}${i.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Muito pequeno: esperado que ${i.origin} tivesse ${o}${i.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${r[o.format]??i.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${i.origin}`;default:return"Campo inv\xE1lido"}}}});function tie(){return{localeError:aBe()}}var aBe,rie=y(()=>{ee();aBe=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(i){return t[i]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},n={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return i.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${N(i.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} s\u0103 fie ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Prea mic: a\u0219teptat ca ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${i.origin} s\u0103 fie ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${r[o.format]??i.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${i.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${R(i.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${i.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${i.origin}`;default:return"Intrare invalid\u0103"}}}});function nie(t,e,r,n){let i=Math.abs(t),o=i%10,s=i%100;return s>=11&&s<=19?n:o===1?e:o>=2&&o<=4?r:n}function iie(){return{localeError:cBe()}}var cBe,oie=y(()=>{ee();cBe=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${N(i.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),c=nie(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${i.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),c=nie(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${i.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${i.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0438":""}: ${R(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function sie(){return{localeError:lBe()}}var lBe,aie=y(()=>{ee();lBe=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(i){return t[i]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},n={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${i.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return i.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${N(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${o}${i.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${o}${i.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.format]??i.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${R(i.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}}});function cie(){return{localeError:uBe()}}var uBe,lie=y(()=>{ee();uBe=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(i){return t[i]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},n={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${i.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return i.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${N(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${R(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${i.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function uie(){return{localeError:dBe()}}var dBe,die=y(()=>{ee();dBe=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(i){return t[i]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${i.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return i.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${N(i.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${R(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${i.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${o}${i.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${o}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${i.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${i.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${R(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function fie(){return{localeError:fBe()}}var fBe,pie=y(()=>{ee();fBe=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(i){return t[i]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},n={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${i.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return i.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${N(i.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(i.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(i.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.format]??i.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${i.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${R(i.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function mie(){return{localeError:pBe()}}var pBe,hie=y(()=>{ee();pBe=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(i){return t[i]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${i.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${N(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${o}${i.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${R(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function O$(){return{localeError:mBe()}}var mBe,EF=y(()=>{ee();mBe=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${i.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${N(i.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} \u0431\u0443\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0456":""}: ${R(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${i.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function gie(){return O$()}var yie=y(()=>{EF()});function _ie(){return{localeError:hBe()}}var hBe,bie=y(()=>{ee();hBe=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(i){return t[i]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},n={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${i.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return i.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${N(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${R(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${o}${i.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u0627 ${o}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${i.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${i.keys.length>1?"\u0632":""}: ${R(i.keys,"\u060C ")}`;case"invalid_key":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function vie(){return{localeError:gBe()}}var gBe,Sie=y(()=>{ee();gBe=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(i){return t[i]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},n={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return i.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${N(i.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.format]??i.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${i.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${i.keys.length>1?"lar":""}: ${R(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${i.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function wie(){return{localeError:yBe()}}var yBe,xie=y(()=>{ee();yBe=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(i){return t[i]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},n={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${i.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return i.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${N(i.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.format]??i.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${i.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${R(i.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function $ie(){return{localeError:_Be()}}var _Be,kie=y(()=>{ee();_Be=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(i){return t[i]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},n={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${i.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return i.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${N(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.format]??i.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${i.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${R(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${i.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function Eie(){return{localeError:bBe()}}var bBe,Aie=y(()=>{ee();bBe=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(i){return t[i]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${i.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return i.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${N(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${i.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${i.keys.length>1?"\u5011":""}\uFF1A${R(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function Tie(){return{localeError:vBe()}}var vBe,Oie=y(()=>{ee();vBe=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(i){return t[i]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},n={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${i.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return i.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${N(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin??"iye"} ${s.verb} ${o}${i.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.maximum}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin} ${s.verb} ${o}${i.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.minimum}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.format]??i.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${i.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${R(i.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var nd={};Pr(nd,{ar:()=>jre,az:()=>Fre,be:()=>Ure,bg:()=>Bre,ca:()=>Gre,cs:()=>Vre,da:()=>Kre,de:()=>Yre,el:()=>Qre,en:()=>A$,eo:()=>tne,es:()=>nne,fa:()=>one,fi:()=>ane,fr:()=>lne,frCA:()=>dne,he:()=>pne,hr:()=>hne,hu:()=>yne,hy:()=>vne,id:()=>wne,is:()=>$ne,it:()=>Ene,ja:()=>Tne,ka:()=>Rne,kh:()=>Pne,km:()=>T$,ko:()=>Dne,lt:()=>Mne,mk:()=>Lne,ms:()=>Une,nl:()=>Bne,no:()=>Gne,ota:()=>Vne,pl:()=>Yne,ps:()=>Kne,pt:()=>Qne,ro:()=>tie,ru:()=>iie,sl:()=>sie,sv:()=>cie,ta:()=>uie,th:()=>fie,tr:()=>mie,ua:()=>gie,uk:()=>O$,ur:()=>_ie,uz:()=>vie,vi:()=>wie,yo:()=>Tie,zhCN:()=>$ie,zhTW:()=>Eie});var R$=y(()=>{Mre();Lre();qre();Hre();Zre();Wre();Jre();Xre();ene();$F();rne();ine();sne();cne();une();fne();mne();gne();_ne();Sne();xne();kne();Ane();One();Ine();Cne();kF();Nne();Fne();zne();qne();Hne();Zne();Wne();Jne();Xne();eie();rie();oie();aie();lie();die();pie();hie();yie();EF();bie();Sie();xie();kie();Aie();Oie()});function P$(){return new I$}var Rie,AF,TF,I$,ir,Dh=y(()=>{AF=Symbol("ZodOutput"),TF=Symbol("ZodInput"),I$=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(Rie=globalThis).__zod_globalRegistry??(Rie.__zod_globalRegistry=P$());ir=globalThis.__zod_globalRegistry});function C$(t,e){return new t({type:"string",...U(e)})}function OF(t,e){return new t({type:"string",coerce:!0,...U(e)})}function Nh(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...U(e)})}function id(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...U(e)})}function jh(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...U(e)})}function Mh(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...U(e)})}function Fh(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...U(e)})}function Lh(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...U(e)})}function od(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...U(e)})}function zh(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...U(e)})}function Uh(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...U(e)})}function qh(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...U(e)})}function Bh(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...U(e)})}function Hh(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...U(e)})}function Gh(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...U(e)})}function Zh(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...U(e)})}function Vh(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...U(e)})}function Wh(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...U(e)})}function D$(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...U(e)})}function Kh(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...U(e)})}function Jh(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...U(e)})}function Yh(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...U(e)})}function Xh(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...U(e)})}function Qh(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...U(e)})}function eg(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...U(e)})}function IF(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...U(e)})}function PF(t,e){return new t({type:"string",format:"date",check:"string_format",...U(e)})}function CF(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...U(e)})}function DF(t,e){return new t({type:"string",format:"duration",check:"string_format",...U(e)})}function N$(t,e){return new t({type:"number",checks:[],...U(e)})}function NF(t,e){return new t({type:"number",coerce:!0,checks:[],...U(e)})}function j$(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...U(e)})}function M$(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...U(e)})}function F$(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...U(e)})}function L$(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...U(e)})}function z$(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...U(e)})}function U$(t,e){return new t({type:"boolean",...U(e)})}function jF(t,e){return new t({type:"boolean",coerce:!0,...U(e)})}function q$(t,e){return new t({type:"bigint",...U(e)})}function MF(t,e){return new t({type:"bigint",coerce:!0,...U(e)})}function B$(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...U(e)})}function H$(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...U(e)})}function G$(t,e){return new t({type:"symbol",...U(e)})}function Z$(t,e){return new t({type:"undefined",...U(e)})}function V$(t,e){return new t({type:"null",...U(e)})}function W$(t){return new t({type:"any"})}function K$(t){return new t({type:"unknown"})}function J$(t,e){return new t({type:"never",...U(e)})}function Y$(t,e){return new t({type:"void",...U(e)})}function X$(t,e){return new t({type:"date",...U(e)})}function FF(t,e){return new t({type:"date",coerce:!0,...U(e)})}function Q$(t,e){return new t({type:"nan",...U(e)})}function Xi(t,e){return new y0({check:"less_than",...U(e),value:t,inclusive:!1})}function Sn(t,e){return new y0({check:"less_than",...U(e),value:t,inclusive:!0})}function Qi(t,e){return new _0({check:"greater_than",...U(e),value:t,inclusive:!1})}function Er(t,e){return new _0({check:"greater_than",...U(e),value:t,inclusive:!0})}function ek(t){return Qi(0,t)}function tk(t){return Xi(0,t)}function rk(t){return Sn(0,t)}function nk(t){return Er(0,t)}function qs(t,e){return new WM({check:"multiple_of",...U(e),value:t})}function Bs(t,e){return new YM({check:"max_size",...U(e),maximum:t})}function eo(t,e){return new XM({check:"min_size",...U(e),minimum:t})}function Tc(t,e){return new QM({check:"size_equals",...U(e),size:t})}function Oc(t,e){return new eF({check:"max_length",...U(e),maximum:t})}function Uo(t,e){return new tF({check:"min_length",...U(e),minimum:t})}function Rc(t,e){return new rF({check:"length_equals",...U(e),length:t})}function sd(t,e){return new nF({check:"string_format",format:"regex",...U(e),pattern:t})}function ad(t){return new iF({check:"string_format",format:"lowercase",...U(t)})}function cd(t){return new oF({check:"string_format",format:"uppercase",...U(t)})}function ld(t,e){return new sF({check:"string_format",format:"includes",...U(e),includes:t})}function ud(t,e){return new aF({check:"string_format",format:"starts_with",...U(e),prefix:t})}function dd(t,e){return new cF({check:"string_format",format:"ends_with",...U(e),suffix:t})}function ik(t,e,r){return new lF({check:"property",property:t,schema:e,...U(r)})}function fd(t,e){return new uF({check:"mime_type",mime:t,...U(e)})}function pi(t){return new dF({check:"overwrite",tx:t})}function pd(t){return pi(e=>e.normalize(t))}function md(){return pi(t=>t.trim())}function hd(){return pi(t=>t.toLowerCase())}function gd(){return pi(t=>t.toUpperCase())}function yd(){return pi(t=>cM(t))}function LF(t,e,r){return new t({type:"array",element:e,...U(r)})}function wBe(t,e,r){return new t({type:"union",options:e,...U(r)})}function xBe(t,e,r){return new t({type:"union",options:e,inclusive:!1,...U(r)})}function $Be(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...U(n)})}function kBe(t,e,r){return new t({type:"intersection",left:e,right:r})}function EBe(t,e,r,n){let i=r instanceof ue,o=i?n:r,s=i?r:null;return new t({type:"tuple",items:e,rest:s,...U(o)})}function ABe(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...U(n)})}function TBe(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...U(n)})}function OBe(t,e,r){return new t({type:"set",valueType:e,...U(r)})}function RBe(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new t({type:"enum",entries:n,...U(r)})}function IBe(t,e,r){return new t({type:"enum",entries:e,...U(r)})}function PBe(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...U(r)})}function ok(t,e){return new t({type:"file",...U(e)})}function CBe(t,e){return new t({type:"transform",transform:e})}function DBe(t,e){return new t({type:"optional",innerType:e})}function NBe(t,e){return new t({type:"nullable",innerType:e})}function jBe(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():o0(r)}})}function MBe(t,e,r){return new t({type:"nonoptional",innerType:e,...U(r)})}function FBe(t,e){return new t({type:"success",innerType:e})}function LBe(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function zBe(t,e,r){return new t({type:"pipe",in:e,out:r})}function UBe(t,e){return new t({type:"readonly",innerType:e})}function qBe(t,e,r){return new t({type:"template_literal",parts:e,...U(r)})}function BBe(t,e){return new t({type:"lazy",getter:e})}function HBe(t,e){return new t({type:"promise",innerType:e})}function sk(t,e,r){let n=U(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function ak(t,e,r){return new t({type:"custom",check:"custom",fn:e,...U(r)})}function ck(t,e){let r=Iie(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(Vu(i,n.value,r._zod.def));else{let o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),n.issues.push(Vu(o))}},t(n.value,n)),e);return r}function Iie(t,e){let r=new Qe({check:"custom",...U(e)});return r._zod.check=t,r}function lk(t){let e=new Qe({check:"describe"});return e._zod.onattach=[r=>{let n=ir.get(r)??{};ir.add(r,{...n,description:t})}],e._zod.check=()=>{},e}function uk(t){let e=new Qe({check:"meta"});return e._zod.onattach=[r=>{let n=ir.get(r)??{};ir.add(r,{...n,...t})}],e._zod.check=()=>{},e}function dk(t,e){let r=U(e),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(p=>typeof p=="string"?p.toLowerCase():p),i=i.map(p=>typeof p=="string"?p.toLowerCase():p));let o=new Set(n),s=new Set(i),a=t.Codec??td,c=t.Boolean??Qu,l=t.String??Us,u=new l({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),f=new a({type:"pipe",in:u,out:d,transform:((p,m)=>{let h=p;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:s.has(h)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:f,continue:!1}),{})}),reverseTransform:((p,m)=>p===!0?n[0]||"true":i[0]||"false"),error:r.error});return f}function Ic(t,e,r,n={}){let i=U(n),o={...U(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...i};return r instanceof RegExp&&(o.pattern=r),new t(o)}var RF,Pie=y(()=>{b0();Dh();xF();ee();RF={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Hs(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??ir,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Ve(t,e,r={path:[],schemaPath:[]}){var n;let i=t._zod.def,o=e.seen.get(t);if(o)return o.count++,r.schemaPath.includes(t)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,s);let a=t._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,u);else{let f=s.schema,p=e.processors[i.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);p(t,e,f,u)}let d=t._zod.parent;d&&(s.ref||(s.ref=d),Ve(d,e,u),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(s.schema,c),e.io==="input"&&Ar(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function Gs(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let s of t.seen.entries()){let a=t.metadataRegistry.get(s[0])?.id;if(a){let c=n.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0])}}let i=s=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(s[0])?.id,f=t.external.uri??(m=>m);if(d)return{ref:f(d)};let p=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=p,{defId:p,ref:`${f("__shared")}#/${a}/${p}`}}if(s[1]===r)return{ref:"#"};let l=`#/${a}/`,u=s[1].schema.id??`__schema${t.counter++}`;return{defId:u,ref:l+u}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=i(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let d in u)delete u[d];u.$ref=c};if(t.cycles==="throw")for(let s of t.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(t.external){let l=t.external.registry.get(s[0])?.id;if(e!==s[0]&&l){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&t.reused==="ref"){o(s);continue}}}function Zs(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=t.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){n(d);let p=t.seen.get(d),m=p.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):Object.assign(l,m),Object.assign(l,u),a._zod.parent===d)for(let g in l)g==="$ref"||g==="allOf"||g in u||delete l[g];if(m.$ref&&p.def)for(let g in l)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(l[g])===JSON.stringify(p.def[g])&&delete l[g]}let f=a._zod.parent;if(f&&f!==d){n(f);let p=t.seen.get(f);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(let m in l)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(l[m])===JSON.stringify(p.def[m])&&delete l[m]}t.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())n(a[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(a)}Object.assign(i,r.def??r.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&i.id===o&&delete i.id;let s=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,s[c.defId]=c.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{let a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:_d(e,"input",t.processors),output:_d(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ar(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ar(n.element,r);if(n.type==="set")return Ar(n.valueType,r);if(n.type==="lazy")return Ar(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Ar(n.innerType,r);if(n.type==="intersection")return Ar(n.left,r)||Ar(n.right,r);if(n.type==="record"||n.type==="map")return Ar(n.keyType,r)||Ar(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Ar(n.in,r)||Ar(n.out,r);if(n.type==="object"){for(let i in n.shape)if(Ar(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(Ar(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(Ar(i,r))return!0;return!!(n.rest&&Ar(n.rest,r))}return!1}var zF,_d,tg=y(()=>{Dh();zF=(t,e={})=>r=>{let n=Hs({...r,processors:e});return Ve(t,n),Gs(n,t),Zs(n,t)},_d=(t,e,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},s=Hs({...i??{},target:o,io:e,processors:r});return Ve(t,s),Gs(s,t),Zs(s,t)}});function Pc(t,e){if("_idmap"in t){let n=t,i=Hs({...e,processors:fk}),o={};for(let c of n._idmap.entries()){let[l,u]=c;Ve(u,i)}let s={},a={registry:n,uri:e?.uri,defs:o};i.external=a;for(let c of n._idmap.entries()){let[l,u]=c;Gs(i,u),s[l]=Zs(i,u)}if(Object.keys(o).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=Hs({...e,processors:fk});return Ve(t,r),Gs(r,t),Zs(r,t)}var GBe,UF,qF,BF,HF,GF,ZF,VF,WF,KF,JF,YF,XF,QF,eL,tL,rL,nL,iL,oL,sL,aL,cL,lL,uL,dL,pk,fL,pL,mL,hL,gL,yL,_L,bL,vL,SL,wL,mk,xL,fk,bd=y(()=>{tg();ee();GBe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},UF=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof s=="number"&&(i.maxLength=s),a&&(i.format=GBe[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},qF=(t,e,r,n)=>{let i=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number";let d=typeof u=="number"&&u>=(o??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(s??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof o=="number"&&(i.minimum=o),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof s=="number"&&(i.maximum=s),typeof c=="number"&&(i.multipleOf=c)},BF=(t,e,r,n)=>{r.type="boolean"},HF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},GF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},ZF=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},VF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},WF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},KF=(t,e,r,n)=>{r.not={}},JF=(t,e,r,n)=>{},YF=(t,e,r,n)=>{},XF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},QF=(t,e,r,n)=>{let i=t._zod.def,o=yh(i.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},eL=(t,e,r,n)=>{let i=t._zod.def,o=[];for(let s of i.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},tL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},rL=(t,e,r,n)=>{let i=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},nL=(t,e,r,n)=>{let i=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(i,o)},iL=(t,e,r,n)=>{r.type="boolean"},oL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},sL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},aL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},cL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},lL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},uL=(t,e,r,n)=>{let i=r,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=Ve(o.element,e,{...n,path:[...n.path,"items"]})},dL=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="object",i.properties={};let s=o.shape;for(let l in s)i.properties[l]=Ve(s[l],e,{...n,path:[...n.path,"properties",l]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(l=>{let u=o.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(i.required=Array.from(c)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=Ve(o.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},pk=(t,e,r,n)=>{let i=t._zod.def,o=i.inclusive===!1,s=i.options.map((a,c)=>Ve(a,e,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},fL=(t,e,r,n)=>{let i=t._zod.def,o=Ve(i.left,e,{...n,path:[...n.path,"allOf",0]}),s=Ve(i.right,e,{...n,path:[...n.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},pL=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((f,p)=>Ve(f,e,{...n,path:[...n.path,s,p]})),l=o.rest?Ve(o.rest,e,{...n,path:[...n.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=c,l&&(i.items=l)):e.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(i.minItems=u),typeof d=="number"&&(i.maxItems=d)},mL=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let u=Ve(o.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let d of c)i.patternProperties[d.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Ve(o.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=Ve(o.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(i.required=u)}},hL=(t,e,r,n)=>{let i=t._zod.def,o=Ve(i.innerType,e,n),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},gL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},yL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},_L=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},bL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},vL=(t,e,r,n)=>{let i=t._zod.def,o=i.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?i.out:i.in:i.out;Ve(s,e,n);let a=e.seen.get(t);a.ref=s},SL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,r.readOnly=!0},wL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},mk=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},xL=(t,e,r,n)=>{let i=t._zod.innerType;Ve(i,e,n);let o=e.seen.get(t);o.ref=i},fk={string:UF,number:qF,boolean:BF,bigint:HF,symbol:GF,null:ZF,undefined:VF,void:WF,never:KF,any:JF,unknown:YF,date:XF,enum:QF,literal:eL,nan:tL,template_literal:rL,file:nL,success:iL,custom:oL,function:sL,transform:aL,map:cL,set:lL,array:uL,object:dL,union:pk,intersection:fL,tuple:pL,record:mL,nullable:hL,nonoptional:gL,default:yL,prefault:_L,catch:bL,pipe:vL,readonly:SL,promise:wL,optional:mk,lazy:xL}});var hk,Cie=y(()=>{bd();tg();hk=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Hs({processors:fk,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return Ve(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Gs(this.ctx,e);let n=Zs(this.ctx,e),{"~standard":i,...o}=n;return o}}});var Die={};var Nie=y(()=>{});var mi={};Pr(mi,{$ZodAny:()=>J0,$ZodArray:()=>t$,$ZodAsyncError:()=>fi,$ZodBase64:()=>z0,$ZodBase64URL:()=>U0,$ZodBigInt:()=>Oh,$ZodBigIntFormat:()=>Z0,$ZodBoolean:()=>Qu,$ZodCIDRv4:()=>F0,$ZodCIDRv6:()=>L0,$ZodCUID:()=>R0,$ZodCUID2:()=>I0,$ZodCatch:()=>b$,$ZodCheck:()=>Qe,$ZodCheckBigIntFormat:()=>JM,$ZodCheckEndsWith:()=>cF,$ZodCheckGreaterThan:()=>_0,$ZodCheckIncludes:()=>sF,$ZodCheckLengthEquals:()=>rF,$ZodCheckLessThan:()=>y0,$ZodCheckLowerCase:()=>iF,$ZodCheckMaxLength:()=>eF,$ZodCheckMaxSize:()=>YM,$ZodCheckMimeType:()=>uF,$ZodCheckMinLength:()=>tF,$ZodCheckMinSize:()=>XM,$ZodCheckMultipleOf:()=>WM,$ZodCheckNumberFormat:()=>KM,$ZodCheckOverwrite:()=>dF,$ZodCheckProperty:()=>lF,$ZodCheckRegex:()=>nF,$ZodCheckSizeEquals:()=>QM,$ZodCheckStartsWith:()=>aF,$ZodCheckStringFormat:()=>Xu,$ZodCheckUpperCase:()=>oF,$ZodCodec:()=>td,$ZodCustom:()=>E$,$ZodCustomStringFormat:()=>H0,$ZodDate:()=>e$,$ZodDefault:()=>h$,$ZodDiscriminatedUnion:()=>i$,$ZodE164:()=>q0,$ZodEmail:()=>E0,$ZodEmoji:()=>T0,$ZodEncodeError:()=>Ds,$ZodEnum:()=>l$,$ZodError:()=>wh,$ZodExactOptional:()=>p$,$ZodFile:()=>d$,$ZodFunction:()=>x$,$ZodGUID:()=>$0,$ZodIPv4:()=>N0,$ZodIPv6:()=>j0,$ZodISODate:()=>yF,$ZodISODateTime:()=>gF,$ZodISODuration:()=>bF,$ZodISOTime:()=>_F,$ZodIntersection:()=>o$,$ZodJWT:()=>B0,$ZodKSUID:()=>D0,$ZodLazy:()=>k$,$ZodLiteral:()=>u$,$ZodMAC:()=>M0,$ZodMap:()=>a$,$ZodNaN:()=>v$,$ZodNanoID:()=>O0,$ZodNever:()=>X0,$ZodNonOptional:()=>y$,$ZodNull:()=>K0,$ZodNullable:()=>m$,$ZodNumber:()=>Th,$ZodNumberFormat:()=>G0,$ZodObject:()=>r$,$ZodObjectJIT:()=>SF,$ZodOptional:()=>Ih,$ZodPipe:()=>Ph,$ZodPrefault:()=>g$,$ZodPreprocess:()=>wF,$ZodPromise:()=>$$,$ZodReadonly:()=>S$,$ZodRealError:()=>Hr,$ZodRecord:()=>s$,$ZodRegistry:()=>I$,$ZodSet:()=>c$,$ZodString:()=>Us,$ZodStringFormat:()=>We,$ZodSuccess:()=>_$,$ZodSymbol:()=>V0,$ZodTemplateLiteral:()=>w$,$ZodTransform:()=>f$,$ZodTuple:()=>Rh,$ZodType:()=>ue,$ZodULID:()=>P0,$ZodURL:()=>A0,$ZodUUID:()=>k0,$ZodUndefined:()=>W0,$ZodUnion:()=>ed,$ZodUnknown:()=>Y0,$ZodVoid:()=>Q0,$ZodXID:()=>C0,$ZodXor:()=>n$,$brand:()=>iM,$constructor:()=>k,$input:()=>TF,$output:()=>AF,Doc:()=>Ah,JSONSchema:()=>Die,JSONSchemaGenerator:()=>hk,NEVER:()=>nM,TimePrecision:()=>RF,_any:()=>W$,_array:()=>LF,_base64:()=>Yh,_base64url:()=>Xh,_bigint:()=>q$,_boolean:()=>U$,_catch:()=>LBe,_check:()=>Iie,_cidrv4:()=>Kh,_cidrv6:()=>Jh,_coercedBigint:()=>MF,_coercedBoolean:()=>jF,_coercedDate:()=>FF,_coercedNumber:()=>NF,_coercedString:()=>OF,_cuid:()=>qh,_cuid2:()=>Bh,_custom:()=>sk,_date:()=>X$,_decode:()=>a0,_decodeAsync:()=>l0,_default:()=>jBe,_discriminatedUnion:()=>$Be,_e164:()=>Qh,_email:()=>Nh,_emoji:()=>zh,_encode:()=>s0,_encodeAsync:()=>c0,_endsWith:()=>dd,_enum:()=>RBe,_file:()=>ok,_float32:()=>M$,_float64:()=>F$,_gt:()=>Qi,_gte:()=>Er,_guid:()=>id,_includes:()=>ld,_int:()=>j$,_int32:()=>L$,_int64:()=>B$,_intersection:()=>kBe,_ipv4:()=>Vh,_ipv6:()=>Wh,_isoDate:()=>PF,_isoDateTime:()=>IF,_isoDuration:()=>DF,_isoTime:()=>CF,_jwt:()=>eg,_ksuid:()=>Zh,_lazy:()=>BBe,_length:()=>Rc,_literal:()=>PBe,_lowercase:()=>ad,_lt:()=>Xi,_lte:()=>Sn,_mac:()=>D$,_map:()=>TBe,_max:()=>Sn,_maxLength:()=>Oc,_maxSize:()=>Bs,_mime:()=>fd,_min:()=>Er,_minLength:()=>Uo,_minSize:()=>eo,_multipleOf:()=>qs,_nan:()=>Q$,_nanoid:()=>Uh,_nativeEnum:()=>IBe,_negative:()=>tk,_never:()=>J$,_nonnegative:()=>nk,_nonoptional:()=>MBe,_nonpositive:()=>rk,_normalize:()=>pd,_null:()=>V$,_nullable:()=>NBe,_number:()=>N$,_optional:()=>DBe,_overwrite:()=>pi,_parse:()=>Wu,_parseAsync:()=>Ku,_pipe:()=>zBe,_positive:()=>ek,_promise:()=>HBe,_property:()=>ik,_readonly:()=>UBe,_record:()=>ABe,_refine:()=>ak,_regex:()=>sd,_safeDecode:()=>d0,_safeDecodeAsync:()=>p0,_safeEncode:()=>u0,_safeEncodeAsync:()=>f0,_safeParse:()=>Ju,_safeParseAsync:()=>Yu,_set:()=>OBe,_size:()=>Tc,_slugify:()=>yd,_startsWith:()=>ud,_string:()=>C$,_stringFormat:()=>Ic,_stringbool:()=>dk,_success:()=>FBe,_superRefine:()=>ck,_symbol:()=>G$,_templateLiteral:()=>qBe,_toLowerCase:()=>hd,_toUpperCase:()=>gd,_transform:()=>CBe,_trim:()=>md,_tuple:()=>EBe,_uint32:()=>z$,_uint64:()=>H$,_ulid:()=>Hh,_undefined:()=>Z$,_union:()=>wBe,_unknown:()=>K$,_uppercase:()=>cd,_url:()=>od,_uuid:()=>jh,_uuidv4:()=>Mh,_uuidv6:()=>Fh,_uuidv7:()=>Lh,_void:()=>Y$,_xid:()=>Gh,_xor:()=>xBe,clone:()=>nr,config:()=>Tt,createStandardJSONSchemaMethod:()=>_d,createToJSONSchemaMethod:()=>zF,decode:()=>ore,decodeAsync:()=>are,describe:()=>lk,encode:()=>ire,encodeAsync:()=>sre,extractDefs:()=>Gs,finalize:()=>Zs,flattenError:()=>xh,formatError:()=>$h,globalConfig:()=>wc,globalRegistry:()=>ir,initializeContext:()=>Hs,isValidBase64:()=>vF,isValidBase64URL:()=>Pre,isValidJWT:()=>Cre,locales:()=>nd,meta:()=>uk,parse:()=>kc,parseAsync:()=>Ec,prettifyError:()=>gM,process:()=>Ve,regexes:()=>Gr,registry:()=>P$,safeDecode:()=>lre,safeDecodeAsync:()=>dre,safeEncode:()=>cre,safeEncodeAsync:()=>ure,safeParse:()=>Ls,safeParseAsync:()=>zs,toDotPath:()=>nre,toJSONSchema:()=>Pc,treeifyError:()=>hM,util:()=>M,version:()=>pF});var mr=y(()=>{xc();_M();yM();xF();b0();mF();ee();g0();R$();Dh();fF();Pie();tg();bd();Cie();Nie()});var $L=y(()=>{mr()});function kL(t,e){let r={type:"object",shape:t??{},...U(e)};return new KBe(r)}var WBe,KBe,jie=y(()=>{mr();ee();$L();WBe=k("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");ue.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>kc(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Ls(t,r,n),t.parseAsync=async(r,n)=>Ec(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>zs(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>nr(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),KBe=k("ZodMiniObject",(t,e)=>{r$.init(t,e),WBe.init(t,e),ve(t,"shape",()=>e.shape)})});var Mie=y(()=>{});var Fie=y(()=>{});var Lie=y(()=>{});var zie=y(()=>{mr();$L();jie();Mie();bd();R$();Fie();Lie()});var EL=y(()=>{zie()});function Ln(t){return!!t._zod}function Cc(t){let e=Object.values(t);if(e.length===0)return kL({});let r=e.every(Ln),n=e.every(i=>!Ln(i));if(r)return kL(t);if(n)return Bte(t);throw new Error("Mixed Zod versions detected in object shape.")}function Vs(t,e){return Ln(t)?Ls(t,e):t.safeParse(e)}async function gk(t,e){return Ln(t)?await zs(t,e):await t.safeParseAsync(e)}function Ws(t){if(!t)return;let e;if(Ln(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function vd(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let n=Object.values(t);if(n.length>0&&n.every(i=>typeof i=="object"&&i!==null&&(i._def!==void 0||i._zod!==void 0||typeof i.parse=="function")))return Cc(t)}}if(Ln(t)){let r=t._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function yk(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function qie(t){return t.description}function Bie(t){if(Ln(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function _k(t){if(Ln(t)){let o=t._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}var rg=y(()=>{hh();EL()});var bk={};Pr(bk,{endsWith:()=>dd,gt:()=>Qi,gte:()=>Er,includes:()=>ld,length:()=>Rc,lowercase:()=>ad,lt:()=>Xi,lte:()=>Sn,maxLength:()=>Oc,maxSize:()=>Bs,mime:()=>fd,minLength:()=>Uo,minSize:()=>eo,multipleOf:()=>qs,negative:()=>tk,nonnegative:()=>nk,nonpositive:()=>rk,normalize:()=>pd,overwrite:()=>pi,positive:()=>ek,property:()=>ik,regex:()=>sd,size:()=>Tc,slugify:()=>yd,startsWith:()=>ud,toLowerCase:()=>hd,toUpperCase:()=>gd,trim:()=>md,uppercase:()=>cd});var vk=y(()=>{mr()});var Ks={};Pr(Ks,{ZodISODate:()=>wk,ZodISODateTime:()=>Sk,ZodISODuration:()=>$k,ZodISOTime:()=>xk,date:()=>TL,datetime:()=>AL,duration:()=>RL,time:()=>OL});function AL(t){return IF(Sk,t)}function TL(t){return PF(wk,t)}function OL(t){return CF(xk,t)}function RL(t){return DF($k,t)}var Sk,wk,xk,$k,ng=y(()=>{mr();og();Sk=k("ZodISODateTime",(t,e)=>{gF.init(t,e),et.init(t,e)});wk=k("ZodISODate",(t,e)=>{yF.init(t,e),et.init(t,e)});xk=k("ZodISOTime",(t,e)=>{_F.init(t,e),et.init(t,e)});$k=k("ZodISODuration",(t,e)=>{bF.init(t,e),et.init(t,e)})});var Hie,XBe,Zr,IL=y(()=>{mr();mr();ee();Hie=(t,e)=>{wh.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>$h(t,r)},flatten:{value:r=>xh(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Gu,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Gu,2)}},isEmpty:{get(){return t.issues.length===0}}})},XBe=k("ZodError",Hie),Zr=k("ZodError",Hie,{Parent:Error})});var PL,CL,DL,NL,jL,ML,FL,LL,zL,UL,qL,BL,HL=y(()=>{mr();IL();PL=Wu(Zr),CL=Ku(Zr),DL=Ju(Zr),NL=Yu(Zr),jL=s0(Zr),ML=a0(Zr),FL=c0(Zr),LL=l0(Zr),zL=u0(Zr),UL=d0(Zr),qL=f0(Zr),BL=p0(Zr)});var ig={};Pr(ig,{ZodAny:()=>KL,ZodArray:()=>QL,ZodBase64:()=>zk,ZodBase64URL:()=>Uk,ZodBigInt:()=>Ad,ZodBigIntFormat:()=>Hk,ZodBoolean:()=>Ed,ZodCIDRv4:()=>Fk,ZodCIDRv6:()=>Lk,ZodCUID:()=>Ik,ZodCUID2:()=>Pk,ZodCatch:()=>bz,ZodCodec:()=>gg,ZodCustom:()=>yg,ZodCustomStringFormat:()=>$d,ZodDate:()=>dg,ZodDefault:()=>pz,ZodDiscriminatedUnion:()=>tz,ZodE164:()=>qk,ZodEmail:()=>Tk,ZodEmoji:()=>Ok,ZodEnum:()=>wd,ZodExactOptional:()=>uz,ZodFile:()=>cz,ZodFunction:()=>Oz,ZodGUID:()=>sg,ZodIPv4:()=>jk,ZodIPv6:()=>Mk,ZodIntersection:()=>rz,ZodJWT:()=>Bk,ZodKSUID:()=>Nk,ZodLazy:()=>Ez,ZodLiteral:()=>az,ZodMAC:()=>GL,ZodMap:()=>oz,ZodNaN:()=>Sz,ZodNanoID:()=>Rk,ZodNever:()=>YL,ZodNonOptional:()=>Vk,ZodNull:()=>WL,ZodNullable:()=>fz,ZodNumber:()=>kd,ZodNumberFormat:()=>Dc,ZodObject:()=>fg,ZodOptional:()=>Od,ZodPipe:()=>hg,ZodPrefault:()=>hz,ZodPreprocess:()=>wz,ZodPromise:()=>Tz,ZodReadonly:()=>xz,ZodRecord:()=>Sd,ZodSet:()=>sz,ZodString:()=>xd,ZodStringFormat:()=>et,ZodSuccess:()=>_z,ZodSymbol:()=>ZL,ZodTemplateLiteral:()=>kz,ZodTransform:()=>lz,ZodTuple:()=>nz,ZodType:()=>_e,ZodULID:()=>Ck,ZodURL:()=>lg,ZodUUID:()=>to,ZodUndefined:()=>VL,ZodUnion:()=>pg,ZodUnknown:()=>JL,ZodVoid:()=>XL,ZodXID:()=>Dk,ZodXor:()=>ez,_ZodString:()=>Ak,_default:()=>mz,_function:()=>Woe,any:()=>Ooe,array:()=>ke,base64:()=>foe,base64url:()=>poe,bigint:()=>$oe,boolean:()=>It,catch:()=>vz,check:()=>Koe,cidrv4:()=>uoe,cidrv6:()=>doe,codec:()=>Hoe,cuid:()=>roe,cuid2:()=>noe,custom:()=>Wk,date:()=>Ioe,describe:()=>Joe,discriminatedUnion:()=>mg,e164:()=>moe,email:()=>Zie,emoji:()=>eoe,enum:()=>sr,exactOptional:()=>dz,file:()=>zoe,float32:()=>voe,float64:()=>Soe,function:()=>Woe,guid:()=>Vie,hash:()=>boe,hex:()=>_oe,hostname:()=>yoe,httpUrl:()=>Qie,instanceof:()=>Xoe,int:()=>kk,int32:()=>woe,int64:()=>koe,intersection:()=>Td,invertCodec:()=>Goe,ipv4:()=>aoe,ipv6:()=>loe,json:()=>ese,jwt:()=>hoe,keyof:()=>Poe,ksuid:()=>soe,lazy:()=>Az,literal:()=>re,looseObject:()=>or,looseRecord:()=>joe,mac:()=>coe,map:()=>Moe,meta:()=>Yoe,nan:()=>Boe,nanoid:()=>toe,nativeEnum:()=>Loe,never:()=>Gk,nonoptional:()=>yz,null:()=>ug,nullable:()=>ag,nullish:()=>Uoe,number:()=>Me,object:()=>W,optional:()=>at,partialRecord:()=>Noe,pipe:()=>Ek,prefault:()=>gz,preprocess:()=>_g,promise:()=>Voe,readonly:()=>$z,record:()=>Ke,refine:()=>Rz,set:()=>Foe,strictObject:()=>Coe,string:()=>I,stringFormat:()=>goe,stringbool:()=>Qoe,success:()=>qoe,superRefine:()=>Iz,symbol:()=>Aoe,templateLiteral:()=>Zoe,transform:()=>Zk,tuple:()=>iz,uint32:()=>xoe,uint64:()=>Eoe,ulid:()=>ioe,undefined:()=>Toe,union:()=>rt,unknown:()=>tt,url:()=>Xie,uuid:()=>Wie,uuidv4:()=>Kie,uuidv6:()=>Jie,uuidv7:()=>Yie,void:()=>Roe,xid:()=>ooe,xor:()=>Doe});function cg(t,e,r){let n=Object.getPrototypeOf(t),i=Gie.get(n);if(i||(i=new Set,Gie.set(n,i)),!i.has(e)){i.add(e);for(let o in r){let s=r[o];Object.defineProperty(n,o,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}function I(t){return C$(xd,t)}function Zie(t){return Nh(Tk,t)}function Vie(t){return id(sg,t)}function Wie(t){return jh(to,t)}function Kie(t){return Mh(to,t)}function Jie(t){return Fh(to,t)}function Yie(t){return Lh(to,t)}function Xie(t){return od(lg,t)}function Qie(t){return od(lg,{protocol:Gr.httpProtocol,hostname:Gr.domain,...M.normalizeParams(t)})}function eoe(t){return zh(Ok,t)}function toe(t){return Uh(Rk,t)}function roe(t){return qh(Ik,t)}function noe(t){return Bh(Pk,t)}function ioe(t){return Hh(Ck,t)}function ooe(t){return Gh(Dk,t)}function soe(t){return Zh(Nk,t)}function aoe(t){return Vh(jk,t)}function coe(t){return D$(GL,t)}function loe(t){return Wh(Mk,t)}function uoe(t){return Kh(Fk,t)}function doe(t){return Jh(Lk,t)}function foe(t){return Yh(zk,t)}function poe(t){return Xh(Uk,t)}function moe(t){return Qh(qk,t)}function hoe(t){return eg(Bk,t)}function goe(t,e,r={}){return Ic($d,t,e,r)}function yoe(t){return Ic($d,"hostname",Gr.hostname,t)}function _oe(t){return Ic($d,"hex",Gr.hex,t)}function boe(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Gr[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Ic($d,n,i,e)}function Me(t){return N$(kd,t)}function kk(t){return j$(Dc,t)}function voe(t){return M$(Dc,t)}function Soe(t){return F$(Dc,t)}function woe(t){return L$(Dc,t)}function xoe(t){return z$(Dc,t)}function It(t){return U$(Ed,t)}function $oe(t){return q$(Ad,t)}function koe(t){return B$(Hk,t)}function Eoe(t){return H$(Hk,t)}function Aoe(t){return G$(ZL,t)}function Toe(t){return Z$(VL,t)}function ug(t){return V$(WL,t)}function Ooe(){return W$(KL)}function tt(){return K$(JL)}function Gk(t){return J$(YL,t)}function Roe(t){return Y$(XL,t)}function Ioe(t){return X$(dg,t)}function ke(t,e){return LF(QL,t,e)}function Poe(t){let e=t._zod.def.shape;return sr(Object.keys(e))}function W(t,e){let r={type:"object",shape:t??{},...M.normalizeParams(e)};return new fg(r)}function Coe(t,e){return new fg({type:"object",shape:t,catchall:Gk(),...M.normalizeParams(e)})}function or(t,e){return new fg({type:"object",shape:t,catchall:tt(),...M.normalizeParams(e)})}function rt(t,e){return new pg({type:"union",options:t,...M.normalizeParams(e)})}function Doe(t,e){return new ez({type:"union",options:t,inclusive:!1,...M.normalizeParams(e)})}function mg(t,e,r){return new tz({type:"union",options:e,discriminator:t,...M.normalizeParams(r)})}function Td(t,e){return new rz({type:"intersection",left:t,right:e})}function iz(t,e,r){let n=e instanceof ue,i=n?r:e,o=n?e:null;return new nz({type:"tuple",items:t,rest:o,...M.normalizeParams(i)})}function Ke(t,e,r){return!e||!e._zod?new Sd({type:"record",keyType:I(),valueType:t,...M.normalizeParams(e)}):new Sd({type:"record",keyType:t,valueType:e,...M.normalizeParams(r)})}function Noe(t,e,r){let n=nr(t);return n._zod.values=void 0,new Sd({type:"record",keyType:n,valueType:e,...M.normalizeParams(r)})}function joe(t,e,r){return new Sd({type:"record",keyType:t,valueType:e,mode:"loose",...M.normalizeParams(r)})}function Moe(t,e,r){return new oz({type:"map",keyType:t,valueType:e,...M.normalizeParams(r)})}function Foe(t,e){return new sz({type:"set",valueType:t,...M.normalizeParams(e)})}function sr(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new wd({type:"enum",entries:r,...M.normalizeParams(e)})}function Loe(t,e){return new wd({type:"enum",entries:t,...M.normalizeParams(e)})}function re(t,e){return new az({type:"literal",values:Array.isArray(t)?t:[t],...M.normalizeParams(e)})}function zoe(t){return ok(cz,t)}function Zk(t){return new lz({type:"transform",transform:t})}function at(t){return new Od({type:"optional",innerType:t})}function dz(t){return new uz({type:"optional",innerType:t})}function ag(t){return new fz({type:"nullable",innerType:t})}function Uoe(t){return at(ag(t))}function mz(t,e){return new pz({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():M.shallowClone(e)}})}function gz(t,e){return new hz({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():M.shallowClone(e)}})}function yz(t,e){return new Vk({type:"nonoptional",innerType:t,...M.normalizeParams(e)})}function qoe(t){return new _z({type:"success",innerType:t})}function vz(t,e){return new bz({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function Boe(t){return Q$(Sz,t)}function Ek(t,e){return new hg({type:"pipe",in:t,out:e})}function Hoe(t,e,r){return new gg({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function Goe(t){let e=t._zod.def;return new gg({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function $z(t){return new xz({type:"readonly",innerType:t})}function Zoe(t,e){return new kz({type:"template_literal",parts:t,...M.normalizeParams(e)})}function Az(t){return new Ez({type:"lazy",getter:t})}function Voe(t){return new Tz({type:"promise",innerType:t})}function Woe(t){return new Oz({type:"function",input:Array.isArray(t?.input)?iz(t?.input):t?.input??ke(tt()),output:t?.output??tt()})}function Koe(t){let e=new Qe({check:"custom"});return e._zod.check=t,e}function Wk(t,e){return sk(yg,t??(()=>!0),e)}function Rz(t,e={}){return ak(yg,t,e)}function Iz(t,e){return ck(t,e)}function Xoe(t,e={}){let r=new yg({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...M.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}function ese(t){let e=Az(()=>rt([I(t),Me(),It(),ug(),ke(e),Ke(I(),e)]));return e}function _g(t,e){return new wz({type:"pipe",in:Zk(t),out:e})}var Gie,_e,Ak,xd,et,Tk,sg,to,lg,Ok,Rk,Ik,Pk,Ck,Dk,Nk,jk,GL,Mk,Fk,Lk,zk,Uk,qk,Bk,$d,kd,Dc,Ed,Ad,Hk,ZL,VL,WL,KL,JL,YL,XL,dg,QL,fg,pg,ez,tz,rz,nz,Sd,oz,sz,wd,az,cz,lz,Od,uz,fz,pz,hz,Vk,_z,bz,Sz,hg,gg,wz,xz,kz,Ez,Tz,Oz,yg,Joe,Yoe,Qoe,og=y(()=>{mr();mr();bd();tg();vk();ng();HL();Gie=new WeakMap;_e=k("ZodType",(t,e)=>(ue.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:_d(t,"input"),output:_d(t,"output")}}),t.toJSONSchema=zF(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>PL(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>DL(t,r,n),t.parseAsync=async(r,n)=>CL(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>NL(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>jL(t,r,n),t.decode=(r,n)=>ML(t,r,n),t.encodeAsync=async(r,n)=>FL(t,r,n),t.decodeAsync=async(r,n)=>LL(t,r,n),t.safeEncode=(r,n)=>zL(t,r,n),t.safeDecode=(r,n)=>UL(t,r,n),t.safeEncodeAsync=async(r,n)=>qL(t,r,n),t.safeDecodeAsync=async(r,n)=>BL(t,r,n),cg(t,"ZodType",{check(...r){let n=this.def;return this.clone(M.mergeDefs(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return nr(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(Rz(r,n))},superRefine(r,n){return this.check(Iz(r,n))},overwrite(r){return this.check(pi(r))},optional(){return at(this)},exactOptional(){return dz(this)},nullable(){return ag(this)},nullish(){return at(ag(this))},nonoptional(r){return yz(this,r)},array(){return ke(this)},or(r){return rt([this,r])},and(r){return Td(this,r)},transform(r){return Ek(this,Zk(r))},default(r){return mz(this,r)},prefault(r){return gz(this,r)},catch(r){return vz(this,r)},pipe(r){return Ek(this,r)},readonly(){return $z(this)},describe(r){let n=this.clone();return ir.add(n,{description:r}),n},meta(...r){if(r.length===0)return ir.get(this);let n=this.clone();return ir.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return ir.get(t)?.description},configurable:!0}),t)),Ak=k("_ZodString",(t,e)=>{Us.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>UF(t,n,i,o);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,cg(t,"_ZodString",{regex(...n){return this.check(sd(...n))},includes(...n){return this.check(ld(...n))},startsWith(...n){return this.check(ud(...n))},endsWith(...n){return this.check(dd(...n))},min(...n){return this.check(Uo(...n))},max(...n){return this.check(Oc(...n))},length(...n){return this.check(Rc(...n))},nonempty(...n){return this.check(Uo(1,...n))},lowercase(n){return this.check(ad(n))},uppercase(n){return this.check(cd(n))},trim(){return this.check(md())},normalize(...n){return this.check(pd(...n))},toLowerCase(){return this.check(hd())},toUpperCase(){return this.check(gd())},slugify(){return this.check(yd())}})}),xd=k("ZodString",(t,e)=>{Us.init(t,e),Ak.init(t,e),t.email=r=>t.check(Nh(Tk,r)),t.url=r=>t.check(od(lg,r)),t.jwt=r=>t.check(eg(Bk,r)),t.emoji=r=>t.check(zh(Ok,r)),t.guid=r=>t.check(id(sg,r)),t.uuid=r=>t.check(jh(to,r)),t.uuidv4=r=>t.check(Mh(to,r)),t.uuidv6=r=>t.check(Fh(to,r)),t.uuidv7=r=>t.check(Lh(to,r)),t.nanoid=r=>t.check(Uh(Rk,r)),t.guid=r=>t.check(id(sg,r)),t.cuid=r=>t.check(qh(Ik,r)),t.cuid2=r=>t.check(Bh(Pk,r)),t.ulid=r=>t.check(Hh(Ck,r)),t.base64=r=>t.check(Yh(zk,r)),t.base64url=r=>t.check(Xh(Uk,r)),t.xid=r=>t.check(Gh(Dk,r)),t.ksuid=r=>t.check(Zh(Nk,r)),t.ipv4=r=>t.check(Vh(jk,r)),t.ipv6=r=>t.check(Wh(Mk,r)),t.cidrv4=r=>t.check(Kh(Fk,r)),t.cidrv6=r=>t.check(Jh(Lk,r)),t.e164=r=>t.check(Qh(qk,r)),t.datetime=r=>t.check(AL(r)),t.date=r=>t.check(TL(r)),t.time=r=>t.check(OL(r)),t.duration=r=>t.check(RL(r))});et=k("ZodStringFormat",(t,e)=>{We.init(t,e),Ak.init(t,e)}),Tk=k("ZodEmail",(t,e)=>{E0.init(t,e),et.init(t,e)});sg=k("ZodGUID",(t,e)=>{$0.init(t,e),et.init(t,e)});to=k("ZodUUID",(t,e)=>{k0.init(t,e),et.init(t,e)});lg=k("ZodURL",(t,e)=>{A0.init(t,e),et.init(t,e)});Ok=k("ZodEmoji",(t,e)=>{T0.init(t,e),et.init(t,e)});Rk=k("ZodNanoID",(t,e)=>{O0.init(t,e),et.init(t,e)});Ik=k("ZodCUID",(t,e)=>{R0.init(t,e),et.init(t,e)});Pk=k("ZodCUID2",(t,e)=>{I0.init(t,e),et.init(t,e)});Ck=k("ZodULID",(t,e)=>{P0.init(t,e),et.init(t,e)});Dk=k("ZodXID",(t,e)=>{C0.init(t,e),et.init(t,e)});Nk=k("ZodKSUID",(t,e)=>{D0.init(t,e),et.init(t,e)});jk=k("ZodIPv4",(t,e)=>{N0.init(t,e),et.init(t,e)});GL=k("ZodMAC",(t,e)=>{M0.init(t,e),et.init(t,e)});Mk=k("ZodIPv6",(t,e)=>{j0.init(t,e),et.init(t,e)});Fk=k("ZodCIDRv4",(t,e)=>{F0.init(t,e),et.init(t,e)});Lk=k("ZodCIDRv6",(t,e)=>{L0.init(t,e),et.init(t,e)});zk=k("ZodBase64",(t,e)=>{z0.init(t,e),et.init(t,e)});Uk=k("ZodBase64URL",(t,e)=>{U0.init(t,e),et.init(t,e)});qk=k("ZodE164",(t,e)=>{q0.init(t,e),et.init(t,e)});Bk=k("ZodJWT",(t,e)=>{B0.init(t,e),et.init(t,e)});$d=k("ZodCustomStringFormat",(t,e)=>{H0.init(t,e),et.init(t,e)});kd=k("ZodNumber",(t,e)=>{Th.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>qF(t,n,i,o),cg(t,"ZodNumber",{gt(n,i){return this.check(Qi(n,i))},gte(n,i){return this.check(Er(n,i))},min(n,i){return this.check(Er(n,i))},lt(n,i){return this.check(Xi(n,i))},lte(n,i){return this.check(Sn(n,i))},max(n,i){return this.check(Sn(n,i))},int(n){return this.check(kk(n))},safe(n){return this.check(kk(n))},positive(n){return this.check(Qi(0,n))},nonnegative(n){return this.check(Er(0,n))},negative(n){return this.check(Xi(0,n))},nonpositive(n){return this.check(Sn(0,n))},multipleOf(n,i){return this.check(qs(n,i))},step(n,i){return this.check(qs(n,i))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});Dc=k("ZodNumberFormat",(t,e)=>{G0.init(t,e),kd.init(t,e)});Ed=k("ZodBoolean",(t,e)=>{Qu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>BF(t,r,n,i)});Ad=k("ZodBigInt",(t,e)=>{Oh.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>HF(t,n,i,o),t.gte=(n,i)=>t.check(Er(n,i)),t.min=(n,i)=>t.check(Er(n,i)),t.gt=(n,i)=>t.check(Qi(n,i)),t.gte=(n,i)=>t.check(Er(n,i)),t.min=(n,i)=>t.check(Er(n,i)),t.lt=(n,i)=>t.check(Xi(n,i)),t.lte=(n,i)=>t.check(Sn(n,i)),t.max=(n,i)=>t.check(Sn(n,i)),t.positive=n=>t.check(Qi(BigInt(0),n)),t.negative=n=>t.check(Xi(BigInt(0),n)),t.nonpositive=n=>t.check(Sn(BigInt(0),n)),t.nonnegative=n=>t.check(Er(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(qs(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});Hk=k("ZodBigIntFormat",(t,e)=>{Z0.init(t,e),Ad.init(t,e)});ZL=k("ZodSymbol",(t,e)=>{V0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>GF(t,r,n,i)});VL=k("ZodUndefined",(t,e)=>{W0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>VF(t,r,n,i)});WL=k("ZodNull",(t,e)=>{K0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ZF(t,r,n,i)});KL=k("ZodAny",(t,e)=>{J0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>JF(t,r,n,i)});JL=k("ZodUnknown",(t,e)=>{Y0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>YF(t,r,n,i)});YL=k("ZodNever",(t,e)=>{X0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KF(t,r,n,i)});XL=k("ZodVoid",(t,e)=>{Q0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>WF(t,r,n,i)});dg=k("ZodDate",(t,e)=>{e$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>XF(t,n,i,o),t.min=(n,i)=>t.check(Er(n,i)),t.max=(n,i)=>t.check(Sn(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});QL=k("ZodArray",(t,e)=>{t$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uL(t,r,n,i),t.element=e.element,cg(t,"ZodArray",{min(r,n){return this.check(Uo(r,n))},nonempty(r){return this.check(Uo(1,r))},max(r,n){return this.check(Oc(r,n))},length(r,n){return this.check(Rc(r,n))},unwrap(){return this.element}})});fg=k("ZodObject",(t,e)=>{SF.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dL(t,r,n,i),M.defineLazy(t,"shape",()=>e.shape),cg(t,"ZodObject",{keyof(){return sr(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:tt()})},loose(){return this.clone({...this._zod.def,catchall:tt()})},strict(){return this.clone({...this._zod.def,catchall:Gk()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return M.extend(this,r)},safeExtend(r){return M.safeExtend(this,r)},merge(r){return M.merge(this,r)},pick(r){return M.pick(this,r)},omit(r){return M.omit(this,r)},partial(...r){return M.partial(Od,this,r[0])},required(...r){return M.required(Vk,this,r[0])}})});pg=k("ZodUnion",(t,e)=>{ed.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pk(t,r,n,i),t.options=e.options});ez=k("ZodXor",(t,e)=>{pg.init(t,e),n$.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pk(t,r,n,i),t.options=e.options});tz=k("ZodDiscriminatedUnion",(t,e)=>{pg.init(t,e),i$.init(t,e)});rz=k("ZodIntersection",(t,e)=>{o$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fL(t,r,n,i)});nz=k("ZodTuple",(t,e)=>{Rh.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pL(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});Sd=k("ZodRecord",(t,e)=>{s$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mL(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});oz=k("ZodMap",(t,e)=>{a$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cL(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(eo(...r)),t.nonempty=r=>t.check(eo(1,r)),t.max=(...r)=>t.check(Bs(...r)),t.size=(...r)=>t.check(Tc(...r))});sz=k("ZodSet",(t,e)=>{c$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lL(t,r,n,i),t.min=(...r)=>t.check(eo(...r)),t.nonempty=r=>t.check(eo(1,r)),t.max=(...r)=>t.check(Bs(...r)),t.size=(...r)=>t.check(Tc(...r))});wd=k("ZodEnum",(t,e)=>{l$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>QF(t,n,i,o),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let o={};for(let s of n)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new wd({...e,checks:[],...M.normalizeParams(i),entries:o})},t.exclude=(n,i)=>{let o={...e.entries};for(let s of n)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new wd({...e,checks:[],...M.normalizeParams(i),entries:o})}});az=k("ZodLiteral",(t,e)=>{u$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>eL(t,r,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});cz=k("ZodFile",(t,e)=>{d$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nL(t,r,n,i),t.min=(r,n)=>t.check(eo(r,n)),t.max=(r,n)=>t.check(Bs(r,n)),t.mime=(r,n)=>t.check(fd(Array.isArray(r)?r:[r],n))});lz=k("ZodTransform",(t,e)=>{f$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>aL(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(M.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),r.issues.push(M.issue(s))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(o=>(r.value=o,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});Od=k("ZodOptional",(t,e)=>{Ih.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});uz=k("ZodExactOptional",(t,e)=>{p$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});fz=k("ZodNullable",(t,e)=>{m$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});pz=k("ZodDefault",(t,e)=>{h$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});hz=k("ZodPrefault",(t,e)=>{g$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_L(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});Vk=k("ZodNonOptional",(t,e)=>{y$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});_z=k("ZodSuccess",(t,e)=>{_$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>iL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});bz=k("ZodCatch",(t,e)=>{b$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});Sz=k("ZodNaN",(t,e)=>{v$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tL(t,r,n,i)});hg=k("ZodPipe",(t,e)=>{Ph.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vL(t,r,n,i),t.in=e.in,t.out=e.out});gg=k("ZodCodec",(t,e)=>{hg.init(t,e),td.init(t,e)});wz=k("ZodPreprocess",(t,e)=>{hg.init(t,e),wF.init(t,e)}),xz=k("ZodReadonly",(t,e)=>{S$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>SL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});kz=k("ZodTemplateLiteral",(t,e)=>{w$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>rL(t,r,n,i)});Ez=k("ZodLazy",(t,e)=>{k$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xL(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});Tz=k("ZodPromise",(t,e)=>{$$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});Oz=k("ZodFunction",(t,e)=>{x$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sL(t,r,n,i)});yg=k("ZodCustom",(t,e)=>{E$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>oL(t,r,n,i)});Joe=lk,Yoe=uk;Qoe=(...t)=>dk({Codec:gg,Boolean:Ed,String:xd},...t)});function tHe(t){Tt({customError:t})}function rHe(){return Tt().customError}var eHe,Pz,tse=y(()=>{mr();eHe={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};Pz||(Pz={})});function iHe(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function oHe(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${t}`);return e.defs[i]}throw new Error(`Reference not found: ${t}`)}function rse(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return Z.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let i=t.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return Z.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let o=oHe(i,e),s=hr(o,e);return e.refs.set(i,s),e.processing.delete(i),s}if(t.enum!==void 0){let i=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&i.length===1&&i[0]===null)return Z.null();if(i.length===0)return Z.never();if(i.length===1)return Z.literal(i[0]);if(i.every(s=>typeof s=="string"))return Z.enum(i);let o=i.map(s=>Z.literal(s));return o.length<2?o[0]:Z.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return Z.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(o=>{let s={...t,type:o};return rse(s,e)});return i.length===0?Z.never():i.length===1?i[0]:Z.union(i)}if(!r)return Z.any();let n;switch(r){case"string":{let i=Z.string();if(t.format){let o=t.format;o==="email"?i=i.check(Z.email()):o==="uri"||o==="uri-reference"?i=i.check(Z.url()):o==="uuid"||o==="guid"?i=i.check(Z.uuid()):o==="date-time"?i=i.check(Z.iso.datetime()):o==="date"?i=i.check(Z.iso.date()):o==="time"?i=i.check(Z.iso.time()):o==="duration"?i=i.check(Z.iso.duration()):o==="ipv4"?i=i.check(Z.ipv4()):o==="ipv6"?i=i.check(Z.ipv6()):o==="mac"?i=i.check(Z.mac()):o==="cidr"?i=i.check(Z.cidrv4()):o==="cidr-v6"?i=i.check(Z.cidrv6()):o==="base64"?i=i.check(Z.base64()):o==="base64url"?i=i.check(Z.base64url()):o==="e164"?i=i.check(Z.e164()):o==="jwt"?i=i.check(Z.jwt()):o==="emoji"?i=i.check(Z.emoji()):o==="nanoid"?i=i.check(Z.nanoid()):o==="cuid"?i=i.check(Z.cuid()):o==="cuid2"?i=i.check(Z.cuid2()):o==="ulid"?i=i.check(Z.ulid()):o==="xid"?i=i.check(Z.xid()):o==="ksuid"&&(i=i.check(Z.ksuid()))}typeof t.minLength=="number"&&(i=i.min(t.minLength)),typeof t.maxLength=="number"&&(i=i.max(t.maxLength)),t.pattern&&(i=i.regex(new RegExp(t.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?Z.number().int():Z.number();typeof t.minimum=="number"&&(i=i.min(t.minimum)),typeof t.maximum=="number"&&(i=i.max(t.maximum)),typeof t.exclusiveMinimum=="number"?i=i.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(i=i.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?i=i.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(i=i.lt(t.maximum)),typeof t.multipleOf=="number"&&(i=i.multipleOf(t.multipleOf)),n=i;break}case"boolean":{n=Z.boolean();break}case"null":{n=Z.null();break}case"object":{let i={},o=t.properties||{},s=new Set(t.required||[]);for(let[c,l]of Object.entries(o)){let u=hr(l,e);i[c]=s.has(c)?u:u.optional()}if(t.propertyNames){let c=hr(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?hr(t.additionalProperties,e):Z.any();if(Object.keys(i).length===0){n=Z.record(c,l);break}let u=Z.object(i).passthrough(),d=Z.looseRecord(c,l);n=Z.intersection(u,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),u=[];for(let f of l){let p=hr(c[f],e),m=Z.string().regex(new RegExp(f));u.push(Z.looseRecord(m,p))}let d=[];if(Object.keys(i).length>0&&d.push(Z.object(i).passthrough()),d.push(...u),d.length===0)n=Z.object({}).passthrough();else if(d.length===1)n=d[0];else{let f=Z.intersection(d[0],d[1]);for(let p=2;phr(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?hr(o,e):void 0;a?n=Z.tuple(s).rest(a):n=Z.tuple(s),typeof t.minItems=="number"&&(n=n.check(Z.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(Z.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>hr(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?hr(t.additionalItems,e):void 0;a?n=Z.tuple(s).rest(a):n=Z.tuple(s),typeof t.minItems=="number"&&(n=n.check(Z.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(Z.maxLength(t.maxItems)))}else if(o!==void 0){let s=hr(o,e),a=Z.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),n=a}else n=Z.array(Z.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function hr(t,e){if(typeof t=="boolean")return t?Z.any():Z.never();let r=rse(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(l=>hr(l,e)),c=Z.union(a);r=n?Z.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(l=>hr(l,e)),c=Z.xor(a);r=n?Z.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:Z.any();else{let a=n?r:hr(t.allOf[0],e),c=n?0:1;for(let l=c;l0&&e.registry.add(r,i),t.description&&(r=r.describe(t.description)),r}function nse(t,e){if(typeof t=="boolean")return t?Z.any():Z.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=iHe(r,e?.defaultTarget),i=r.$defs||r.definitions||{},o={version:n,defs:i,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??ir};return hr(r,o)}var Z,nHe,ise=y(()=>{Dh();vk();ng();og();Z={...ig,...bk,iso:Ks},nHe=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var Cz={};Pr(Cz,{bigint:()=>lHe,boolean:()=>cHe,date:()=>uHe,number:()=>aHe,string:()=>sHe});function sHe(t){return OF(xd,t)}function aHe(t){return NF(kd,t)}function cHe(t){return jF(Ed,t)}function lHe(t){return MF(Ad,t)}function uHe(t){return FF(dg,t)}var ose=y(()=>{mr();og()});var E={};Pr(E,{$brand:()=>iM,$input:()=>TF,$output:()=>AF,NEVER:()=>nM,TimePrecision:()=>RF,ZodAny:()=>KL,ZodArray:()=>QL,ZodBase64:()=>zk,ZodBase64URL:()=>Uk,ZodBigInt:()=>Ad,ZodBigIntFormat:()=>Hk,ZodBoolean:()=>Ed,ZodCIDRv4:()=>Fk,ZodCIDRv6:()=>Lk,ZodCUID:()=>Ik,ZodCUID2:()=>Pk,ZodCatch:()=>bz,ZodCodec:()=>gg,ZodCustom:()=>yg,ZodCustomStringFormat:()=>$d,ZodDate:()=>dg,ZodDefault:()=>pz,ZodDiscriminatedUnion:()=>tz,ZodE164:()=>qk,ZodEmail:()=>Tk,ZodEmoji:()=>Ok,ZodEnum:()=>wd,ZodError:()=>XBe,ZodExactOptional:()=>uz,ZodFile:()=>cz,ZodFirstPartyTypeKind:()=>Pz,ZodFunction:()=>Oz,ZodGUID:()=>sg,ZodIPv4:()=>jk,ZodIPv6:()=>Mk,ZodISODate:()=>wk,ZodISODateTime:()=>Sk,ZodISODuration:()=>$k,ZodISOTime:()=>xk,ZodIntersection:()=>rz,ZodIssueCode:()=>eHe,ZodJWT:()=>Bk,ZodKSUID:()=>Nk,ZodLazy:()=>Ez,ZodLiteral:()=>az,ZodMAC:()=>GL,ZodMap:()=>oz,ZodNaN:()=>Sz,ZodNanoID:()=>Rk,ZodNever:()=>YL,ZodNonOptional:()=>Vk,ZodNull:()=>WL,ZodNullable:()=>fz,ZodNumber:()=>kd,ZodNumberFormat:()=>Dc,ZodObject:()=>fg,ZodOptional:()=>Od,ZodPipe:()=>hg,ZodPrefault:()=>hz,ZodPreprocess:()=>wz,ZodPromise:()=>Tz,ZodReadonly:()=>xz,ZodRealError:()=>Zr,ZodRecord:()=>Sd,ZodSet:()=>sz,ZodString:()=>xd,ZodStringFormat:()=>et,ZodSuccess:()=>_z,ZodSymbol:()=>ZL,ZodTemplateLiteral:()=>kz,ZodTransform:()=>lz,ZodTuple:()=>nz,ZodType:()=>_e,ZodULID:()=>Ck,ZodURL:()=>lg,ZodUUID:()=>to,ZodUndefined:()=>VL,ZodUnion:()=>pg,ZodUnknown:()=>JL,ZodVoid:()=>XL,ZodXID:()=>Dk,ZodXor:()=>ez,_ZodString:()=>Ak,_default:()=>mz,_function:()=>Woe,any:()=>Ooe,array:()=>ke,base64:()=>foe,base64url:()=>poe,bigint:()=>$oe,boolean:()=>It,catch:()=>vz,check:()=>Koe,cidrv4:()=>uoe,cidrv6:()=>doe,clone:()=>nr,codec:()=>Hoe,coerce:()=>Cz,config:()=>Tt,core:()=>mi,cuid:()=>roe,cuid2:()=>noe,custom:()=>Wk,date:()=>Ioe,decode:()=>ML,decodeAsync:()=>LL,describe:()=>Joe,discriminatedUnion:()=>mg,e164:()=>moe,email:()=>Zie,emoji:()=>eoe,encode:()=>jL,encodeAsync:()=>FL,endsWith:()=>dd,enum:()=>sr,exactOptional:()=>dz,file:()=>zoe,flattenError:()=>xh,float32:()=>voe,float64:()=>Soe,formatError:()=>$h,fromJSONSchema:()=>nse,function:()=>Woe,getErrorMap:()=>rHe,globalRegistry:()=>ir,gt:()=>Qi,gte:()=>Er,guid:()=>Vie,hash:()=>boe,hex:()=>_oe,hostname:()=>yoe,httpUrl:()=>Qie,includes:()=>ld,instanceof:()=>Xoe,int:()=>kk,int32:()=>woe,int64:()=>koe,intersection:()=>Td,invertCodec:()=>Goe,ipv4:()=>aoe,ipv6:()=>loe,iso:()=>Ks,json:()=>ese,jwt:()=>hoe,keyof:()=>Poe,ksuid:()=>soe,lazy:()=>Az,length:()=>Rc,literal:()=>re,locales:()=>nd,looseObject:()=>or,looseRecord:()=>joe,lowercase:()=>ad,lt:()=>Xi,lte:()=>Sn,mac:()=>coe,map:()=>Moe,maxLength:()=>Oc,maxSize:()=>Bs,meta:()=>Yoe,mime:()=>fd,minLength:()=>Uo,minSize:()=>eo,multipleOf:()=>qs,nan:()=>Boe,nanoid:()=>toe,nativeEnum:()=>Loe,negative:()=>tk,never:()=>Gk,nonnegative:()=>nk,nonoptional:()=>yz,nonpositive:()=>rk,normalize:()=>pd,null:()=>ug,nullable:()=>ag,nullish:()=>Uoe,number:()=>Me,object:()=>W,optional:()=>at,overwrite:()=>pi,parse:()=>PL,parseAsync:()=>CL,partialRecord:()=>Noe,pipe:()=>Ek,positive:()=>ek,prefault:()=>gz,preprocess:()=>_g,prettifyError:()=>gM,promise:()=>Voe,property:()=>ik,readonly:()=>$z,record:()=>Ke,refine:()=>Rz,regex:()=>sd,regexes:()=>Gr,registry:()=>P$,safeDecode:()=>UL,safeDecodeAsync:()=>BL,safeEncode:()=>zL,safeEncodeAsync:()=>qL,safeParse:()=>DL,safeParseAsync:()=>NL,set:()=>Foe,setErrorMap:()=>tHe,size:()=>Tc,slugify:()=>yd,startsWith:()=>ud,strictObject:()=>Coe,string:()=>I,stringFormat:()=>goe,stringbool:()=>Qoe,success:()=>qoe,superRefine:()=>Iz,symbol:()=>Aoe,templateLiteral:()=>Zoe,toJSONSchema:()=>Pc,toLowerCase:()=>hd,toUpperCase:()=>gd,transform:()=>Zk,treeifyError:()=>hM,trim:()=>md,tuple:()=>iz,uint32:()=>xoe,uint64:()=>Eoe,ulid:()=>ioe,undefined:()=>Toe,union:()=>rt,unknown:()=>tt,uppercase:()=>cd,url:()=>Xie,util:()=>M,uuid:()=>Wie,uuidv4:()=>Kie,uuidv6:()=>Jie,uuidv7:()=>Yie,void:()=>Roe,xid:()=>ooe,xor:()=>Doe});var Kk=y(()=>{mr();og();vk();IL();HL();tse();mr();$F();mr();bd();ise();R$();ng();ng();ose();Tt(A$())});var sse=y(()=>{Kk()});var ase=y(()=>{sse()});function $se(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function kse(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var Nz,cse,Js,Yk,Wt,lse,use,hEt,fHe,pHe,jz,wn,bg,dse,ar,zn,Un,cr,Xk,fse,Mz,pse,mse,Fz,vg,ae,Lz,hse,gse,gEt,Qk,mHe,eE,hHe,Sg,Rd,yse,gHe,yHe,_He,bHe,vHe,SHe,zz,wHe,xHe,Uz,tE,$He,kHe,rE,EHe,wg,xg,AHe,$g,Id,THe,kg,nE,iE,oE,yEt,sE,aE,cE,_se,bse,vse,qz,Sse,Eg,Pd,wse,OHe,lE,RHe,uE,IHe,Bz,PHe,dE,CHe,DHe,NHe,Hz,jHe,Gz,MHe,FHe,LHe,zHe,fE,UHe,qHe,pE,Zz,Vz,Wz,BHe,HHe,GHe,Kz,ZHe,VHe,WHe,KHe,JHe,xse,mE,YHe,hE,_Et,XHe,Cd,QHe,bEt,Ag,eGe,Jz,tGe,rGe,nGe,iGe,oGe,sGe,aGe,Jk,cGe,lGe,uGe,Tg,Yz,dGe,fGe,pGe,mGe,hGe,gGe,yGe,_Ge,bGe,vGe,SGe,wGe,xGe,$Ge,kGe,EGe,AGe,TGe,Dd,OGe,RGe,IGe,gE,PGe,CGe,DGe,Xz,NGe,vEt,SEt,wEt,xEt,$Et,kEt,ne,Dz,Nc=y(()=>{ase();Nz="2025-11-25",cse=[Nz,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Js="io.modelcontextprotocol/related-task",Yk="2.0",Wt=Wk(t=>t!==null&&(typeof t=="object"||typeof t=="function")),lse=rt([I(),Me().int()]),use=I(),hEt=or({ttl:Me().optional(),pollInterval:Me().optional()}),fHe=W({ttl:Me().optional()}),pHe=W({taskId:I()}),jz=or({progressToken:lse.optional(),[Js]:pHe.optional()}),wn=W({_meta:jz.optional()}),bg=wn.extend({task:fHe.optional()}),dse=t=>bg.safeParse(t).success,ar=W({method:I(),params:wn.loose().optional()}),zn=W({_meta:jz.optional()}),Un=W({method:I(),params:zn.loose().optional()}),cr=or({_meta:jz.optional()}),Xk=rt([I(),Me().int()]),fse=W({jsonrpc:re(Yk),id:Xk,...ar.shape}).strict(),Mz=t=>fse.safeParse(t).success,pse=W({jsonrpc:re(Yk),...Un.shape}).strict(),mse=t=>pse.safeParse(t).success,Fz=W({jsonrpc:re(Yk),id:Xk,result:cr}).strict(),vg=t=>Fz.safeParse(t).success;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ae||(ae={}));Lz=W({jsonrpc:re(Yk),id:Xk.optional(),error:W({code:Me().int(),message:I(),data:tt().optional()})}).strict(),hse=t=>Lz.safeParse(t).success,gse=rt([fse,pse,Fz,Lz]),gEt=rt([Fz,Lz]),Qk=cr.strict(),mHe=zn.extend({requestId:Xk.optional(),reason:I().optional()}),eE=Un.extend({method:re("notifications/cancelled"),params:mHe}),hHe=W({src:I(),mimeType:I().optional(),sizes:ke(I()).optional(),theme:sr(["light","dark"]).optional()}),Sg=W({icons:ke(hHe).optional()}),Rd=W({name:I(),title:I().optional()}),yse=Rd.extend({...Rd.shape,...Sg.shape,version:I(),websiteUrl:I().optional(),description:I().optional()}),gHe=Td(W({applyDefaults:It().optional()}),Ke(I(),tt())),yHe=_g(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Td(W({form:gHe.optional(),url:Wt.optional()}),Ke(I(),tt()).optional())),_He=or({list:Wt.optional(),cancel:Wt.optional(),requests:or({sampling:or({createMessage:Wt.optional()}).optional(),elicitation:or({create:Wt.optional()}).optional()}).optional()}),bHe=or({list:Wt.optional(),cancel:Wt.optional(),requests:or({tools:or({call:Wt.optional()}).optional()}).optional()}),vHe=W({experimental:Ke(I(),Wt).optional(),sampling:W({context:Wt.optional(),tools:Wt.optional()}).optional(),elicitation:yHe.optional(),roots:W({listChanged:It().optional()}).optional(),tasks:_He.optional(),extensions:Ke(I(),Wt).optional()}),SHe=wn.extend({protocolVersion:I(),capabilities:vHe,clientInfo:yse}),zz=ar.extend({method:re("initialize"),params:SHe}),wHe=W({experimental:Ke(I(),Wt).optional(),logging:Wt.optional(),completions:Wt.optional(),prompts:W({listChanged:It().optional()}).optional(),resources:W({subscribe:It().optional(),listChanged:It().optional()}).optional(),tools:W({listChanged:It().optional()}).optional(),tasks:bHe.optional(),extensions:Ke(I(),Wt).optional()}),xHe=cr.extend({protocolVersion:I(),capabilities:wHe,serverInfo:yse,instructions:I().optional()}),Uz=Un.extend({method:re("notifications/initialized"),params:zn.optional()}),tE=ar.extend({method:re("ping"),params:wn.optional()}),$He=W({progress:Me(),total:at(Me()),message:at(I())}),kHe=W({...zn.shape,...$He.shape,progressToken:lse}),rE=Un.extend({method:re("notifications/progress"),params:kHe}),EHe=wn.extend({cursor:use.optional()}),wg=ar.extend({params:EHe.optional()}),xg=cr.extend({nextCursor:use.optional()}),AHe=sr(["working","input_required","completed","failed","cancelled"]),$g=W({taskId:I(),status:AHe,ttl:rt([Me(),ug()]),createdAt:I(),lastUpdatedAt:I(),pollInterval:at(Me()),statusMessage:at(I())}),Id=cr.extend({task:$g}),THe=zn.merge($g),kg=Un.extend({method:re("notifications/tasks/status"),params:THe}),nE=ar.extend({method:re("tasks/get"),params:wn.extend({taskId:I()})}),iE=cr.merge($g),oE=ar.extend({method:re("tasks/result"),params:wn.extend({taskId:I()})}),yEt=cr.loose(),sE=wg.extend({method:re("tasks/list")}),aE=xg.extend({tasks:ke($g)}),cE=ar.extend({method:re("tasks/cancel"),params:wn.extend({taskId:I()})}),_se=cr.merge($g),bse=W({uri:I(),mimeType:at(I()),_meta:Ke(I(),tt()).optional()}),vse=bse.extend({text:I()}),qz=I().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Sse=bse.extend({blob:qz}),Eg=sr(["user","assistant"]),Pd=W({audience:ke(Eg).optional(),priority:Me().min(0).max(1).optional(),lastModified:Ks.datetime({offset:!0}).optional()}),wse=W({...Rd.shape,...Sg.shape,uri:I(),description:at(I()),mimeType:at(I()),size:at(Me()),annotations:Pd.optional(),_meta:at(or({}))}),OHe=W({...Rd.shape,...Sg.shape,uriTemplate:I(),description:at(I()),mimeType:at(I()),annotations:Pd.optional(),_meta:at(or({}))}),lE=wg.extend({method:re("resources/list")}),RHe=xg.extend({resources:ke(wse)}),uE=wg.extend({method:re("resources/templates/list")}),IHe=xg.extend({resourceTemplates:ke(OHe)}),Bz=wn.extend({uri:I()}),PHe=Bz,dE=ar.extend({method:re("resources/read"),params:PHe}),CHe=cr.extend({contents:ke(rt([vse,Sse]))}),DHe=Un.extend({method:re("notifications/resources/list_changed"),params:zn.optional()}),NHe=Bz,Hz=ar.extend({method:re("resources/subscribe"),params:NHe}),jHe=Bz,Gz=ar.extend({method:re("resources/unsubscribe"),params:jHe}),MHe=zn.extend({uri:I()}),FHe=Un.extend({method:re("notifications/resources/updated"),params:MHe}),LHe=W({name:I(),description:at(I()),required:at(It())}),zHe=W({...Rd.shape,...Sg.shape,description:at(I()),arguments:at(ke(LHe)),_meta:at(or({}))}),fE=wg.extend({method:re("prompts/list")}),UHe=xg.extend({prompts:ke(zHe)}),qHe=wn.extend({name:I(),arguments:Ke(I(),I()).optional()}),pE=ar.extend({method:re("prompts/get"),params:qHe}),Zz=W({type:re("text"),text:I(),annotations:Pd.optional(),_meta:Ke(I(),tt()).optional()}),Vz=W({type:re("image"),data:qz,mimeType:I(),annotations:Pd.optional(),_meta:Ke(I(),tt()).optional()}),Wz=W({type:re("audio"),data:qz,mimeType:I(),annotations:Pd.optional(),_meta:Ke(I(),tt()).optional()}),BHe=W({type:re("tool_use"),name:I(),id:I(),input:Ke(I(),tt()),_meta:Ke(I(),tt()).optional()}),HHe=W({type:re("resource"),resource:rt([vse,Sse]),annotations:Pd.optional(),_meta:Ke(I(),tt()).optional()}),GHe=wse.extend({type:re("resource_link")}),Kz=rt([Zz,Vz,Wz,GHe,HHe]),ZHe=W({role:Eg,content:Kz}),VHe=cr.extend({description:I().optional(),messages:ke(ZHe)}),WHe=Un.extend({method:re("notifications/prompts/list_changed"),params:zn.optional()}),KHe=W({title:I().optional(),readOnlyHint:It().optional(),destructiveHint:It().optional(),idempotentHint:It().optional(),openWorldHint:It().optional()}),JHe=W({taskSupport:sr(["required","optional","forbidden"]).optional()}),xse=W({...Rd.shape,...Sg.shape,description:I().optional(),inputSchema:W({type:re("object"),properties:Ke(I(),Wt).optional(),required:ke(I()).optional()}).catchall(tt()),outputSchema:W({type:re("object"),properties:Ke(I(),Wt).optional(),required:ke(I()).optional()}).catchall(tt()).optional(),annotations:KHe.optional(),execution:JHe.optional(),_meta:Ke(I(),tt()).optional()}),mE=wg.extend({method:re("tools/list")}),YHe=xg.extend({tools:ke(xse)}),hE=cr.extend({content:ke(Kz).default([]),structuredContent:Ke(I(),tt()).optional(),isError:It().optional()}),_Et=hE.or(cr.extend({toolResult:tt()})),XHe=bg.extend({name:I(),arguments:Ke(I(),tt()).optional()}),Cd=ar.extend({method:re("tools/call"),params:XHe}),QHe=Un.extend({method:re("notifications/tools/list_changed"),params:zn.optional()}),bEt=W({autoRefresh:It().default(!0),debounceMs:Me().int().nonnegative().default(300)}),Ag=sr(["debug","info","notice","warning","error","critical","alert","emergency"]),eGe=wn.extend({level:Ag}),Jz=ar.extend({method:re("logging/setLevel"),params:eGe}),tGe=zn.extend({level:Ag,logger:I().optional(),data:tt()}),rGe=Un.extend({method:re("notifications/message"),params:tGe}),nGe=W({name:I().optional()}),iGe=W({hints:ke(nGe).optional(),costPriority:Me().min(0).max(1).optional(),speedPriority:Me().min(0).max(1).optional(),intelligencePriority:Me().min(0).max(1).optional()}),oGe=W({mode:sr(["auto","required","none"]).optional()}),sGe=W({type:re("tool_result"),toolUseId:I().describe("The unique identifier for the corresponding tool call."),content:ke(Kz).default([]),structuredContent:W({}).loose().optional(),isError:It().optional(),_meta:Ke(I(),tt()).optional()}),aGe=mg("type",[Zz,Vz,Wz]),Jk=mg("type",[Zz,Vz,Wz,BHe,sGe]),cGe=W({role:Eg,content:rt([Jk,ke(Jk)]),_meta:Ke(I(),tt()).optional()}),lGe=bg.extend({messages:ke(cGe),modelPreferences:iGe.optional(),systemPrompt:I().optional(),includeContext:sr(["none","thisServer","allServers"]).optional(),temperature:Me().optional(),maxTokens:Me().int(),stopSequences:ke(I()).optional(),metadata:Wt.optional(),tools:ke(xse).optional(),toolChoice:oGe.optional()}),uGe=ar.extend({method:re("sampling/createMessage"),params:lGe}),Tg=cr.extend({model:I(),stopReason:at(sr(["endTurn","stopSequence","maxTokens"]).or(I())),role:Eg,content:aGe}),Yz=cr.extend({model:I(),stopReason:at(sr(["endTurn","stopSequence","maxTokens","toolUse"]).or(I())),role:Eg,content:rt([Jk,ke(Jk)])}),dGe=W({type:re("boolean"),title:I().optional(),description:I().optional(),default:It().optional()}),fGe=W({type:re("string"),title:I().optional(),description:I().optional(),minLength:Me().optional(),maxLength:Me().optional(),format:sr(["email","uri","date","date-time"]).optional(),default:I().optional()}),pGe=W({type:sr(["number","integer"]),title:I().optional(),description:I().optional(),minimum:Me().optional(),maximum:Me().optional(),default:Me().optional()}),mGe=W({type:re("string"),title:I().optional(),description:I().optional(),enum:ke(I()),default:I().optional()}),hGe=W({type:re("string"),title:I().optional(),description:I().optional(),oneOf:ke(W({const:I(),title:I()})),default:I().optional()}),gGe=W({type:re("string"),title:I().optional(),description:I().optional(),enum:ke(I()),enumNames:ke(I()).optional(),default:I().optional()}),yGe=rt([mGe,hGe]),_Ge=W({type:re("array"),title:I().optional(),description:I().optional(),minItems:Me().optional(),maxItems:Me().optional(),items:W({type:re("string"),enum:ke(I())}),default:ke(I()).optional()}),bGe=W({type:re("array"),title:I().optional(),description:I().optional(),minItems:Me().optional(),maxItems:Me().optional(),items:W({anyOf:ke(W({const:I(),title:I()}))}),default:ke(I()).optional()}),vGe=rt([_Ge,bGe]),SGe=rt([gGe,yGe,vGe]),wGe=rt([SGe,dGe,fGe,pGe]),xGe=bg.extend({mode:re("form").optional(),message:I(),requestedSchema:W({type:re("object"),properties:Ke(I(),wGe),required:ke(I()).optional()})}),$Ge=bg.extend({mode:re("url"),message:I(),elicitationId:I(),url:I().url()}),kGe=rt([xGe,$Ge]),EGe=ar.extend({method:re("elicitation/create"),params:kGe}),AGe=zn.extend({elicitationId:I()}),TGe=Un.extend({method:re("notifications/elicitation/complete"),params:AGe}),Dd=cr.extend({action:sr(["accept","decline","cancel"]),content:_g(t=>t===null?void 0:t,Ke(I(),rt([I(),Me(),It(),ke(I())])).optional())}),OGe=W({type:re("ref/resource"),uri:I()}),RGe=W({type:re("ref/prompt"),name:I()}),IGe=wn.extend({ref:rt([RGe,OGe]),argument:W({name:I(),value:I()}),context:W({arguments:Ke(I(),I()).optional()}).optional()}),gE=ar.extend({method:re("completion/complete"),params:IGe});PGe=cr.extend({completion:or({values:ke(I()).max(100),total:at(Me().int()),hasMore:at(It())})}),CGe=W({uri:I().startsWith("file://"),name:I().optional(),_meta:Ke(I(),tt()).optional()}),DGe=ar.extend({method:re("roots/list"),params:wn.optional()}),Xz=cr.extend({roots:ke(CGe)}),NGe=Un.extend({method:re("notifications/roots/list_changed"),params:zn.optional()}),vEt=rt([tE,zz,gE,Jz,pE,fE,lE,uE,dE,Hz,Gz,Cd,mE,nE,oE,sE,cE]),SEt=rt([eE,rE,Uz,NGe,kg]),wEt=rt([Qk,Tg,Yz,Dd,Xz,iE,aE,Id]),xEt=rt([tE,uGe,EGe,DGe,nE,oE,sE,cE]),$Et=rt([eE,rE,rGe,FHe,DHe,QHe,WHe,kg,TGe]),kEt=rt([Qk,xHe,PGe,VHe,UHe,RHe,IHe,CHe,hE,YHe,iE,aE,Id]),ne=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===ae.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new Dz(i.elicitations,r)}return new t(e,r,n)}},Dz=class extends ne{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(ae.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}});function Ys(t){return t==="completed"||t==="failed"||t==="cancelled"}var Ese=y(()=>{});var Tse,Ase,Ose,yE=y(()=>{Tse=Symbol("Let zodToJsonSchema decide on which parser to use"),Ase={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Ose=t=>typeof t=="string"?{...Ase,name:t}:{...Ase,...t}});var Rse,Qz=y(()=>{yE();Rse=t=>{let e=Ose(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,i])=>[i._def,{def:i._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}}});function e2(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function Ie(t,e,r,n,i){t[e]=r,e2(t,e,n,i)}var Xs=y(()=>{});var _E,bE=y(()=>{_E=(t,e)=>{let r=0;for(;r{bE()});function Ise(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==z.ZodAny&&(r.items=le(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&Ie(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Ie(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Ie(r,"minItems",t.exactLength.value,t.exactLength.message,e),Ie(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}var t2=y(()=>{hh();Xs();Mt()});function Pse(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?Ie(r,"minimum",n.value,n.message,e):Ie(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Ie(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Ie(r,"maximum",n.value,n.message,e):Ie(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Ie(r,"maximum",n.value,n.message,e));break;case"multipleOf":Ie(r,"multipleOf",n.value,n.message,e);break}return r}var r2=y(()=>{Xs()});function Cse(){return{type:"boolean"}}var n2=y(()=>{});function vE(t,e){return le(t.type._def,e)}var SE=y(()=>{Mt()});var Dse,i2=y(()=>{Mt();Dse=(t,e)=>le(t.innerType._def,e)});function o2(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((i,o)=>o2(t,e,i))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return jGe(t,e)}}var jGe,s2=y(()=>{Xs();jGe=(t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":Ie(r,"minimum",n.value,n.message,e);break;case"max":Ie(r,"maximum",n.value,n.message,e);break}return r}});function Nse(t,e){return{...le(t.innerType._def,e),default:t.defaultValue()}}var a2=y(()=>{Mt()});function jse(t,e){return e.effectStrategy==="input"?le(t.schema._def,e):yt(e)}var c2=y(()=>{Mt();qn()});function Mse(t){return{type:"string",enum:Array.from(t.values)}}var l2=y(()=>{});function Fse(t,e){let r=[le(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),le(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(o=>!!o),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,i=[];return r.forEach(o=>{if(MGe(o))i.push(...o.allOf),o.unevaluatedProperties===void 0&&(n=void 0);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:a,...c}=o;s=c}else n=void 0;i.push(s)}}),i.length?{allOf:i,...n}:void 0}var MGe,u2=y(()=>{Mt();MGe=t=>"type"in t&&t.type==="string"?!1:"allOf"in t});function Lse(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}var d2=y(()=>{});function wE(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":Ie(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":Ie(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":gi(r,"email",n.message,e);break;case"format:idn-email":gi(r,"idn-email",n.message,e);break;case"pattern:zod":Tr(r,hi.email,n.message,e);break}break;case"url":gi(r,"uri",n.message,e);break;case"uuid":gi(r,"uuid",n.message,e);break;case"regex":Tr(r,n.regex,n.message,e);break;case"cuid":Tr(r,hi.cuid,n.message,e);break;case"cuid2":Tr(r,hi.cuid2,n.message,e);break;case"startsWith":Tr(r,RegExp(`^${p2(n.value,e)}`),n.message,e);break;case"endsWith":Tr(r,RegExp(`${p2(n.value,e)}$`),n.message,e);break;case"datetime":gi(r,"date-time",n.message,e);break;case"date":gi(r,"date",n.message,e);break;case"time":gi(r,"time",n.message,e);break;case"duration":gi(r,"duration",n.message,e);break;case"length":Ie(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),Ie(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Tr(r,RegExp(p2(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&gi(r,"ipv4",n.message,e),n.version!=="v4"&&gi(r,"ipv6",n.message,e);break}case"base64url":Tr(r,hi.base64url,n.message,e);break;case"jwt":Tr(r,hi.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Tr(r,hi.ipv4Cidr,n.message,e),n.version!=="v4"&&Tr(r,hi.ipv6Cidr,n.message,e);break}case"emoji":Tr(r,hi.emoji(),n.message,e);break;case"ulid":{Tr(r,hi.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{gi(r,"binary",n.message,e);break}case"contentEncoding:base64":{Ie(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Tr(r,hi.base64,n.message,e);break}}break}case"nanoid":Tr(r,hi.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function p2(t,e){return e.patternStrategy==="escape"?LGe(t):t}function LGe(t){let e="";for(let r=0;ri.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):Ie(t,"format",e,r,n)}function Tr(t,e,r,n){t.pattern||t.allOf?.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:zse(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):Ie(t,"pattern",zse(e,n),r,n)}function zse(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,i="",o=!1,s=!1,a=!1;for(let c=0;c1&&t.reused==="ref"){o(s);continue}}}function Zs(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=t.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){n(d);let p=t.seen.get(d),m=p.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):Object.assign(l,m),Object.assign(l,u),a._zod.parent===d)for(let g in l)g==="$ref"||g==="allOf"||g in u||delete l[g];if(m.$ref&&p.def)for(let g in l)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(l[g])===JSON.stringify(p.def[g])&&delete l[g]}let f=a._zod.parent;if(f&&f!==d){n(f);let p=t.seen.get(f);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(let m in l)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(l[m])===JSON.stringify(p.def[m])&&delete l[m]}t.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())n(a[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(a)}Object.assign(i,r.def??r.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&i.id===o&&delete i.id;let s=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,s[c.defId]=c.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{let a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:_d(e,"input",t.processors),output:_d(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ar(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ar(n.element,r);if(n.type==="set")return Ar(n.valueType,r);if(n.type==="lazy")return Ar(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Ar(n.innerType,r);if(n.type==="intersection")return Ar(n.left,r)||Ar(n.right,r);if(n.type==="record"||n.type==="map")return Ar(n.keyType,r)||Ar(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Ar(n.in,r)||Ar(n.out,r);if(n.type==="object"){for(let i in n.shape)if(Ar(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(Ar(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(Ar(i,r))return!0;return!!(n.rest&&Ar(n.rest,r))}return!1}var zF,_d,tg=y(()=>{Dh();zF=(t,e={})=>r=>{let n=Hs({...r,processors:e});return Ve(t,n),Gs(n,t),Zs(n,t)},_d=(t,e,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},s=Hs({...i??{},target:o,io:e,processors:r});return Ve(t,s),Gs(s,t),Zs(s,t)}});function Pc(t,e){if("_idmap"in t){let n=t,i=Hs({...e,processors:fk}),o={};for(let c of n._idmap.entries()){let[l,u]=c;Ve(u,i)}let s={},a={registry:n,uri:e?.uri,defs:o};i.external=a;for(let c of n._idmap.entries()){let[l,u]=c;Gs(i,u),s[l]=Zs(i,u)}if(Object.keys(o).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=Hs({...e,processors:fk});return Ve(t,r),Gs(r,t),Zs(r,t)}var GBe,UF,qF,BF,HF,GF,ZF,VF,WF,KF,JF,YF,XF,QF,eL,tL,rL,nL,iL,oL,sL,aL,cL,lL,uL,dL,pk,fL,pL,mL,hL,gL,yL,_L,bL,vL,SL,wL,mk,xL,fk,bd=y(()=>{tg();ee();GBe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},UF=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof s=="number"&&(i.maxLength=s),a&&(i.format=GBe[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},qF=(t,e,r,n)=>{let i=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number";let d=typeof u=="number"&&u>=(o??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(s??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof o=="number"&&(i.minimum=o),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof s=="number"&&(i.maximum=s),typeof c=="number"&&(i.multipleOf=c)},BF=(t,e,r,n)=>{r.type="boolean"},HF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},GF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},ZF=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},VF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},WF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},KF=(t,e,r,n)=>{r.not={}},JF=(t,e,r,n)=>{},YF=(t,e,r,n)=>{},XF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},QF=(t,e,r,n)=>{let i=t._zod.def,o=yh(i.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},eL=(t,e,r,n)=>{let i=t._zod.def,o=[];for(let s of i.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},tL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},rL=(t,e,r,n)=>{let i=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},nL=(t,e,r,n)=>{let i=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(i,o)},iL=(t,e,r,n)=>{r.type="boolean"},oL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},sL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},aL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},cL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},lL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},uL=(t,e,r,n)=>{let i=r,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=Ve(o.element,e,{...n,path:[...n.path,"items"]})},dL=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="object",i.properties={};let s=o.shape;for(let l in s)i.properties[l]=Ve(s[l],e,{...n,path:[...n.path,"properties",l]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(l=>{let u=o.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(i.required=Array.from(c)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=Ve(o.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},pk=(t,e,r,n)=>{let i=t._zod.def,o=i.inclusive===!1,s=i.options.map((a,c)=>Ve(a,e,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},fL=(t,e,r,n)=>{let i=t._zod.def,o=Ve(i.left,e,{...n,path:[...n.path,"allOf",0]}),s=Ve(i.right,e,{...n,path:[...n.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},pL=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((f,p)=>Ve(f,e,{...n,path:[...n.path,s,p]})),l=o.rest?Ve(o.rest,e,{...n,path:[...n.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=c,l&&(i.items=l)):e.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(i.minItems=u),typeof d=="number"&&(i.maxItems=d)},mL=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let u=Ve(o.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let d of c)i.patternProperties[d.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Ve(o.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=Ve(o.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(i.required=u)}},hL=(t,e,r,n)=>{let i=t._zod.def,o=Ve(i.innerType,e,n),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},gL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},yL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},_L=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},bL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},vL=(t,e,r,n)=>{let i=t._zod.def,o=i.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?i.out:i.in:i.out;Ve(s,e,n);let a=e.seen.get(t);a.ref=s},SL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,r.readOnly=!0},wL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},mk=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},xL=(t,e,r,n)=>{let i=t._zod.innerType;Ve(i,e,n);let o=e.seen.get(t);o.ref=i},fk={string:UF,number:qF,boolean:BF,bigint:HF,symbol:GF,null:ZF,undefined:VF,void:WF,never:KF,any:JF,unknown:YF,date:XF,enum:QF,literal:eL,nan:tL,template_literal:rL,file:nL,success:iL,custom:oL,function:sL,transform:aL,map:cL,set:lL,array:uL,object:dL,union:pk,intersection:fL,tuple:pL,record:mL,nullable:hL,nonoptional:gL,default:yL,prefault:_L,catch:bL,pipe:vL,readonly:SL,promise:wL,optional:mk,lazy:xL}});var hk,Cie=y(()=>{bd();tg();hk=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Hs({processors:fk,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return Ve(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Gs(this.ctx,e);let n=Zs(this.ctx,e),{"~standard":i,...o}=n;return o}}});var Die={};var Nie=y(()=>{});var mi={};Pr(mi,{$ZodAny:()=>J0,$ZodArray:()=>t$,$ZodAsyncError:()=>fi,$ZodBase64:()=>z0,$ZodBase64URL:()=>U0,$ZodBigInt:()=>Oh,$ZodBigIntFormat:()=>Z0,$ZodBoolean:()=>Qu,$ZodCIDRv4:()=>F0,$ZodCIDRv6:()=>L0,$ZodCUID:()=>R0,$ZodCUID2:()=>I0,$ZodCatch:()=>b$,$ZodCheck:()=>Qe,$ZodCheckBigIntFormat:()=>JM,$ZodCheckEndsWith:()=>cF,$ZodCheckGreaterThan:()=>_0,$ZodCheckIncludes:()=>sF,$ZodCheckLengthEquals:()=>rF,$ZodCheckLessThan:()=>y0,$ZodCheckLowerCase:()=>iF,$ZodCheckMaxLength:()=>eF,$ZodCheckMaxSize:()=>YM,$ZodCheckMimeType:()=>uF,$ZodCheckMinLength:()=>tF,$ZodCheckMinSize:()=>XM,$ZodCheckMultipleOf:()=>WM,$ZodCheckNumberFormat:()=>KM,$ZodCheckOverwrite:()=>dF,$ZodCheckProperty:()=>lF,$ZodCheckRegex:()=>nF,$ZodCheckSizeEquals:()=>QM,$ZodCheckStartsWith:()=>aF,$ZodCheckStringFormat:()=>Xu,$ZodCheckUpperCase:()=>oF,$ZodCodec:()=>td,$ZodCustom:()=>E$,$ZodCustomStringFormat:()=>H0,$ZodDate:()=>e$,$ZodDefault:()=>h$,$ZodDiscriminatedUnion:()=>i$,$ZodE164:()=>q0,$ZodEmail:()=>E0,$ZodEmoji:()=>T0,$ZodEncodeError:()=>Ds,$ZodEnum:()=>l$,$ZodError:()=>wh,$ZodExactOptional:()=>p$,$ZodFile:()=>d$,$ZodFunction:()=>x$,$ZodGUID:()=>$0,$ZodIPv4:()=>N0,$ZodIPv6:()=>j0,$ZodISODate:()=>yF,$ZodISODateTime:()=>gF,$ZodISODuration:()=>bF,$ZodISOTime:()=>_F,$ZodIntersection:()=>o$,$ZodJWT:()=>B0,$ZodKSUID:()=>D0,$ZodLazy:()=>k$,$ZodLiteral:()=>u$,$ZodMAC:()=>M0,$ZodMap:()=>a$,$ZodNaN:()=>v$,$ZodNanoID:()=>O0,$ZodNever:()=>X0,$ZodNonOptional:()=>y$,$ZodNull:()=>K0,$ZodNullable:()=>m$,$ZodNumber:()=>Th,$ZodNumberFormat:()=>G0,$ZodObject:()=>r$,$ZodObjectJIT:()=>SF,$ZodOptional:()=>Ih,$ZodPipe:()=>Ph,$ZodPrefault:()=>g$,$ZodPreprocess:()=>wF,$ZodPromise:()=>$$,$ZodReadonly:()=>S$,$ZodRealError:()=>Hr,$ZodRecord:()=>s$,$ZodRegistry:()=>I$,$ZodSet:()=>c$,$ZodString:()=>Us,$ZodStringFormat:()=>We,$ZodSuccess:()=>_$,$ZodSymbol:()=>V0,$ZodTemplateLiteral:()=>w$,$ZodTransform:()=>f$,$ZodTuple:()=>Rh,$ZodType:()=>ue,$ZodULID:()=>P0,$ZodURL:()=>A0,$ZodUUID:()=>k0,$ZodUndefined:()=>W0,$ZodUnion:()=>ed,$ZodUnknown:()=>Y0,$ZodVoid:()=>Q0,$ZodXID:()=>C0,$ZodXor:()=>n$,$brand:()=>iM,$constructor:()=>k,$input:()=>TF,$output:()=>AF,Doc:()=>Ah,JSONSchema:()=>Die,JSONSchemaGenerator:()=>hk,NEVER:()=>nM,TimePrecision:()=>RF,_any:()=>W$,_array:()=>LF,_base64:()=>Yh,_base64url:()=>Xh,_bigint:()=>q$,_boolean:()=>U$,_catch:()=>LBe,_check:()=>Iie,_cidrv4:()=>Kh,_cidrv6:()=>Jh,_coercedBigint:()=>MF,_coercedBoolean:()=>jF,_coercedDate:()=>FF,_coercedNumber:()=>NF,_coercedString:()=>OF,_cuid:()=>qh,_cuid2:()=>Bh,_custom:()=>sk,_date:()=>X$,_decode:()=>a0,_decodeAsync:()=>l0,_default:()=>jBe,_discriminatedUnion:()=>$Be,_e164:()=>Qh,_email:()=>Nh,_emoji:()=>zh,_encode:()=>s0,_encodeAsync:()=>c0,_endsWith:()=>dd,_enum:()=>RBe,_file:()=>ok,_float32:()=>M$,_float64:()=>F$,_gt:()=>Qi,_gte:()=>Er,_guid:()=>id,_includes:()=>ld,_int:()=>j$,_int32:()=>L$,_int64:()=>B$,_intersection:()=>kBe,_ipv4:()=>Vh,_ipv6:()=>Wh,_isoDate:()=>PF,_isoDateTime:()=>IF,_isoDuration:()=>DF,_isoTime:()=>CF,_jwt:()=>eg,_ksuid:()=>Zh,_lazy:()=>BBe,_length:()=>Rc,_literal:()=>PBe,_lowercase:()=>ad,_lt:()=>Xi,_lte:()=>Sn,_mac:()=>D$,_map:()=>TBe,_max:()=>Sn,_maxLength:()=>Oc,_maxSize:()=>Bs,_mime:()=>fd,_min:()=>Er,_minLength:()=>Uo,_minSize:()=>eo,_multipleOf:()=>qs,_nan:()=>Q$,_nanoid:()=>Uh,_nativeEnum:()=>IBe,_negative:()=>tk,_never:()=>J$,_nonnegative:()=>nk,_nonoptional:()=>MBe,_nonpositive:()=>rk,_normalize:()=>pd,_null:()=>V$,_nullable:()=>NBe,_number:()=>N$,_optional:()=>DBe,_overwrite:()=>pi,_parse:()=>Wu,_parseAsync:()=>Ku,_pipe:()=>zBe,_positive:()=>ek,_promise:()=>HBe,_property:()=>ik,_readonly:()=>UBe,_record:()=>ABe,_refine:()=>ak,_regex:()=>sd,_safeDecode:()=>d0,_safeDecodeAsync:()=>p0,_safeEncode:()=>u0,_safeEncodeAsync:()=>f0,_safeParse:()=>Ju,_safeParseAsync:()=>Yu,_set:()=>OBe,_size:()=>Tc,_slugify:()=>yd,_startsWith:()=>ud,_string:()=>C$,_stringFormat:()=>Ic,_stringbool:()=>dk,_success:()=>FBe,_superRefine:()=>ck,_symbol:()=>G$,_templateLiteral:()=>qBe,_toLowerCase:()=>hd,_toUpperCase:()=>gd,_transform:()=>CBe,_trim:()=>md,_tuple:()=>EBe,_uint32:()=>z$,_uint64:()=>H$,_ulid:()=>Hh,_undefined:()=>Z$,_union:()=>wBe,_unknown:()=>K$,_uppercase:()=>cd,_url:()=>od,_uuid:()=>jh,_uuidv4:()=>Mh,_uuidv6:()=>Fh,_uuidv7:()=>Lh,_void:()=>Y$,_xid:()=>Gh,_xor:()=>xBe,clone:()=>nr,config:()=>Tt,createStandardJSONSchemaMethod:()=>_d,createToJSONSchemaMethod:()=>zF,decode:()=>ore,decodeAsync:()=>are,describe:()=>lk,encode:()=>ire,encodeAsync:()=>sre,extractDefs:()=>Gs,finalize:()=>Zs,flattenError:()=>xh,formatError:()=>$h,globalConfig:()=>wc,globalRegistry:()=>ir,initializeContext:()=>Hs,isValidBase64:()=>vF,isValidBase64URL:()=>Pre,isValidJWT:()=>Cre,locales:()=>nd,meta:()=>uk,parse:()=>kc,parseAsync:()=>Ec,prettifyError:()=>gM,process:()=>Ve,regexes:()=>Gr,registry:()=>P$,safeDecode:()=>lre,safeDecodeAsync:()=>dre,safeEncode:()=>cre,safeEncodeAsync:()=>ure,safeParse:()=>Ls,safeParseAsync:()=>zs,toDotPath:()=>nre,toJSONSchema:()=>Pc,treeifyError:()=>hM,util:()=>M,version:()=>pF});var mr=y(()=>{xc();_M();yM();xF();b0();mF();ee();g0();R$();Dh();fF();Pie();tg();bd();Cie();Nie()});var $L=y(()=>{mr()});function kL(t,e){let r={type:"object",shape:t??{},...U(e)};return new KBe(r)}var WBe,KBe,jie=y(()=>{mr();ee();$L();WBe=k("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");ue.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>kc(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Ls(t,r,n),t.parseAsync=async(r,n)=>Ec(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>zs(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>nr(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),KBe=k("ZodMiniObject",(t,e)=>{r$.init(t,e),WBe.init(t,e),ve(t,"shape",()=>e.shape)})});var Mie=y(()=>{});var Fie=y(()=>{});var Lie=y(()=>{});var zie=y(()=>{mr();$L();jie();Mie();bd();R$();Fie();Lie()});var EL=y(()=>{zie()});function Ln(t){return!!t._zod}function Cc(t){let e=Object.values(t);if(e.length===0)return kL({});let r=e.every(Ln),n=e.every(i=>!Ln(i));if(r)return kL(t);if(n)return Bte(t);throw new Error("Mixed Zod versions detected in object shape.")}function Vs(t,e){return Ln(t)?Ls(t,e):t.safeParse(e)}async function gk(t,e){return Ln(t)?await zs(t,e):await t.safeParseAsync(e)}function Ws(t){if(!t)return;let e;if(Ln(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function vd(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let n=Object.values(t);if(n.length>0&&n.every(i=>typeof i=="object"&&i!==null&&(i._def!==void 0||i._zod!==void 0||typeof i.parse=="function")))return Cc(t)}}if(Ln(t)){let r=t._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function yk(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function qie(t){return t.description}function Bie(t){if(Ln(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function _k(t){if(Ln(t)){let o=t._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}var rg=y(()=>{hh();EL()});var bk={};Pr(bk,{endsWith:()=>dd,gt:()=>Qi,gte:()=>Er,includes:()=>ld,length:()=>Rc,lowercase:()=>ad,lt:()=>Xi,lte:()=>Sn,maxLength:()=>Oc,maxSize:()=>Bs,mime:()=>fd,minLength:()=>Uo,minSize:()=>eo,multipleOf:()=>qs,negative:()=>tk,nonnegative:()=>nk,nonpositive:()=>rk,normalize:()=>pd,overwrite:()=>pi,positive:()=>ek,property:()=>ik,regex:()=>sd,size:()=>Tc,slugify:()=>yd,startsWith:()=>ud,toLowerCase:()=>hd,toUpperCase:()=>gd,trim:()=>md,uppercase:()=>cd});var vk=y(()=>{mr()});var Ks={};Pr(Ks,{ZodISODate:()=>wk,ZodISODateTime:()=>Sk,ZodISODuration:()=>$k,ZodISOTime:()=>xk,date:()=>TL,datetime:()=>AL,duration:()=>RL,time:()=>OL});function AL(t){return IF(Sk,t)}function TL(t){return PF(wk,t)}function OL(t){return CF(xk,t)}function RL(t){return DF($k,t)}var Sk,wk,xk,$k,ng=y(()=>{mr();og();Sk=k("ZodISODateTime",(t,e)=>{gF.init(t,e),et.init(t,e)});wk=k("ZodISODate",(t,e)=>{yF.init(t,e),et.init(t,e)});xk=k("ZodISOTime",(t,e)=>{_F.init(t,e),et.init(t,e)});$k=k("ZodISODuration",(t,e)=>{bF.init(t,e),et.init(t,e)})});var Hie,XBe,Zr,IL=y(()=>{mr();mr();ee();Hie=(t,e)=>{wh.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>$h(t,r)},flatten:{value:r=>xh(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Gu,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Gu,2)}},isEmpty:{get(){return t.issues.length===0}}})},XBe=k("ZodError",Hie),Zr=k("ZodError",Hie,{Parent:Error})});var PL,CL,DL,NL,jL,ML,FL,LL,zL,UL,qL,BL,HL=y(()=>{mr();IL();PL=Wu(Zr),CL=Ku(Zr),DL=Ju(Zr),NL=Yu(Zr),jL=s0(Zr),ML=a0(Zr),FL=c0(Zr),LL=l0(Zr),zL=u0(Zr),UL=d0(Zr),qL=f0(Zr),BL=p0(Zr)});var ig={};Pr(ig,{ZodAny:()=>KL,ZodArray:()=>QL,ZodBase64:()=>zk,ZodBase64URL:()=>Uk,ZodBigInt:()=>Ad,ZodBigIntFormat:()=>Hk,ZodBoolean:()=>Ed,ZodCIDRv4:()=>Fk,ZodCIDRv6:()=>Lk,ZodCUID:()=>Ik,ZodCUID2:()=>Pk,ZodCatch:()=>bz,ZodCodec:()=>gg,ZodCustom:()=>yg,ZodCustomStringFormat:()=>$d,ZodDate:()=>dg,ZodDefault:()=>pz,ZodDiscriminatedUnion:()=>tz,ZodE164:()=>qk,ZodEmail:()=>Tk,ZodEmoji:()=>Ok,ZodEnum:()=>wd,ZodExactOptional:()=>uz,ZodFile:()=>cz,ZodFunction:()=>Oz,ZodGUID:()=>sg,ZodIPv4:()=>jk,ZodIPv6:()=>Mk,ZodIntersection:()=>rz,ZodJWT:()=>Bk,ZodKSUID:()=>Nk,ZodLazy:()=>Ez,ZodLiteral:()=>az,ZodMAC:()=>GL,ZodMap:()=>oz,ZodNaN:()=>Sz,ZodNanoID:()=>Rk,ZodNever:()=>YL,ZodNonOptional:()=>Vk,ZodNull:()=>WL,ZodNullable:()=>fz,ZodNumber:()=>kd,ZodNumberFormat:()=>Dc,ZodObject:()=>fg,ZodOptional:()=>Od,ZodPipe:()=>hg,ZodPrefault:()=>hz,ZodPreprocess:()=>wz,ZodPromise:()=>Tz,ZodReadonly:()=>xz,ZodRecord:()=>Sd,ZodSet:()=>sz,ZodString:()=>xd,ZodStringFormat:()=>et,ZodSuccess:()=>_z,ZodSymbol:()=>ZL,ZodTemplateLiteral:()=>kz,ZodTransform:()=>lz,ZodTuple:()=>nz,ZodType:()=>_e,ZodULID:()=>Ck,ZodURL:()=>lg,ZodUUID:()=>to,ZodUndefined:()=>VL,ZodUnion:()=>pg,ZodUnknown:()=>JL,ZodVoid:()=>XL,ZodXID:()=>Dk,ZodXor:()=>ez,_ZodString:()=>Ak,_default:()=>mz,_function:()=>Woe,any:()=>Ooe,array:()=>ke,base64:()=>foe,base64url:()=>poe,bigint:()=>$oe,boolean:()=>It,catch:()=>vz,check:()=>Koe,cidrv4:()=>uoe,cidrv6:()=>doe,codec:()=>Hoe,cuid:()=>roe,cuid2:()=>noe,custom:()=>Wk,date:()=>Ioe,describe:()=>Joe,discriminatedUnion:()=>mg,e164:()=>moe,email:()=>Zie,emoji:()=>eoe,enum:()=>sr,exactOptional:()=>dz,file:()=>zoe,float32:()=>voe,float64:()=>Soe,function:()=>Woe,guid:()=>Vie,hash:()=>boe,hex:()=>_oe,hostname:()=>yoe,httpUrl:()=>Qie,instanceof:()=>Xoe,int:()=>kk,int32:()=>woe,int64:()=>koe,intersection:()=>Td,invertCodec:()=>Goe,ipv4:()=>aoe,ipv6:()=>loe,json:()=>ese,jwt:()=>hoe,keyof:()=>Poe,ksuid:()=>soe,lazy:()=>Az,literal:()=>ne,looseObject:()=>or,looseRecord:()=>joe,mac:()=>coe,map:()=>Moe,meta:()=>Yoe,nan:()=>Boe,nanoid:()=>toe,nativeEnum:()=>Loe,never:()=>Gk,nonoptional:()=>yz,null:()=>ug,nullable:()=>ag,nullish:()=>Uoe,number:()=>Me,object:()=>W,optional:()=>at,partialRecord:()=>Noe,pipe:()=>Ek,prefault:()=>gz,preprocess:()=>_g,promise:()=>Voe,readonly:()=>$z,record:()=>Ke,refine:()=>Rz,set:()=>Foe,strictObject:()=>Coe,string:()=>I,stringFormat:()=>goe,stringbool:()=>Qoe,success:()=>qoe,superRefine:()=>Iz,symbol:()=>Aoe,templateLiteral:()=>Zoe,transform:()=>Zk,tuple:()=>iz,uint32:()=>xoe,uint64:()=>Eoe,ulid:()=>ioe,undefined:()=>Toe,union:()=>rt,unknown:()=>tt,url:()=>Xie,uuid:()=>Wie,uuidv4:()=>Kie,uuidv6:()=>Jie,uuidv7:()=>Yie,void:()=>Roe,xid:()=>ooe,xor:()=>Doe});function cg(t,e,r){let n=Object.getPrototypeOf(t),i=Gie.get(n);if(i||(i=new Set,Gie.set(n,i)),!i.has(e)){i.add(e);for(let o in r){let s=r[o];Object.defineProperty(n,o,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}function I(t){return C$(xd,t)}function Zie(t){return Nh(Tk,t)}function Vie(t){return id(sg,t)}function Wie(t){return jh(to,t)}function Kie(t){return Mh(to,t)}function Jie(t){return Fh(to,t)}function Yie(t){return Lh(to,t)}function Xie(t){return od(lg,t)}function Qie(t){return od(lg,{protocol:Gr.httpProtocol,hostname:Gr.domain,...M.normalizeParams(t)})}function eoe(t){return zh(Ok,t)}function toe(t){return Uh(Rk,t)}function roe(t){return qh(Ik,t)}function noe(t){return Bh(Pk,t)}function ioe(t){return Hh(Ck,t)}function ooe(t){return Gh(Dk,t)}function soe(t){return Zh(Nk,t)}function aoe(t){return Vh(jk,t)}function coe(t){return D$(GL,t)}function loe(t){return Wh(Mk,t)}function uoe(t){return Kh(Fk,t)}function doe(t){return Jh(Lk,t)}function foe(t){return Yh(zk,t)}function poe(t){return Xh(Uk,t)}function moe(t){return Qh(qk,t)}function hoe(t){return eg(Bk,t)}function goe(t,e,r={}){return Ic($d,t,e,r)}function yoe(t){return Ic($d,"hostname",Gr.hostname,t)}function _oe(t){return Ic($d,"hex",Gr.hex,t)}function boe(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Gr[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Ic($d,n,i,e)}function Me(t){return N$(kd,t)}function kk(t){return j$(Dc,t)}function voe(t){return M$(Dc,t)}function Soe(t){return F$(Dc,t)}function woe(t){return L$(Dc,t)}function xoe(t){return z$(Dc,t)}function It(t){return U$(Ed,t)}function $oe(t){return q$(Ad,t)}function koe(t){return B$(Hk,t)}function Eoe(t){return H$(Hk,t)}function Aoe(t){return G$(ZL,t)}function Toe(t){return Z$(VL,t)}function ug(t){return V$(WL,t)}function Ooe(){return W$(KL)}function tt(){return K$(JL)}function Gk(t){return J$(YL,t)}function Roe(t){return Y$(XL,t)}function Ioe(t){return X$(dg,t)}function ke(t,e){return LF(QL,t,e)}function Poe(t){let e=t._zod.def.shape;return sr(Object.keys(e))}function W(t,e){let r={type:"object",shape:t??{},...M.normalizeParams(e)};return new fg(r)}function Coe(t,e){return new fg({type:"object",shape:t,catchall:Gk(),...M.normalizeParams(e)})}function or(t,e){return new fg({type:"object",shape:t,catchall:tt(),...M.normalizeParams(e)})}function rt(t,e){return new pg({type:"union",options:t,...M.normalizeParams(e)})}function Doe(t,e){return new ez({type:"union",options:t,inclusive:!1,...M.normalizeParams(e)})}function mg(t,e,r){return new tz({type:"union",options:e,discriminator:t,...M.normalizeParams(r)})}function Td(t,e){return new rz({type:"intersection",left:t,right:e})}function iz(t,e,r){let n=e instanceof ue,i=n?r:e,o=n?e:null;return new nz({type:"tuple",items:t,rest:o,...M.normalizeParams(i)})}function Ke(t,e,r){return!e||!e._zod?new Sd({type:"record",keyType:I(),valueType:t,...M.normalizeParams(e)}):new Sd({type:"record",keyType:t,valueType:e,...M.normalizeParams(r)})}function Noe(t,e,r){let n=nr(t);return n._zod.values=void 0,new Sd({type:"record",keyType:n,valueType:e,...M.normalizeParams(r)})}function joe(t,e,r){return new Sd({type:"record",keyType:t,valueType:e,mode:"loose",...M.normalizeParams(r)})}function Moe(t,e,r){return new oz({type:"map",keyType:t,valueType:e,...M.normalizeParams(r)})}function Foe(t,e){return new sz({type:"set",valueType:t,...M.normalizeParams(e)})}function sr(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new wd({type:"enum",entries:r,...M.normalizeParams(e)})}function Loe(t,e){return new wd({type:"enum",entries:t,...M.normalizeParams(e)})}function ne(t,e){return new az({type:"literal",values:Array.isArray(t)?t:[t],...M.normalizeParams(e)})}function zoe(t){return ok(cz,t)}function Zk(t){return new lz({type:"transform",transform:t})}function at(t){return new Od({type:"optional",innerType:t})}function dz(t){return new uz({type:"optional",innerType:t})}function ag(t){return new fz({type:"nullable",innerType:t})}function Uoe(t){return at(ag(t))}function mz(t,e){return new pz({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():M.shallowClone(e)}})}function gz(t,e){return new hz({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():M.shallowClone(e)}})}function yz(t,e){return new Vk({type:"nonoptional",innerType:t,...M.normalizeParams(e)})}function qoe(t){return new _z({type:"success",innerType:t})}function vz(t,e){return new bz({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function Boe(t){return Q$(Sz,t)}function Ek(t,e){return new hg({type:"pipe",in:t,out:e})}function Hoe(t,e,r){return new gg({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function Goe(t){let e=t._zod.def;return new gg({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function $z(t){return new xz({type:"readonly",innerType:t})}function Zoe(t,e){return new kz({type:"template_literal",parts:t,...M.normalizeParams(e)})}function Az(t){return new Ez({type:"lazy",getter:t})}function Voe(t){return new Tz({type:"promise",innerType:t})}function Woe(t){return new Oz({type:"function",input:Array.isArray(t?.input)?iz(t?.input):t?.input??ke(tt()),output:t?.output??tt()})}function Koe(t){let e=new Qe({check:"custom"});return e._zod.check=t,e}function Wk(t,e){return sk(yg,t??(()=>!0),e)}function Rz(t,e={}){return ak(yg,t,e)}function Iz(t,e){return ck(t,e)}function Xoe(t,e={}){let r=new yg({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...M.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}function ese(t){let e=Az(()=>rt([I(t),Me(),It(),ug(),ke(e),Ke(I(),e)]));return e}function _g(t,e){return new wz({type:"pipe",in:Zk(t),out:e})}var Gie,_e,Ak,xd,et,Tk,sg,to,lg,Ok,Rk,Ik,Pk,Ck,Dk,Nk,jk,GL,Mk,Fk,Lk,zk,Uk,qk,Bk,$d,kd,Dc,Ed,Ad,Hk,ZL,VL,WL,KL,JL,YL,XL,dg,QL,fg,pg,ez,tz,rz,nz,Sd,oz,sz,wd,az,cz,lz,Od,uz,fz,pz,hz,Vk,_z,bz,Sz,hg,gg,wz,xz,kz,Ez,Tz,Oz,yg,Joe,Yoe,Qoe,og=y(()=>{mr();mr();bd();tg();vk();ng();HL();Gie=new WeakMap;_e=k("ZodType",(t,e)=>(ue.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:_d(t,"input"),output:_d(t,"output")}}),t.toJSONSchema=zF(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>PL(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>DL(t,r,n),t.parseAsync=async(r,n)=>CL(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>NL(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>jL(t,r,n),t.decode=(r,n)=>ML(t,r,n),t.encodeAsync=async(r,n)=>FL(t,r,n),t.decodeAsync=async(r,n)=>LL(t,r,n),t.safeEncode=(r,n)=>zL(t,r,n),t.safeDecode=(r,n)=>UL(t,r,n),t.safeEncodeAsync=async(r,n)=>qL(t,r,n),t.safeDecodeAsync=async(r,n)=>BL(t,r,n),cg(t,"ZodType",{check(...r){let n=this.def;return this.clone(M.mergeDefs(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return nr(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(Rz(r,n))},superRefine(r,n){return this.check(Iz(r,n))},overwrite(r){return this.check(pi(r))},optional(){return at(this)},exactOptional(){return dz(this)},nullable(){return ag(this)},nullish(){return at(ag(this))},nonoptional(r){return yz(this,r)},array(){return ke(this)},or(r){return rt([this,r])},and(r){return Td(this,r)},transform(r){return Ek(this,Zk(r))},default(r){return mz(this,r)},prefault(r){return gz(this,r)},catch(r){return vz(this,r)},pipe(r){return Ek(this,r)},readonly(){return $z(this)},describe(r){let n=this.clone();return ir.add(n,{description:r}),n},meta(...r){if(r.length===0)return ir.get(this);let n=this.clone();return ir.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return ir.get(t)?.description},configurable:!0}),t)),Ak=k("_ZodString",(t,e)=>{Us.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>UF(t,n,i,o);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,cg(t,"_ZodString",{regex(...n){return this.check(sd(...n))},includes(...n){return this.check(ld(...n))},startsWith(...n){return this.check(ud(...n))},endsWith(...n){return this.check(dd(...n))},min(...n){return this.check(Uo(...n))},max(...n){return this.check(Oc(...n))},length(...n){return this.check(Rc(...n))},nonempty(...n){return this.check(Uo(1,...n))},lowercase(n){return this.check(ad(n))},uppercase(n){return this.check(cd(n))},trim(){return this.check(md())},normalize(...n){return this.check(pd(...n))},toLowerCase(){return this.check(hd())},toUpperCase(){return this.check(gd())},slugify(){return this.check(yd())}})}),xd=k("ZodString",(t,e)=>{Us.init(t,e),Ak.init(t,e),t.email=r=>t.check(Nh(Tk,r)),t.url=r=>t.check(od(lg,r)),t.jwt=r=>t.check(eg(Bk,r)),t.emoji=r=>t.check(zh(Ok,r)),t.guid=r=>t.check(id(sg,r)),t.uuid=r=>t.check(jh(to,r)),t.uuidv4=r=>t.check(Mh(to,r)),t.uuidv6=r=>t.check(Fh(to,r)),t.uuidv7=r=>t.check(Lh(to,r)),t.nanoid=r=>t.check(Uh(Rk,r)),t.guid=r=>t.check(id(sg,r)),t.cuid=r=>t.check(qh(Ik,r)),t.cuid2=r=>t.check(Bh(Pk,r)),t.ulid=r=>t.check(Hh(Ck,r)),t.base64=r=>t.check(Yh(zk,r)),t.base64url=r=>t.check(Xh(Uk,r)),t.xid=r=>t.check(Gh(Dk,r)),t.ksuid=r=>t.check(Zh(Nk,r)),t.ipv4=r=>t.check(Vh(jk,r)),t.ipv6=r=>t.check(Wh(Mk,r)),t.cidrv4=r=>t.check(Kh(Fk,r)),t.cidrv6=r=>t.check(Jh(Lk,r)),t.e164=r=>t.check(Qh(qk,r)),t.datetime=r=>t.check(AL(r)),t.date=r=>t.check(TL(r)),t.time=r=>t.check(OL(r)),t.duration=r=>t.check(RL(r))});et=k("ZodStringFormat",(t,e)=>{We.init(t,e),Ak.init(t,e)}),Tk=k("ZodEmail",(t,e)=>{E0.init(t,e),et.init(t,e)});sg=k("ZodGUID",(t,e)=>{$0.init(t,e),et.init(t,e)});to=k("ZodUUID",(t,e)=>{k0.init(t,e),et.init(t,e)});lg=k("ZodURL",(t,e)=>{A0.init(t,e),et.init(t,e)});Ok=k("ZodEmoji",(t,e)=>{T0.init(t,e),et.init(t,e)});Rk=k("ZodNanoID",(t,e)=>{O0.init(t,e),et.init(t,e)});Ik=k("ZodCUID",(t,e)=>{R0.init(t,e),et.init(t,e)});Pk=k("ZodCUID2",(t,e)=>{I0.init(t,e),et.init(t,e)});Ck=k("ZodULID",(t,e)=>{P0.init(t,e),et.init(t,e)});Dk=k("ZodXID",(t,e)=>{C0.init(t,e),et.init(t,e)});Nk=k("ZodKSUID",(t,e)=>{D0.init(t,e),et.init(t,e)});jk=k("ZodIPv4",(t,e)=>{N0.init(t,e),et.init(t,e)});GL=k("ZodMAC",(t,e)=>{M0.init(t,e),et.init(t,e)});Mk=k("ZodIPv6",(t,e)=>{j0.init(t,e),et.init(t,e)});Fk=k("ZodCIDRv4",(t,e)=>{F0.init(t,e),et.init(t,e)});Lk=k("ZodCIDRv6",(t,e)=>{L0.init(t,e),et.init(t,e)});zk=k("ZodBase64",(t,e)=>{z0.init(t,e),et.init(t,e)});Uk=k("ZodBase64URL",(t,e)=>{U0.init(t,e),et.init(t,e)});qk=k("ZodE164",(t,e)=>{q0.init(t,e),et.init(t,e)});Bk=k("ZodJWT",(t,e)=>{B0.init(t,e),et.init(t,e)});$d=k("ZodCustomStringFormat",(t,e)=>{H0.init(t,e),et.init(t,e)});kd=k("ZodNumber",(t,e)=>{Th.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>qF(t,n,i,o),cg(t,"ZodNumber",{gt(n,i){return this.check(Qi(n,i))},gte(n,i){return this.check(Er(n,i))},min(n,i){return this.check(Er(n,i))},lt(n,i){return this.check(Xi(n,i))},lte(n,i){return this.check(Sn(n,i))},max(n,i){return this.check(Sn(n,i))},int(n){return this.check(kk(n))},safe(n){return this.check(kk(n))},positive(n){return this.check(Qi(0,n))},nonnegative(n){return this.check(Er(0,n))},negative(n){return this.check(Xi(0,n))},nonpositive(n){return this.check(Sn(0,n))},multipleOf(n,i){return this.check(qs(n,i))},step(n,i){return this.check(qs(n,i))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});Dc=k("ZodNumberFormat",(t,e)=>{G0.init(t,e),kd.init(t,e)});Ed=k("ZodBoolean",(t,e)=>{Qu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>BF(t,r,n,i)});Ad=k("ZodBigInt",(t,e)=>{Oh.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>HF(t,n,i,o),t.gte=(n,i)=>t.check(Er(n,i)),t.min=(n,i)=>t.check(Er(n,i)),t.gt=(n,i)=>t.check(Qi(n,i)),t.gte=(n,i)=>t.check(Er(n,i)),t.min=(n,i)=>t.check(Er(n,i)),t.lt=(n,i)=>t.check(Xi(n,i)),t.lte=(n,i)=>t.check(Sn(n,i)),t.max=(n,i)=>t.check(Sn(n,i)),t.positive=n=>t.check(Qi(BigInt(0),n)),t.negative=n=>t.check(Xi(BigInt(0),n)),t.nonpositive=n=>t.check(Sn(BigInt(0),n)),t.nonnegative=n=>t.check(Er(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(qs(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});Hk=k("ZodBigIntFormat",(t,e)=>{Z0.init(t,e),Ad.init(t,e)});ZL=k("ZodSymbol",(t,e)=>{V0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>GF(t,r,n,i)});VL=k("ZodUndefined",(t,e)=>{W0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>VF(t,r,n,i)});WL=k("ZodNull",(t,e)=>{K0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ZF(t,r,n,i)});KL=k("ZodAny",(t,e)=>{J0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>JF(t,r,n,i)});JL=k("ZodUnknown",(t,e)=>{Y0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>YF(t,r,n,i)});YL=k("ZodNever",(t,e)=>{X0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KF(t,r,n,i)});XL=k("ZodVoid",(t,e)=>{Q0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>WF(t,r,n,i)});dg=k("ZodDate",(t,e)=>{e$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>XF(t,n,i,o),t.min=(n,i)=>t.check(Er(n,i)),t.max=(n,i)=>t.check(Sn(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});QL=k("ZodArray",(t,e)=>{t$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uL(t,r,n,i),t.element=e.element,cg(t,"ZodArray",{min(r,n){return this.check(Uo(r,n))},nonempty(r){return this.check(Uo(1,r))},max(r,n){return this.check(Oc(r,n))},length(r,n){return this.check(Rc(r,n))},unwrap(){return this.element}})});fg=k("ZodObject",(t,e)=>{SF.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dL(t,r,n,i),M.defineLazy(t,"shape",()=>e.shape),cg(t,"ZodObject",{keyof(){return sr(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:tt()})},loose(){return this.clone({...this._zod.def,catchall:tt()})},strict(){return this.clone({...this._zod.def,catchall:Gk()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return M.extend(this,r)},safeExtend(r){return M.safeExtend(this,r)},merge(r){return M.merge(this,r)},pick(r){return M.pick(this,r)},omit(r){return M.omit(this,r)},partial(...r){return M.partial(Od,this,r[0])},required(...r){return M.required(Vk,this,r[0])}})});pg=k("ZodUnion",(t,e)=>{ed.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pk(t,r,n,i),t.options=e.options});ez=k("ZodXor",(t,e)=>{pg.init(t,e),n$.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pk(t,r,n,i),t.options=e.options});tz=k("ZodDiscriminatedUnion",(t,e)=>{pg.init(t,e),i$.init(t,e)});rz=k("ZodIntersection",(t,e)=>{o$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fL(t,r,n,i)});nz=k("ZodTuple",(t,e)=>{Rh.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pL(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});Sd=k("ZodRecord",(t,e)=>{s$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mL(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});oz=k("ZodMap",(t,e)=>{a$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cL(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(eo(...r)),t.nonempty=r=>t.check(eo(1,r)),t.max=(...r)=>t.check(Bs(...r)),t.size=(...r)=>t.check(Tc(...r))});sz=k("ZodSet",(t,e)=>{c$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lL(t,r,n,i),t.min=(...r)=>t.check(eo(...r)),t.nonempty=r=>t.check(eo(1,r)),t.max=(...r)=>t.check(Bs(...r)),t.size=(...r)=>t.check(Tc(...r))});wd=k("ZodEnum",(t,e)=>{l$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>QF(t,n,i,o),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let o={};for(let s of n)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new wd({...e,checks:[],...M.normalizeParams(i),entries:o})},t.exclude=(n,i)=>{let o={...e.entries};for(let s of n)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new wd({...e,checks:[],...M.normalizeParams(i),entries:o})}});az=k("ZodLiteral",(t,e)=>{u$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>eL(t,r,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});cz=k("ZodFile",(t,e)=>{d$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nL(t,r,n,i),t.min=(r,n)=>t.check(eo(r,n)),t.max=(r,n)=>t.check(Bs(r,n)),t.mime=(r,n)=>t.check(fd(Array.isArray(r)?r:[r],n))});lz=k("ZodTransform",(t,e)=>{f$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>aL(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(M.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),r.issues.push(M.issue(s))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(o=>(r.value=o,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});Od=k("ZodOptional",(t,e)=>{Ih.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});uz=k("ZodExactOptional",(t,e)=>{p$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});fz=k("ZodNullable",(t,e)=>{m$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});pz=k("ZodDefault",(t,e)=>{h$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});hz=k("ZodPrefault",(t,e)=>{g$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_L(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});Vk=k("ZodNonOptional",(t,e)=>{y$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});_z=k("ZodSuccess",(t,e)=>{_$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>iL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});bz=k("ZodCatch",(t,e)=>{b$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});Sz=k("ZodNaN",(t,e)=>{v$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tL(t,r,n,i)});hg=k("ZodPipe",(t,e)=>{Ph.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vL(t,r,n,i),t.in=e.in,t.out=e.out});gg=k("ZodCodec",(t,e)=>{hg.init(t,e),td.init(t,e)});wz=k("ZodPreprocess",(t,e)=>{hg.init(t,e),wF.init(t,e)}),xz=k("ZodReadonly",(t,e)=>{S$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>SL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});kz=k("ZodTemplateLiteral",(t,e)=>{w$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>rL(t,r,n,i)});Ez=k("ZodLazy",(t,e)=>{k$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xL(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});Tz=k("ZodPromise",(t,e)=>{$$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});Oz=k("ZodFunction",(t,e)=>{x$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sL(t,r,n,i)});yg=k("ZodCustom",(t,e)=>{E$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>oL(t,r,n,i)});Joe=lk,Yoe=uk;Qoe=(...t)=>dk({Codec:gg,Boolean:Ed,String:xd},...t)});function tHe(t){Tt({customError:t})}function rHe(){return Tt().customError}var eHe,Pz,tse=y(()=>{mr();eHe={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};Pz||(Pz={})});function iHe(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function oHe(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${t}`);return e.defs[i]}throw new Error(`Reference not found: ${t}`)}function rse(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return Z.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let i=t.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return Z.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let o=oHe(i,e),s=hr(o,e);return e.refs.set(i,s),e.processing.delete(i),s}if(t.enum!==void 0){let i=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&i.length===1&&i[0]===null)return Z.null();if(i.length===0)return Z.never();if(i.length===1)return Z.literal(i[0]);if(i.every(s=>typeof s=="string"))return Z.enum(i);let o=i.map(s=>Z.literal(s));return o.length<2?o[0]:Z.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return Z.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(o=>{let s={...t,type:o};return rse(s,e)});return i.length===0?Z.never():i.length===1?i[0]:Z.union(i)}if(!r)return Z.any();let n;switch(r){case"string":{let i=Z.string();if(t.format){let o=t.format;o==="email"?i=i.check(Z.email()):o==="uri"||o==="uri-reference"?i=i.check(Z.url()):o==="uuid"||o==="guid"?i=i.check(Z.uuid()):o==="date-time"?i=i.check(Z.iso.datetime()):o==="date"?i=i.check(Z.iso.date()):o==="time"?i=i.check(Z.iso.time()):o==="duration"?i=i.check(Z.iso.duration()):o==="ipv4"?i=i.check(Z.ipv4()):o==="ipv6"?i=i.check(Z.ipv6()):o==="mac"?i=i.check(Z.mac()):o==="cidr"?i=i.check(Z.cidrv4()):o==="cidr-v6"?i=i.check(Z.cidrv6()):o==="base64"?i=i.check(Z.base64()):o==="base64url"?i=i.check(Z.base64url()):o==="e164"?i=i.check(Z.e164()):o==="jwt"?i=i.check(Z.jwt()):o==="emoji"?i=i.check(Z.emoji()):o==="nanoid"?i=i.check(Z.nanoid()):o==="cuid"?i=i.check(Z.cuid()):o==="cuid2"?i=i.check(Z.cuid2()):o==="ulid"?i=i.check(Z.ulid()):o==="xid"?i=i.check(Z.xid()):o==="ksuid"&&(i=i.check(Z.ksuid()))}typeof t.minLength=="number"&&(i=i.min(t.minLength)),typeof t.maxLength=="number"&&(i=i.max(t.maxLength)),t.pattern&&(i=i.regex(new RegExp(t.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?Z.number().int():Z.number();typeof t.minimum=="number"&&(i=i.min(t.minimum)),typeof t.maximum=="number"&&(i=i.max(t.maximum)),typeof t.exclusiveMinimum=="number"?i=i.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(i=i.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?i=i.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(i=i.lt(t.maximum)),typeof t.multipleOf=="number"&&(i=i.multipleOf(t.multipleOf)),n=i;break}case"boolean":{n=Z.boolean();break}case"null":{n=Z.null();break}case"object":{let i={},o=t.properties||{},s=new Set(t.required||[]);for(let[c,l]of Object.entries(o)){let u=hr(l,e);i[c]=s.has(c)?u:u.optional()}if(t.propertyNames){let c=hr(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?hr(t.additionalProperties,e):Z.any();if(Object.keys(i).length===0){n=Z.record(c,l);break}let u=Z.object(i).passthrough(),d=Z.looseRecord(c,l);n=Z.intersection(u,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),u=[];for(let f of l){let p=hr(c[f],e),m=Z.string().regex(new RegExp(f));u.push(Z.looseRecord(m,p))}let d=[];if(Object.keys(i).length>0&&d.push(Z.object(i).passthrough()),d.push(...u),d.length===0)n=Z.object({}).passthrough();else if(d.length===1)n=d[0];else{let f=Z.intersection(d[0],d[1]);for(let p=2;phr(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?hr(o,e):void 0;a?n=Z.tuple(s).rest(a):n=Z.tuple(s),typeof t.minItems=="number"&&(n=n.check(Z.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(Z.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>hr(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?hr(t.additionalItems,e):void 0;a?n=Z.tuple(s).rest(a):n=Z.tuple(s),typeof t.minItems=="number"&&(n=n.check(Z.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(Z.maxLength(t.maxItems)))}else if(o!==void 0){let s=hr(o,e),a=Z.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),n=a}else n=Z.array(Z.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function hr(t,e){if(typeof t=="boolean")return t?Z.any():Z.never();let r=rse(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(l=>hr(l,e)),c=Z.union(a);r=n?Z.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(l=>hr(l,e)),c=Z.xor(a);r=n?Z.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:Z.any();else{let a=n?r:hr(t.allOf[0],e),c=n?0:1;for(let l=c;l0&&e.registry.add(r,i),t.description&&(r=r.describe(t.description)),r}function nse(t,e){if(typeof t=="boolean")return t?Z.any():Z.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=iHe(r,e?.defaultTarget),i=r.$defs||r.definitions||{},o={version:n,defs:i,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??ir};return hr(r,o)}var Z,nHe,ise=y(()=>{Dh();vk();ng();og();Z={...ig,...bk,iso:Ks},nHe=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var Cz={};Pr(Cz,{bigint:()=>lHe,boolean:()=>cHe,date:()=>uHe,number:()=>aHe,string:()=>sHe});function sHe(t){return OF(xd,t)}function aHe(t){return NF(kd,t)}function cHe(t){return jF(Ed,t)}function lHe(t){return MF(Ad,t)}function uHe(t){return FF(dg,t)}var ose=y(()=>{mr();og()});var E={};Pr(E,{$brand:()=>iM,$input:()=>TF,$output:()=>AF,NEVER:()=>nM,TimePrecision:()=>RF,ZodAny:()=>KL,ZodArray:()=>QL,ZodBase64:()=>zk,ZodBase64URL:()=>Uk,ZodBigInt:()=>Ad,ZodBigIntFormat:()=>Hk,ZodBoolean:()=>Ed,ZodCIDRv4:()=>Fk,ZodCIDRv6:()=>Lk,ZodCUID:()=>Ik,ZodCUID2:()=>Pk,ZodCatch:()=>bz,ZodCodec:()=>gg,ZodCustom:()=>yg,ZodCustomStringFormat:()=>$d,ZodDate:()=>dg,ZodDefault:()=>pz,ZodDiscriminatedUnion:()=>tz,ZodE164:()=>qk,ZodEmail:()=>Tk,ZodEmoji:()=>Ok,ZodEnum:()=>wd,ZodError:()=>XBe,ZodExactOptional:()=>uz,ZodFile:()=>cz,ZodFirstPartyTypeKind:()=>Pz,ZodFunction:()=>Oz,ZodGUID:()=>sg,ZodIPv4:()=>jk,ZodIPv6:()=>Mk,ZodISODate:()=>wk,ZodISODateTime:()=>Sk,ZodISODuration:()=>$k,ZodISOTime:()=>xk,ZodIntersection:()=>rz,ZodIssueCode:()=>eHe,ZodJWT:()=>Bk,ZodKSUID:()=>Nk,ZodLazy:()=>Ez,ZodLiteral:()=>az,ZodMAC:()=>GL,ZodMap:()=>oz,ZodNaN:()=>Sz,ZodNanoID:()=>Rk,ZodNever:()=>YL,ZodNonOptional:()=>Vk,ZodNull:()=>WL,ZodNullable:()=>fz,ZodNumber:()=>kd,ZodNumberFormat:()=>Dc,ZodObject:()=>fg,ZodOptional:()=>Od,ZodPipe:()=>hg,ZodPrefault:()=>hz,ZodPreprocess:()=>wz,ZodPromise:()=>Tz,ZodReadonly:()=>xz,ZodRealError:()=>Zr,ZodRecord:()=>Sd,ZodSet:()=>sz,ZodString:()=>xd,ZodStringFormat:()=>et,ZodSuccess:()=>_z,ZodSymbol:()=>ZL,ZodTemplateLiteral:()=>kz,ZodTransform:()=>lz,ZodTuple:()=>nz,ZodType:()=>_e,ZodULID:()=>Ck,ZodURL:()=>lg,ZodUUID:()=>to,ZodUndefined:()=>VL,ZodUnion:()=>pg,ZodUnknown:()=>JL,ZodVoid:()=>XL,ZodXID:()=>Dk,ZodXor:()=>ez,_ZodString:()=>Ak,_default:()=>mz,_function:()=>Woe,any:()=>Ooe,array:()=>ke,base64:()=>foe,base64url:()=>poe,bigint:()=>$oe,boolean:()=>It,catch:()=>vz,check:()=>Koe,cidrv4:()=>uoe,cidrv6:()=>doe,clone:()=>nr,codec:()=>Hoe,coerce:()=>Cz,config:()=>Tt,core:()=>mi,cuid:()=>roe,cuid2:()=>noe,custom:()=>Wk,date:()=>Ioe,decode:()=>ML,decodeAsync:()=>LL,describe:()=>Joe,discriminatedUnion:()=>mg,e164:()=>moe,email:()=>Zie,emoji:()=>eoe,encode:()=>jL,encodeAsync:()=>FL,endsWith:()=>dd,enum:()=>sr,exactOptional:()=>dz,file:()=>zoe,flattenError:()=>xh,float32:()=>voe,float64:()=>Soe,formatError:()=>$h,fromJSONSchema:()=>nse,function:()=>Woe,getErrorMap:()=>rHe,globalRegistry:()=>ir,gt:()=>Qi,gte:()=>Er,guid:()=>Vie,hash:()=>boe,hex:()=>_oe,hostname:()=>yoe,httpUrl:()=>Qie,includes:()=>ld,instanceof:()=>Xoe,int:()=>kk,int32:()=>woe,int64:()=>koe,intersection:()=>Td,invertCodec:()=>Goe,ipv4:()=>aoe,ipv6:()=>loe,iso:()=>Ks,json:()=>ese,jwt:()=>hoe,keyof:()=>Poe,ksuid:()=>soe,lazy:()=>Az,length:()=>Rc,literal:()=>ne,locales:()=>nd,looseObject:()=>or,looseRecord:()=>joe,lowercase:()=>ad,lt:()=>Xi,lte:()=>Sn,mac:()=>coe,map:()=>Moe,maxLength:()=>Oc,maxSize:()=>Bs,meta:()=>Yoe,mime:()=>fd,minLength:()=>Uo,minSize:()=>eo,multipleOf:()=>qs,nan:()=>Boe,nanoid:()=>toe,nativeEnum:()=>Loe,negative:()=>tk,never:()=>Gk,nonnegative:()=>nk,nonoptional:()=>yz,nonpositive:()=>rk,normalize:()=>pd,null:()=>ug,nullable:()=>ag,nullish:()=>Uoe,number:()=>Me,object:()=>W,optional:()=>at,overwrite:()=>pi,parse:()=>PL,parseAsync:()=>CL,partialRecord:()=>Noe,pipe:()=>Ek,positive:()=>ek,prefault:()=>gz,preprocess:()=>_g,prettifyError:()=>gM,promise:()=>Voe,property:()=>ik,readonly:()=>$z,record:()=>Ke,refine:()=>Rz,regex:()=>sd,regexes:()=>Gr,registry:()=>P$,safeDecode:()=>UL,safeDecodeAsync:()=>BL,safeEncode:()=>zL,safeEncodeAsync:()=>qL,safeParse:()=>DL,safeParseAsync:()=>NL,set:()=>Foe,setErrorMap:()=>tHe,size:()=>Tc,slugify:()=>yd,startsWith:()=>ud,strictObject:()=>Coe,string:()=>I,stringFormat:()=>goe,stringbool:()=>Qoe,success:()=>qoe,superRefine:()=>Iz,symbol:()=>Aoe,templateLiteral:()=>Zoe,toJSONSchema:()=>Pc,toLowerCase:()=>hd,toUpperCase:()=>gd,transform:()=>Zk,treeifyError:()=>hM,trim:()=>md,tuple:()=>iz,uint32:()=>xoe,uint64:()=>Eoe,ulid:()=>ioe,undefined:()=>Toe,union:()=>rt,unknown:()=>tt,uppercase:()=>cd,url:()=>Xie,util:()=>M,uuid:()=>Wie,uuidv4:()=>Kie,uuidv6:()=>Jie,uuidv7:()=>Yie,void:()=>Roe,xid:()=>ooe,xor:()=>Doe});var Kk=y(()=>{mr();og();vk();IL();HL();tse();mr();$F();mr();bd();ise();R$();ng();ng();ose();Tt(A$())});var sse=y(()=>{Kk()});var ase=y(()=>{sse()});function $se(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function kse(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var Nz,cse,Js,Yk,Wt,lse,use,hEt,fHe,pHe,jz,wn,bg,dse,ar,zn,Un,cr,Xk,fse,Mz,pse,mse,Fz,vg,ae,Lz,hse,gse,gEt,Qk,mHe,eE,hHe,Sg,Rd,yse,gHe,yHe,_He,bHe,vHe,SHe,zz,wHe,xHe,Uz,tE,$He,kHe,rE,EHe,wg,xg,AHe,$g,Id,THe,kg,nE,iE,oE,yEt,sE,aE,cE,_se,bse,vse,qz,Sse,Eg,Pd,wse,OHe,lE,RHe,uE,IHe,Bz,PHe,dE,CHe,DHe,NHe,Hz,jHe,Gz,MHe,FHe,LHe,zHe,fE,UHe,qHe,pE,Zz,Vz,Wz,BHe,HHe,GHe,Kz,ZHe,VHe,WHe,KHe,JHe,xse,mE,YHe,hE,_Et,XHe,Cd,QHe,bEt,Ag,eGe,Jz,tGe,rGe,nGe,iGe,oGe,sGe,aGe,Jk,cGe,lGe,uGe,Tg,Yz,dGe,fGe,pGe,mGe,hGe,gGe,yGe,_Ge,bGe,vGe,SGe,wGe,xGe,$Ge,kGe,EGe,AGe,TGe,Dd,OGe,RGe,IGe,gE,PGe,CGe,DGe,Xz,NGe,vEt,SEt,wEt,xEt,$Et,kEt,ie,Dz,Nc=y(()=>{ase();Nz="2025-11-25",cse=[Nz,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Js="io.modelcontextprotocol/related-task",Yk="2.0",Wt=Wk(t=>t!==null&&(typeof t=="object"||typeof t=="function")),lse=rt([I(),Me().int()]),use=I(),hEt=or({ttl:Me().optional(),pollInterval:Me().optional()}),fHe=W({ttl:Me().optional()}),pHe=W({taskId:I()}),jz=or({progressToken:lse.optional(),[Js]:pHe.optional()}),wn=W({_meta:jz.optional()}),bg=wn.extend({task:fHe.optional()}),dse=t=>bg.safeParse(t).success,ar=W({method:I(),params:wn.loose().optional()}),zn=W({_meta:jz.optional()}),Un=W({method:I(),params:zn.loose().optional()}),cr=or({_meta:jz.optional()}),Xk=rt([I(),Me().int()]),fse=W({jsonrpc:ne(Yk),id:Xk,...ar.shape}).strict(),Mz=t=>fse.safeParse(t).success,pse=W({jsonrpc:ne(Yk),...Un.shape}).strict(),mse=t=>pse.safeParse(t).success,Fz=W({jsonrpc:ne(Yk),id:Xk,result:cr}).strict(),vg=t=>Fz.safeParse(t).success;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ae||(ae={}));Lz=W({jsonrpc:ne(Yk),id:Xk.optional(),error:W({code:Me().int(),message:I(),data:tt().optional()})}).strict(),hse=t=>Lz.safeParse(t).success,gse=rt([fse,pse,Fz,Lz]),gEt=rt([Fz,Lz]),Qk=cr.strict(),mHe=zn.extend({requestId:Xk.optional(),reason:I().optional()}),eE=Un.extend({method:ne("notifications/cancelled"),params:mHe}),hHe=W({src:I(),mimeType:I().optional(),sizes:ke(I()).optional(),theme:sr(["light","dark"]).optional()}),Sg=W({icons:ke(hHe).optional()}),Rd=W({name:I(),title:I().optional()}),yse=Rd.extend({...Rd.shape,...Sg.shape,version:I(),websiteUrl:I().optional(),description:I().optional()}),gHe=Td(W({applyDefaults:It().optional()}),Ke(I(),tt())),yHe=_g(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Td(W({form:gHe.optional(),url:Wt.optional()}),Ke(I(),tt()).optional())),_He=or({list:Wt.optional(),cancel:Wt.optional(),requests:or({sampling:or({createMessage:Wt.optional()}).optional(),elicitation:or({create:Wt.optional()}).optional()}).optional()}),bHe=or({list:Wt.optional(),cancel:Wt.optional(),requests:or({tools:or({call:Wt.optional()}).optional()}).optional()}),vHe=W({experimental:Ke(I(),Wt).optional(),sampling:W({context:Wt.optional(),tools:Wt.optional()}).optional(),elicitation:yHe.optional(),roots:W({listChanged:It().optional()}).optional(),tasks:_He.optional(),extensions:Ke(I(),Wt).optional()}),SHe=wn.extend({protocolVersion:I(),capabilities:vHe,clientInfo:yse}),zz=ar.extend({method:ne("initialize"),params:SHe}),wHe=W({experimental:Ke(I(),Wt).optional(),logging:Wt.optional(),completions:Wt.optional(),prompts:W({listChanged:It().optional()}).optional(),resources:W({subscribe:It().optional(),listChanged:It().optional()}).optional(),tools:W({listChanged:It().optional()}).optional(),tasks:bHe.optional(),extensions:Ke(I(),Wt).optional()}),xHe=cr.extend({protocolVersion:I(),capabilities:wHe,serverInfo:yse,instructions:I().optional()}),Uz=Un.extend({method:ne("notifications/initialized"),params:zn.optional()}),tE=ar.extend({method:ne("ping"),params:wn.optional()}),$He=W({progress:Me(),total:at(Me()),message:at(I())}),kHe=W({...zn.shape,...$He.shape,progressToken:lse}),rE=Un.extend({method:ne("notifications/progress"),params:kHe}),EHe=wn.extend({cursor:use.optional()}),wg=ar.extend({params:EHe.optional()}),xg=cr.extend({nextCursor:use.optional()}),AHe=sr(["working","input_required","completed","failed","cancelled"]),$g=W({taskId:I(),status:AHe,ttl:rt([Me(),ug()]),createdAt:I(),lastUpdatedAt:I(),pollInterval:at(Me()),statusMessage:at(I())}),Id=cr.extend({task:$g}),THe=zn.merge($g),kg=Un.extend({method:ne("notifications/tasks/status"),params:THe}),nE=ar.extend({method:ne("tasks/get"),params:wn.extend({taskId:I()})}),iE=cr.merge($g),oE=ar.extend({method:ne("tasks/result"),params:wn.extend({taskId:I()})}),yEt=cr.loose(),sE=wg.extend({method:ne("tasks/list")}),aE=xg.extend({tasks:ke($g)}),cE=ar.extend({method:ne("tasks/cancel"),params:wn.extend({taskId:I()})}),_se=cr.merge($g),bse=W({uri:I(),mimeType:at(I()),_meta:Ke(I(),tt()).optional()}),vse=bse.extend({text:I()}),qz=I().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Sse=bse.extend({blob:qz}),Eg=sr(["user","assistant"]),Pd=W({audience:ke(Eg).optional(),priority:Me().min(0).max(1).optional(),lastModified:Ks.datetime({offset:!0}).optional()}),wse=W({...Rd.shape,...Sg.shape,uri:I(),description:at(I()),mimeType:at(I()),size:at(Me()),annotations:Pd.optional(),_meta:at(or({}))}),OHe=W({...Rd.shape,...Sg.shape,uriTemplate:I(),description:at(I()),mimeType:at(I()),annotations:Pd.optional(),_meta:at(or({}))}),lE=wg.extend({method:ne("resources/list")}),RHe=xg.extend({resources:ke(wse)}),uE=wg.extend({method:ne("resources/templates/list")}),IHe=xg.extend({resourceTemplates:ke(OHe)}),Bz=wn.extend({uri:I()}),PHe=Bz,dE=ar.extend({method:ne("resources/read"),params:PHe}),CHe=cr.extend({contents:ke(rt([vse,Sse]))}),DHe=Un.extend({method:ne("notifications/resources/list_changed"),params:zn.optional()}),NHe=Bz,Hz=ar.extend({method:ne("resources/subscribe"),params:NHe}),jHe=Bz,Gz=ar.extend({method:ne("resources/unsubscribe"),params:jHe}),MHe=zn.extend({uri:I()}),FHe=Un.extend({method:ne("notifications/resources/updated"),params:MHe}),LHe=W({name:I(),description:at(I()),required:at(It())}),zHe=W({...Rd.shape,...Sg.shape,description:at(I()),arguments:at(ke(LHe)),_meta:at(or({}))}),fE=wg.extend({method:ne("prompts/list")}),UHe=xg.extend({prompts:ke(zHe)}),qHe=wn.extend({name:I(),arguments:Ke(I(),I()).optional()}),pE=ar.extend({method:ne("prompts/get"),params:qHe}),Zz=W({type:ne("text"),text:I(),annotations:Pd.optional(),_meta:Ke(I(),tt()).optional()}),Vz=W({type:ne("image"),data:qz,mimeType:I(),annotations:Pd.optional(),_meta:Ke(I(),tt()).optional()}),Wz=W({type:ne("audio"),data:qz,mimeType:I(),annotations:Pd.optional(),_meta:Ke(I(),tt()).optional()}),BHe=W({type:ne("tool_use"),name:I(),id:I(),input:Ke(I(),tt()),_meta:Ke(I(),tt()).optional()}),HHe=W({type:ne("resource"),resource:rt([vse,Sse]),annotations:Pd.optional(),_meta:Ke(I(),tt()).optional()}),GHe=wse.extend({type:ne("resource_link")}),Kz=rt([Zz,Vz,Wz,GHe,HHe]),ZHe=W({role:Eg,content:Kz}),VHe=cr.extend({description:I().optional(),messages:ke(ZHe)}),WHe=Un.extend({method:ne("notifications/prompts/list_changed"),params:zn.optional()}),KHe=W({title:I().optional(),readOnlyHint:It().optional(),destructiveHint:It().optional(),idempotentHint:It().optional(),openWorldHint:It().optional()}),JHe=W({taskSupport:sr(["required","optional","forbidden"]).optional()}),xse=W({...Rd.shape,...Sg.shape,description:I().optional(),inputSchema:W({type:ne("object"),properties:Ke(I(),Wt).optional(),required:ke(I()).optional()}).catchall(tt()),outputSchema:W({type:ne("object"),properties:Ke(I(),Wt).optional(),required:ke(I()).optional()}).catchall(tt()).optional(),annotations:KHe.optional(),execution:JHe.optional(),_meta:Ke(I(),tt()).optional()}),mE=wg.extend({method:ne("tools/list")}),YHe=xg.extend({tools:ke(xse)}),hE=cr.extend({content:ke(Kz).default([]),structuredContent:Ke(I(),tt()).optional(),isError:It().optional()}),_Et=hE.or(cr.extend({toolResult:tt()})),XHe=bg.extend({name:I(),arguments:Ke(I(),tt()).optional()}),Cd=ar.extend({method:ne("tools/call"),params:XHe}),QHe=Un.extend({method:ne("notifications/tools/list_changed"),params:zn.optional()}),bEt=W({autoRefresh:It().default(!0),debounceMs:Me().int().nonnegative().default(300)}),Ag=sr(["debug","info","notice","warning","error","critical","alert","emergency"]),eGe=wn.extend({level:Ag}),Jz=ar.extend({method:ne("logging/setLevel"),params:eGe}),tGe=zn.extend({level:Ag,logger:I().optional(),data:tt()}),rGe=Un.extend({method:ne("notifications/message"),params:tGe}),nGe=W({name:I().optional()}),iGe=W({hints:ke(nGe).optional(),costPriority:Me().min(0).max(1).optional(),speedPriority:Me().min(0).max(1).optional(),intelligencePriority:Me().min(0).max(1).optional()}),oGe=W({mode:sr(["auto","required","none"]).optional()}),sGe=W({type:ne("tool_result"),toolUseId:I().describe("The unique identifier for the corresponding tool call."),content:ke(Kz).default([]),structuredContent:W({}).loose().optional(),isError:It().optional(),_meta:Ke(I(),tt()).optional()}),aGe=mg("type",[Zz,Vz,Wz]),Jk=mg("type",[Zz,Vz,Wz,BHe,sGe]),cGe=W({role:Eg,content:rt([Jk,ke(Jk)]),_meta:Ke(I(),tt()).optional()}),lGe=bg.extend({messages:ke(cGe),modelPreferences:iGe.optional(),systemPrompt:I().optional(),includeContext:sr(["none","thisServer","allServers"]).optional(),temperature:Me().optional(),maxTokens:Me().int(),stopSequences:ke(I()).optional(),metadata:Wt.optional(),tools:ke(xse).optional(),toolChoice:oGe.optional()}),uGe=ar.extend({method:ne("sampling/createMessage"),params:lGe}),Tg=cr.extend({model:I(),stopReason:at(sr(["endTurn","stopSequence","maxTokens"]).or(I())),role:Eg,content:aGe}),Yz=cr.extend({model:I(),stopReason:at(sr(["endTurn","stopSequence","maxTokens","toolUse"]).or(I())),role:Eg,content:rt([Jk,ke(Jk)])}),dGe=W({type:ne("boolean"),title:I().optional(),description:I().optional(),default:It().optional()}),fGe=W({type:ne("string"),title:I().optional(),description:I().optional(),minLength:Me().optional(),maxLength:Me().optional(),format:sr(["email","uri","date","date-time"]).optional(),default:I().optional()}),pGe=W({type:sr(["number","integer"]),title:I().optional(),description:I().optional(),minimum:Me().optional(),maximum:Me().optional(),default:Me().optional()}),mGe=W({type:ne("string"),title:I().optional(),description:I().optional(),enum:ke(I()),default:I().optional()}),hGe=W({type:ne("string"),title:I().optional(),description:I().optional(),oneOf:ke(W({const:I(),title:I()})),default:I().optional()}),gGe=W({type:ne("string"),title:I().optional(),description:I().optional(),enum:ke(I()),enumNames:ke(I()).optional(),default:I().optional()}),yGe=rt([mGe,hGe]),_Ge=W({type:ne("array"),title:I().optional(),description:I().optional(),minItems:Me().optional(),maxItems:Me().optional(),items:W({type:ne("string"),enum:ke(I())}),default:ke(I()).optional()}),bGe=W({type:ne("array"),title:I().optional(),description:I().optional(),minItems:Me().optional(),maxItems:Me().optional(),items:W({anyOf:ke(W({const:I(),title:I()}))}),default:ke(I()).optional()}),vGe=rt([_Ge,bGe]),SGe=rt([gGe,yGe,vGe]),wGe=rt([SGe,dGe,fGe,pGe]),xGe=bg.extend({mode:ne("form").optional(),message:I(),requestedSchema:W({type:ne("object"),properties:Ke(I(),wGe),required:ke(I()).optional()})}),$Ge=bg.extend({mode:ne("url"),message:I(),elicitationId:I(),url:I().url()}),kGe=rt([xGe,$Ge]),EGe=ar.extend({method:ne("elicitation/create"),params:kGe}),AGe=zn.extend({elicitationId:I()}),TGe=Un.extend({method:ne("notifications/elicitation/complete"),params:AGe}),Dd=cr.extend({action:sr(["accept","decline","cancel"]),content:_g(t=>t===null?void 0:t,Ke(I(),rt([I(),Me(),It(),ke(I())])).optional())}),OGe=W({type:ne("ref/resource"),uri:I()}),RGe=W({type:ne("ref/prompt"),name:I()}),IGe=wn.extend({ref:rt([RGe,OGe]),argument:W({name:I(),value:I()}),context:W({arguments:Ke(I(),I()).optional()}).optional()}),gE=ar.extend({method:ne("completion/complete"),params:IGe});PGe=cr.extend({completion:or({values:ke(I()).max(100),total:at(Me().int()),hasMore:at(It())})}),CGe=W({uri:I().startsWith("file://"),name:I().optional(),_meta:Ke(I(),tt()).optional()}),DGe=ar.extend({method:ne("roots/list"),params:wn.optional()}),Xz=cr.extend({roots:ke(CGe)}),NGe=Un.extend({method:ne("notifications/roots/list_changed"),params:zn.optional()}),vEt=rt([tE,zz,gE,Jz,pE,fE,lE,uE,dE,Hz,Gz,Cd,mE,nE,oE,sE,cE]),SEt=rt([eE,rE,Uz,NGe,kg]),wEt=rt([Qk,Tg,Yz,Dd,Xz,iE,aE,Id]),xEt=rt([tE,uGe,EGe,DGe,nE,oE,sE,cE]),$Et=rt([eE,rE,rGe,FHe,DHe,QHe,WHe,kg,TGe]),kEt=rt([Qk,xHe,PGe,VHe,UHe,RHe,IHe,CHe,hE,YHe,iE,aE,Id]),ie=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===ae.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new Dz(i.elicitations,r)}return new t(e,r,n)}},Dz=class extends ie{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(ae.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}});function Ys(t){return t==="completed"||t==="failed"||t==="cancelled"}var Ese=y(()=>{});var Tse,Ase,Ose,yE=y(()=>{Tse=Symbol("Let zodToJsonSchema decide on which parser to use"),Ase={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Ose=t=>typeof t=="string"?{...Ase,name:t}:{...Ase,...t}});var Rse,Qz=y(()=>{yE();Rse=t=>{let e=Ose(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,i])=>[i._def,{def:i._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}}});function e2(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function Ie(t,e,r,n,i){t[e]=r,e2(t,e,n,i)}var Xs=y(()=>{});var _E,bE=y(()=>{_E=(t,e)=>{let r=0;for(;r{bE()});function Ise(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==z.ZodAny&&(r.items=le(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&Ie(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Ie(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Ie(r,"minItems",t.exactLength.value,t.exactLength.message,e),Ie(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}var t2=y(()=>{hh();Xs();Mt()});function Pse(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?Ie(r,"minimum",n.value,n.message,e):Ie(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Ie(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Ie(r,"maximum",n.value,n.message,e):Ie(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Ie(r,"maximum",n.value,n.message,e));break;case"multipleOf":Ie(r,"multipleOf",n.value,n.message,e);break}return r}var r2=y(()=>{Xs()});function Cse(){return{type:"boolean"}}var n2=y(()=>{});function vE(t,e){return le(t.type._def,e)}var SE=y(()=>{Mt()});var Dse,i2=y(()=>{Mt();Dse=(t,e)=>le(t.innerType._def,e)});function o2(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((i,o)=>o2(t,e,i))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return jGe(t,e)}}var jGe,s2=y(()=>{Xs();jGe=(t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":Ie(r,"minimum",n.value,n.message,e);break;case"max":Ie(r,"maximum",n.value,n.message,e);break}return r}});function Nse(t,e){return{...le(t.innerType._def,e),default:t.defaultValue()}}var a2=y(()=>{Mt()});function jse(t,e){return e.effectStrategy==="input"?le(t.schema._def,e):yt(e)}var c2=y(()=>{Mt();qn()});function Mse(t){return{type:"string",enum:Array.from(t.values)}}var l2=y(()=>{});function Fse(t,e){let r=[le(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),le(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(o=>!!o),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,i=[];return r.forEach(o=>{if(MGe(o))i.push(...o.allOf),o.unevaluatedProperties===void 0&&(n=void 0);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:a,...c}=o;s=c}else n=void 0;i.push(s)}}),i.length?{allOf:i,...n}:void 0}var MGe,u2=y(()=>{Mt();MGe=t=>"type"in t&&t.type==="string"?!1:"allOf"in t});function Lse(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}var d2=y(()=>{});function wE(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":Ie(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":Ie(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":gi(r,"email",n.message,e);break;case"format:idn-email":gi(r,"idn-email",n.message,e);break;case"pattern:zod":Tr(r,hi.email,n.message,e);break}break;case"url":gi(r,"uri",n.message,e);break;case"uuid":gi(r,"uuid",n.message,e);break;case"regex":Tr(r,n.regex,n.message,e);break;case"cuid":Tr(r,hi.cuid,n.message,e);break;case"cuid2":Tr(r,hi.cuid2,n.message,e);break;case"startsWith":Tr(r,RegExp(`^${p2(n.value,e)}`),n.message,e);break;case"endsWith":Tr(r,RegExp(`${p2(n.value,e)}$`),n.message,e);break;case"datetime":gi(r,"date-time",n.message,e);break;case"date":gi(r,"date",n.message,e);break;case"time":gi(r,"time",n.message,e);break;case"duration":gi(r,"duration",n.message,e);break;case"length":Ie(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),Ie(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Tr(r,RegExp(p2(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&gi(r,"ipv4",n.message,e),n.version!=="v4"&&gi(r,"ipv6",n.message,e);break}case"base64url":Tr(r,hi.base64url,n.message,e);break;case"jwt":Tr(r,hi.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Tr(r,hi.ipv4Cidr,n.message,e),n.version!=="v4"&&Tr(r,hi.ipv6Cidr,n.message,e);break}case"emoji":Tr(r,hi.emoji(),n.message,e);break;case"ulid":{Tr(r,hi.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{gi(r,"binary",n.message,e);break}case"contentEncoding:base64":{Ie(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Tr(r,hi.base64,n.message,e);break}}break}case"nanoid":Tr(r,hi.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function p2(t,e){return e.patternStrategy==="escape"?LGe(t):t}function LGe(t){let e="";for(let r=0;ri.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):Ie(t,"format",e,r,n)}function Tr(t,e,r,n){t.pattern||t.allOf?.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:zse(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):Ie(t,"pattern",zse(e,n),r,n)}function zse(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,i="",o=!1,s=!1,a=!1;for(let c=0;c{Xs();hi={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(f2===void 0&&(f2=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),f2),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};FGe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function $E(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===z.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((n,i)=>({...n,[i]:le(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",i]})??yt(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:le(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===z.ZodString&&t.keyType._def.checks?.length){let{type:n,...i}=wE(t.keyType._def,e);return{...r,propertyNames:i}}else{if(t.keyType?._def.typeName===z.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===z.ZodBranded&&t.keyType._def.type._def.typeName===z.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...i}=vE(t.keyType._def,e);return{...r,propertyNames:i}}}return r}var kE=y(()=>{hh();Mt();xE();SE();qn()});function Use(t,e){if(e.mapStrategy==="record")return $E(t,e);let r=le(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||yt(e),n=le(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||yt(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}var m2=y(()=>{Mt();kE();qn()});function qse(t){let e=t.values,n=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),i=Array.from(new Set(n.map(o=>typeof o)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:n}}var h2=y(()=>{});function Bse(t){return t.target==="openAi"?void 0:{not:yt({...t,currentPath:[...t.currentPath,"not"]})}}var g2=y(()=>{qn()});function Hse(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var y2=y(()=>{});function Zse(t,e){if(e.target==="openApi3")return Gse(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Og&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((i,o)=>{let s=Og[o._def.typeName];return s&&!i.includes(s)?[...i,s]:i},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((i,o)=>{let s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(o._def.value===null)return[...i,"null"];default:return i}},[]);if(n.length===r.length){let i=n.filter((o,s,a)=>a.indexOf(o)===s);return{type:i.length>1?i:i[0],enum:r.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,i)=>[...n,...i._def.values.filter(o=>!n.includes(o))],[])};return Gse(t,e)}var Og,Gse,EE=y(()=>{Mt();Og={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};Gse=(t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,i)=>le(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${i}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0}});function Vse(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Og[t.innerType._def.typeName],nullable:!0}:{type:[Og[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=le(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=le(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}var _2=y(()=>{Mt();EE()});function Wse(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",e2(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?Ie(r,"minimum",n.value,n.message,e):Ie(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Ie(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Ie(r,"maximum",n.value,n.message,e):Ie(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Ie(r,"maximum",n.value,n.message,e));break;case"multipleOf":Ie(r,"multipleOf",n.value,n.message,e);break}return r}var b2=y(()=>{Xs()});function Kse(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},i=[],o=t.shape();for(let a in o){let c=o[a];if(c===void 0||c._def===void 0)continue;let l=UGe(c);l&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=!1);let u=le(c._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});u!==void 0&&(n.properties[a]=u,l||i.push(a))}i.length&&(n.required=i);let s=zGe(t,e);return s!==void 0&&(n.additionalProperties=s),n}function zGe(t,e){if(t.catchall._def.typeName!=="ZodNever")return le(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function UGe(t){try{return t.isOptional()}catch{return!0}}var v2=y(()=>{Mt()});var Jse,S2=y(()=>{Mt();qn();Jse=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return le(t.innerType._def,e);let r=le(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:yt(e)},r]}:yt(e)}});var Yse,w2=y(()=>{Mt();Yse=(t,e)=>{if(e.pipeStrategy==="input")return le(t.in._def,e);if(e.pipeStrategy==="output")return le(t.out._def,e);let r=le(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=le(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(i=>i!==void 0)}}});function Xse(t,e){return le(t.type._def,e)}var x2=y(()=>{Mt()});function Qse(t,e){let n={type:"array",uniqueItems:!0,items:le(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&Ie(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Ie(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}var $2=y(()=>{Xs();Mt()});function eae(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>le(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:le(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>le(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}var k2=y(()=>{Mt()});function tae(t){return{not:yt(t)}}var E2=y(()=>{qn()});function rae(t){return yt(t)}var A2=y(()=>{qn()});var nae,T2=y(()=>{Mt();nae=(t,e)=>le(t.innerType._def,e)});var iae,O2=y(()=>{hh();qn();t2();r2();n2();SE();i2();s2();a2();c2();l2();u2();d2();m2();h2();g2();y2();_2();b2();v2();S2();w2();x2();kE();$2();xE();k2();E2();EE();A2();T2();iae=(t,e,r)=>{switch(e){case z.ZodString:return wE(t,r);case z.ZodNumber:return Wse(t,r);case z.ZodObject:return Kse(t,r);case z.ZodBigInt:return Pse(t,r);case z.ZodBoolean:return Cse();case z.ZodDate:return o2(t,r);case z.ZodUndefined:return tae(r);case z.ZodNull:return Hse(r);case z.ZodArray:return Ise(t,r);case z.ZodUnion:case z.ZodDiscriminatedUnion:return Zse(t,r);case z.ZodIntersection:return Fse(t,r);case z.ZodTuple:return eae(t,r);case z.ZodRecord:return $E(t,r);case z.ZodLiteral:return Lse(t,r);case z.ZodEnum:return Mse(t);case z.ZodNativeEnum:return qse(t);case z.ZodNullable:return Vse(t,r);case z.ZodOptional:return Jse(t,r);case z.ZodMap:return Use(t,r);case z.ZodSet:return Qse(t,r);case z.ZodLazy:return()=>t.getter()._def;case z.ZodPromise:return Xse(t,r);case z.ZodNaN:case z.ZodNever:return Bse(r);case z.ZodEffects:return jse(t,r);case z.ZodAny:return yt(r);case z.ZodUnknown:return rae(r);case z.ZodDefault:return Nse(t,r);case z.ZodBranded:return vE(t,r);case z.ZodReadonly:return nae(t,r);case z.ZodCatch:return Dse(t,r);case z.ZodPipeline:return Yse(t,r);case z.ZodFunction:case z.ZodVoid:case z.ZodSymbol:return;default:return(n=>{})(e)}}});function le(t,e,r=!1){let n=e.seen.get(t);if(e.override){let a=e.override?.(t,e,n,r);if(a!==Tse)return a}if(n&&!r){let a=qGe(n,e);if(a!==void 0)return a}let i={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,i);let o=iae(t,t.typeName,e),s=typeof o=="function"?le(o(),e):o;if(s&&BGe(t,e,s),e.postProcess){let a=e.postProcess(s,t,e);return i.jsonSchema=s,a}return i.jsonSchema=s,s}var qGe,BGe,Mt=y(()=>{yE();O2();bE();qn();qGe=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:_E(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),yt(e)):e.$refStrategy==="seen"?yt(e):void 0}},BGe=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r)});var oae=y(()=>{});var R2,I2=y(()=>{Mt();Qz();qn();R2=(t,e)=>{let r=Rse(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[l,u])=>({...c,[l]:le(u._def,{...r,currentPath:[...r.basePath,r.definitionPath,l]},!0)??yt(r)}),{}):void 0,i=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=le(t._def,i===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1)??yt(r),s=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;s!==void 0&&(o.title=s),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let a=i===void 0?n?{...o,[r.definitionPath]:n}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...n,[i]:o}};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a}});var sae=y(()=>{yE();Qz();Xs();bE();Mt();oae();qn();t2();r2();n2();SE();i2();s2();a2();c2();l2();u2();d2();m2();h2();g2();y2();_2();b2();v2();S2();w2();x2();T2();kE();$2();xE();k2();E2();EE();A2();O2();I2();I2()});function HGe(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function P2(t,e){return Ln(t)?Pc(t,{target:HGe(e?.target),io:e?.pipeStrategy??"input"}):R2(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function C2(t){let r=Ws(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=_k(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function D2(t,e){let r=Vs(t,e);if(!r.success)throw r.error;return r.data}var N2=y(()=>{EL();rg();sae()});function aae(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function cae(t,e){let r={...t};for(let n in e){let i=n,o=e[i];if(o===void 0)continue;let s=r[i];aae(s)&&aae(o)?r[i]={...s,...o}:r[i]=o}return r}var GGe,AE,lae=y(()=>{rg();Nc();Ese();N2();GGe=6e4,AE=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(eE,r=>{this._oncancel(r)}),this.setNotificationHandler(rE,r=>{this._onprogress(r)}),this.setRequestHandler(tE,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(nE,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ne(ae.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(oE,async(r,n)=>{let i=async()=>{let o=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(o,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,l=c.id,u=this._requestResolvers.get(l);if(u)if(this._requestResolvers.delete(l),a.type==="response")u(c);else{let d=c,f=new ne(d.error.code,d.error.message,d.error.data);u(f)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(o,n.sessionId);if(!s)throw new ne(ae.InvalidParams,`Task not found: ${o}`);if(!Ys(s.status))return await this._waitForTaskUpdate(o,n.signal),await i();if(Ys(s.status)){let a=await this._taskStore.getTaskResult(o,n.sessionId);return this._clearTaskQueue(o),{...a,_meta:{...a._meta,[Js]:{taskId:o}}}}return await i()};return await i()}),this.setRequestHandler(sE,async(r,n)=>{try{let{tasks:i,nextCursor:o}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:o,_meta:{}}}catch(i){throw new ne(ae.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(cE,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ne(ae.InvalidParams,`Task not found: ${r.params.taskId}`);if(Ys(i.status))throw new ne(ae.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new ne(ae.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...o}}catch(i){throw i instanceof ne?i:new ne(ae.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,i,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:o,onTimeout:i})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),ne.fromError(ae.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=o=>{n?.(o),this._onerror(o)};let i=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{i?.(o,s),vg(o)||hse(o)?this._onresponse(o):Mz(o)?this._onrequest(o,s):mse(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=ne.fromError(ae.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,o=e.params?._meta?.[Js]?.taskId;if(n===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:ae.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:u,timestamp:Date.now()},i?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):i?.send(u).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let a=dse(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,l={signal:s.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{if(s.signal.aborted)return;let d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(u,d)},sendRequest:async(u,d,f)=>{if(s.signal.aborted)throw new ne(ae.ConnectionClosed,"Request was cancelled");let p={...f,relatedRequestId:e.id};o&&!p.relatedTask&&(p.relatedTask={taskId:o});let m=p.relatedTask?.taskId??o;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(u,d,p)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,l)).then(async u=>{if(s.signal.aborted)return;let d={result:u,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)},async u=>{if(s.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:ae.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===s&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,i=Number(r),o=this._progressHandlers.get(i);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(i),a=this._timeoutInfo.get(i);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),s(c);return}o(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),vg(e))n(e);else{let s=new ne(e.error.code,e.error.message,e.error.data);n(s)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let o=!1;if(vg(e)&&e.result&&typeof e.result=="object"){let s=e.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(o=!0,this._taskProgressTokens.set(a.taskId,r))}}if(o||this._progressHandlers.delete(r),vg(e))i(e);else{let s=ne.fromError(e.error.code,e.error.message,e.error.data);i(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(e,r,n)}}catch(s){yield{type:"error",error:s instanceof ne?s:new ne(ae.InternalError,String(s))}}return}let o;try{let s=await this.request(e,Id,n);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new ne(ae.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:o},n);if(yield{type:"taskStatus",task:a},Ys(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)}:a.status==="failed"?yield{type:"error",error:new ne(ae.InternalError,`Task ${o} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new ne(ae.InternalError,`Task ${o} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,c)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof ne?s:new ne(ae.InternalError,String(s))}}}request(e,r,n){let{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s,task:a,relatedTask:c}=n??{};return new Promise((l,u)=>{let d=_=>{u(_)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(_){d(_);return}n?.signal?.throwIfAborted();let f=this._requestMessageId++,p={...e,jsonrpc:"2.0",id:f};n?.onprogress&&(this._progressHandlers.set(f,n.onprogress),p.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),a&&(p.params={...p.params,task:a}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[Js]:c}});let m=_=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(_)}},{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(x=>this._onerror(new Error(`Failed to send cancellation: ${x}`)));let S=_ instanceof ne?_:new ne(ae.RequestTimeout,String(_));u(S)};this._responseHandlers.set(f,_=>{if(!n?.signal?.aborted){if(_ instanceof Error)return u(_);try{let S=Vs(r,_.result);S.success?l(S.data):u(S.error)}catch(S){u(S)}}}),n?.signal?.addEventListener("abort",()=>{m(n?.signal?.reason)});let h=n?.timeout??GGe,g=()=>m(ne.fromError(ae.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(f,h,n?.maxTotalTimeout,g,n?.resetTimeoutOnProgress??!1);let b=c?.taskId;if(b){let _=S=>{let x=this._responseHandlers.get(f);x?x(S):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,_),this._enqueueTaskMessage(b,{type:"request",message:p,timestamp:Date.now()}).catch(S=>{this._cleanupTimeout(f),u(S)})}else this._transport.send(p,{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(_=>{this._cleanupTimeout(f),u(_)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},iE,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},aE,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},_se,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Js]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Js]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Js]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(e,r){let n=C2(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,o)=>{let s=D2(e,i);return Promise.resolve(r(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=C2(e);this._notificationHandlers.set(n,i=>{let o=D2(e,i);return Promise.resolve(r(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,i)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let i of n)if(i.type==="request"&&Mz(i.message)){let o=i.message.id,s=this._requestResolvers.get(o);s?(s(new ne(ae.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(e);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,o)=>{if(r.aborted){o(new ne(ae.InvalidRequest,"Request cancelled"));return}let s=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(s),o(new ne(ae.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!e)throw new Error("No request provided");return await n.createTask(i,e.id,{method:e.method,params:e.params},r)},getTask:async i=>{let o=await n.getTask(i,r);if(!o)throw new ne(ae.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(i,o,s)=>{await n.storeTaskResult(i,o,s,r);let a=await n.getTask(i,r);if(a){let c=kg.parse({method:"notifications/tasks/status",params:a});await this.notification(c),Ys(a.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,o,s)=>{let a=await n.getTask(i,r);if(!a)throw new ne(ae.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(Ys(a.status))throw new ne(ae.InvalidParams,`Cannot update task "${i}" from terminal status "${a.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,o,s,r);let c=await n.getTask(i,r);if(c){let l=kg.parse({method:"notifications/tasks/status",params:c});await this.notification(l),Ys(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}}});var Pg=v(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.regexpCode=Fe.getEsmExportName=Fe.getProperty=Fe.safeStringify=Fe.stringify=Fe.strConcat=Fe.addCodeArg=Fe.str=Fe._=Fe.nil=Fe._Code=Fe.Name=Fe.IDENTIFIER=Fe._CodeOrName=void 0;var Rg=class{};Fe._CodeOrName=Rg;Fe.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var jc=class extends Rg{constructor(e){if(super(),!Fe.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Fe.Name=jc;var Bn=class extends Rg{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof jc&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Fe._Code=Bn;Fe.nil=new Bn("");function uae(t,...e){let r=[t[0]],n=0;for(;n{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.ValueScope=Wr.ValueScopeName=Wr.Scope=Wr.varKinds=Wr.UsedValueState=void 0;var Vr=Pg(),F2=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},TE;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(TE||(Wr.UsedValueState=TE={}));Wr.varKinds={const:new Vr.Name("const"),let:new Vr.Name("let"),var:new Vr.Name("var")};var OE=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Vr.Name?e:this.name(e)}name(e){return new Vr.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Wr.Scope=OE;var RE=class extends Vr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Vr._)`.${new Vr.Name(r)}[${n}]`}};Wr.ValueScopeName=RE;var eZe=(0,Vr._)`\n`,L2=class extends OE{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?eZe:Vr.nil}}get(){return this._scope}name(e){return new RE(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:o}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let u=a.get(s);if(u)return u}else a=this._values[o]=new Map;a.set(s,i);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:o,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Vr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let o=Vr.nil;for(let s in e){let a=e[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,TE.Started);let u=r(l);if(u){let d=this.opts.es5?Wr.varKinds.var:Wr.varKinds.const;o=(0,Vr._)`${o}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))o=(0,Vr._)`${o}${u}${this.opts._n}`;else throw new F2(l);c.set(l,TE.Completed)})}return o}};Wr.ValueScope=L2});var we=v(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.or=Ee.and=Ee.not=Ee.CodeGen=Ee.operators=Ee.varKinds=Ee.ValueScopeName=Ee.ValueScope=Ee.Scope=Ee.Name=Ee.regexpCode=Ee.stringify=Ee.getProperty=Ee.nil=Ee.strConcat=Ee.str=Ee._=void 0;var Pe=Pg(),yi=z2(),Qs=Pg();Object.defineProperty(Ee,"_",{enumerable:!0,get:function(){return Qs._}});Object.defineProperty(Ee,"str",{enumerable:!0,get:function(){return Qs.str}});Object.defineProperty(Ee,"strConcat",{enumerable:!0,get:function(){return Qs.strConcat}});Object.defineProperty(Ee,"nil",{enumerable:!0,get:function(){return Qs.nil}});Object.defineProperty(Ee,"getProperty",{enumerable:!0,get:function(){return Qs.getProperty}});Object.defineProperty(Ee,"stringify",{enumerable:!0,get:function(){return Qs.stringify}});Object.defineProperty(Ee,"regexpCode",{enumerable:!0,get:function(){return Qs.regexpCode}});Object.defineProperty(Ee,"Name",{enumerable:!0,get:function(){return Qs.Name}});var DE=z2();Object.defineProperty(Ee,"Scope",{enumerable:!0,get:function(){return DE.Scope}});Object.defineProperty(Ee,"ValueScope",{enumerable:!0,get:function(){return DE.ValueScope}});Object.defineProperty(Ee,"ValueScopeName",{enumerable:!0,get:function(){return DE.ValueScopeName}});Object.defineProperty(Ee,"varKinds",{enumerable:!0,get:function(){return DE.varKinds}});Ee.operators={GT:new Pe._Code(">"),GTE:new Pe._Code(">="),LT:new Pe._Code("<"),LTE:new Pe._Code("<="),EQ:new Pe._Code("==="),NEQ:new Pe._Code("!=="),NOT:new Pe._Code("!"),OR:new Pe._Code("||"),AND:new Pe._Code("&&"),ADD:new Pe._Code("+")};var qo=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},U2=class extends qo{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?yi.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=jd(this.rhs,e,r)),this}get names(){return this.rhs instanceof Pe._CodeOrName?this.rhs.names:{}}},IE=class extends qo{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Pe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=jd(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Pe.Name?{}:{...this.lhs.names};return CE(e,this.rhs)}},q2=class extends IE{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},B2=class extends qo{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},H2=class extends qo{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},G2=class extends qo{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Z2=class extends qo{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=jd(this.code,e,r),this}get names(){return this.code instanceof Pe._CodeOrName?this.code.names:{}}},Cg=class extends qo{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(e,r)||(tZe(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Lc(e,r.names),{})}},Bo=class extends Cg{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},V2=class extends Cg{},Nd=class extends Bo{};Nd.kind="else";var Mc=class t extends Bo{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Nd(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(fae(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=jd(this.condition,e,r),this}get names(){let e=super.names;return CE(e,this.condition),this.else&&Lc(e,this.else.names),e}};Mc.kind="if";var Fc=class extends Bo{};Fc.kind="for";var W2=class extends Fc{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=jd(this.iteration,e,r),this}get names(){return Lc(super.names,this.iteration.names)}},K2=class extends Fc{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?yi.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=CE(super.names,this.from);return CE(e,this.to)}},PE=class extends Fc{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=jd(this.iterable,e,r),this}get names(){return Lc(super.names,this.iterable.names)}},Dg=class extends Bo{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Dg.kind="func";var Ng=class extends Cg{render(e){return"return "+super.render(e)}};Ng.kind="return";var J2=class extends Bo{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Lc(e,this.catch.names),this.finally&&Lc(e,this.finally.names),e}},jg=class extends Bo{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};jg.kind="catch";var Mg=class extends Bo{render(e){return"finally"+super.render(e)}};Mg.kind="finally";var Y2=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?` +]`;continue}i+=n[c],n[c]==="\\"?o=!0:s&&n[c]==="]"?s=!1:!s&&n[c]==="["&&(s=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return i}var f2,hi,FGe,xE=y(()=>{Xs();hi={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(f2===void 0&&(f2=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),f2),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};FGe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function $E(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===z.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((n,i)=>({...n,[i]:le(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",i]})??yt(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:le(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===z.ZodString&&t.keyType._def.checks?.length){let{type:n,...i}=wE(t.keyType._def,e);return{...r,propertyNames:i}}else{if(t.keyType?._def.typeName===z.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===z.ZodBranded&&t.keyType._def.type._def.typeName===z.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...i}=vE(t.keyType._def,e);return{...r,propertyNames:i}}}return r}var kE=y(()=>{hh();Mt();xE();SE();qn()});function Use(t,e){if(e.mapStrategy==="record")return $E(t,e);let r=le(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||yt(e),n=le(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||yt(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}var m2=y(()=>{Mt();kE();qn()});function qse(t){let e=t.values,n=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),i=Array.from(new Set(n.map(o=>typeof o)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:n}}var h2=y(()=>{});function Bse(t){return t.target==="openAi"?void 0:{not:yt({...t,currentPath:[...t.currentPath,"not"]})}}var g2=y(()=>{qn()});function Hse(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var y2=y(()=>{});function Zse(t,e){if(e.target==="openApi3")return Gse(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Og&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((i,o)=>{let s=Og[o._def.typeName];return s&&!i.includes(s)?[...i,s]:i},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((i,o)=>{let s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(o._def.value===null)return[...i,"null"];default:return i}},[]);if(n.length===r.length){let i=n.filter((o,s,a)=>a.indexOf(o)===s);return{type:i.length>1?i:i[0],enum:r.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,i)=>[...n,...i._def.values.filter(o=>!n.includes(o))],[])};return Gse(t,e)}var Og,Gse,EE=y(()=>{Mt();Og={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};Gse=(t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,i)=>le(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${i}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0}});function Vse(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Og[t.innerType._def.typeName],nullable:!0}:{type:[Og[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=le(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=le(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}var _2=y(()=>{Mt();EE()});function Wse(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",e2(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?Ie(r,"minimum",n.value,n.message,e):Ie(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Ie(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Ie(r,"maximum",n.value,n.message,e):Ie(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Ie(r,"maximum",n.value,n.message,e));break;case"multipleOf":Ie(r,"multipleOf",n.value,n.message,e);break}return r}var b2=y(()=>{Xs()});function Kse(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},i=[],o=t.shape();for(let a in o){let c=o[a];if(c===void 0||c._def===void 0)continue;let l=UGe(c);l&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=!1);let u=le(c._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});u!==void 0&&(n.properties[a]=u,l||i.push(a))}i.length&&(n.required=i);let s=zGe(t,e);return s!==void 0&&(n.additionalProperties=s),n}function zGe(t,e){if(t.catchall._def.typeName!=="ZodNever")return le(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function UGe(t){try{return t.isOptional()}catch{return!0}}var v2=y(()=>{Mt()});var Jse,S2=y(()=>{Mt();qn();Jse=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return le(t.innerType._def,e);let r=le(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:yt(e)},r]}:yt(e)}});var Yse,w2=y(()=>{Mt();Yse=(t,e)=>{if(e.pipeStrategy==="input")return le(t.in._def,e);if(e.pipeStrategy==="output")return le(t.out._def,e);let r=le(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=le(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(i=>i!==void 0)}}});function Xse(t,e){return le(t.type._def,e)}var x2=y(()=>{Mt()});function Qse(t,e){let n={type:"array",uniqueItems:!0,items:le(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&Ie(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Ie(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}var $2=y(()=>{Xs();Mt()});function eae(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>le(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:le(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>le(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}var k2=y(()=>{Mt()});function tae(t){return{not:yt(t)}}var E2=y(()=>{qn()});function rae(t){return yt(t)}var A2=y(()=>{qn()});var nae,T2=y(()=>{Mt();nae=(t,e)=>le(t.innerType._def,e)});var iae,O2=y(()=>{hh();qn();t2();r2();n2();SE();i2();s2();a2();c2();l2();u2();d2();m2();h2();g2();y2();_2();b2();v2();S2();w2();x2();kE();$2();xE();k2();E2();EE();A2();T2();iae=(t,e,r)=>{switch(e){case z.ZodString:return wE(t,r);case z.ZodNumber:return Wse(t,r);case z.ZodObject:return Kse(t,r);case z.ZodBigInt:return Pse(t,r);case z.ZodBoolean:return Cse();case z.ZodDate:return o2(t,r);case z.ZodUndefined:return tae(r);case z.ZodNull:return Hse(r);case z.ZodArray:return Ise(t,r);case z.ZodUnion:case z.ZodDiscriminatedUnion:return Zse(t,r);case z.ZodIntersection:return Fse(t,r);case z.ZodTuple:return eae(t,r);case z.ZodRecord:return $E(t,r);case z.ZodLiteral:return Lse(t,r);case z.ZodEnum:return Mse(t);case z.ZodNativeEnum:return qse(t);case z.ZodNullable:return Vse(t,r);case z.ZodOptional:return Jse(t,r);case z.ZodMap:return Use(t,r);case z.ZodSet:return Qse(t,r);case z.ZodLazy:return()=>t.getter()._def;case z.ZodPromise:return Xse(t,r);case z.ZodNaN:case z.ZodNever:return Bse(r);case z.ZodEffects:return jse(t,r);case z.ZodAny:return yt(r);case z.ZodUnknown:return rae(r);case z.ZodDefault:return Nse(t,r);case z.ZodBranded:return vE(t,r);case z.ZodReadonly:return nae(t,r);case z.ZodCatch:return Dse(t,r);case z.ZodPipeline:return Yse(t,r);case z.ZodFunction:case z.ZodVoid:case z.ZodSymbol:return;default:return(n=>{})(e)}}});function le(t,e,r=!1){let n=e.seen.get(t);if(e.override){let a=e.override?.(t,e,n,r);if(a!==Tse)return a}if(n&&!r){let a=qGe(n,e);if(a!==void 0)return a}let i={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,i);let o=iae(t,t.typeName,e),s=typeof o=="function"?le(o(),e):o;if(s&&BGe(t,e,s),e.postProcess){let a=e.postProcess(s,t,e);return i.jsonSchema=s,a}return i.jsonSchema=s,s}var qGe,BGe,Mt=y(()=>{yE();O2();bE();qn();qGe=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:_E(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),yt(e)):e.$refStrategy==="seen"?yt(e):void 0}},BGe=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r)});var oae=y(()=>{});var R2,I2=y(()=>{Mt();Qz();qn();R2=(t,e)=>{let r=Rse(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[l,u])=>({...c,[l]:le(u._def,{...r,currentPath:[...r.basePath,r.definitionPath,l]},!0)??yt(r)}),{}):void 0,i=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=le(t._def,i===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1)??yt(r),s=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;s!==void 0&&(o.title=s),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let a=i===void 0?n?{...o,[r.definitionPath]:n}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...n,[i]:o}};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a}});var sae=y(()=>{yE();Qz();Xs();bE();Mt();oae();qn();t2();r2();n2();SE();i2();s2();a2();c2();l2();u2();d2();m2();h2();g2();y2();_2();b2();v2();S2();w2();x2();T2();kE();$2();xE();k2();E2();EE();A2();O2();I2();I2()});function HGe(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function P2(t,e){return Ln(t)?Pc(t,{target:HGe(e?.target),io:e?.pipeStrategy??"input"}):R2(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function C2(t){let r=Ws(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=_k(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function D2(t,e){let r=Vs(t,e);if(!r.success)throw r.error;return r.data}var N2=y(()=>{EL();rg();sae()});function aae(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function cae(t,e){let r={...t};for(let n in e){let i=n,o=e[i];if(o===void 0)continue;let s=r[i];aae(s)&&aae(o)?r[i]={...s,...o}:r[i]=o}return r}var GGe,AE,lae=y(()=>{rg();Nc();Ese();N2();GGe=6e4,AE=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(eE,r=>{this._oncancel(r)}),this.setNotificationHandler(rE,r=>{this._onprogress(r)}),this.setRequestHandler(tE,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(nE,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ie(ae.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(oE,async(r,n)=>{let i=async()=>{let o=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(o,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,l=c.id,u=this._requestResolvers.get(l);if(u)if(this._requestResolvers.delete(l),a.type==="response")u(c);else{let d=c,f=new ie(d.error.code,d.error.message,d.error.data);u(f)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(o,n.sessionId);if(!s)throw new ie(ae.InvalidParams,`Task not found: ${o}`);if(!Ys(s.status))return await this._waitForTaskUpdate(o,n.signal),await i();if(Ys(s.status)){let a=await this._taskStore.getTaskResult(o,n.sessionId);return this._clearTaskQueue(o),{...a,_meta:{...a._meta,[Js]:{taskId:o}}}}return await i()};return await i()}),this.setRequestHandler(sE,async(r,n)=>{try{let{tasks:i,nextCursor:o}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:o,_meta:{}}}catch(i){throw new ie(ae.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(cE,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ie(ae.InvalidParams,`Task not found: ${r.params.taskId}`);if(Ys(i.status))throw new ie(ae.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new ie(ae.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...o}}catch(i){throw i instanceof ie?i:new ie(ae.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,i,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:o,onTimeout:i})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),ie.fromError(ae.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=o=>{n?.(o),this._onerror(o)};let i=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{i?.(o,s),vg(o)||hse(o)?this._onresponse(o):Mz(o)?this._onrequest(o,s):mse(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=ie.fromError(ae.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,o=e.params?._meta?.[Js]?.taskId;if(n===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:ae.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:u,timestamp:Date.now()},i?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):i?.send(u).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let a=dse(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,l={signal:s.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{if(s.signal.aborted)return;let d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(u,d)},sendRequest:async(u,d,f)=>{if(s.signal.aborted)throw new ie(ae.ConnectionClosed,"Request was cancelled");let p={...f,relatedRequestId:e.id};o&&!p.relatedTask&&(p.relatedTask={taskId:o});let m=p.relatedTask?.taskId??o;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(u,d,p)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,l)).then(async u=>{if(s.signal.aborted)return;let d={result:u,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)},async u=>{if(s.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:ae.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===s&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,i=Number(r),o=this._progressHandlers.get(i);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(i),a=this._timeoutInfo.get(i);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),s(c);return}o(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),vg(e))n(e);else{let s=new ie(e.error.code,e.error.message,e.error.data);n(s)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let o=!1;if(vg(e)&&e.result&&typeof e.result=="object"){let s=e.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(o=!0,this._taskProgressTokens.set(a.taskId,r))}}if(o||this._progressHandlers.delete(r),vg(e))i(e);else{let s=ie.fromError(e.error.code,e.error.message,e.error.data);i(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(e,r,n)}}catch(s){yield{type:"error",error:s instanceof ie?s:new ie(ae.InternalError,String(s))}}return}let o;try{let s=await this.request(e,Id,n);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new ie(ae.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:o},n);if(yield{type:"taskStatus",task:a},Ys(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)}:a.status==="failed"?yield{type:"error",error:new ie(ae.InternalError,`Task ${o} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new ie(ae.InternalError,`Task ${o} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,c)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof ie?s:new ie(ae.InternalError,String(s))}}}request(e,r,n){let{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s,task:a,relatedTask:c}=n??{};return new Promise((l,u)=>{let d=_=>{u(_)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(_){d(_);return}n?.signal?.throwIfAborted();let f=this._requestMessageId++,p={...e,jsonrpc:"2.0",id:f};n?.onprogress&&(this._progressHandlers.set(f,n.onprogress),p.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),a&&(p.params={...p.params,task:a}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[Js]:c}});let m=_=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(_)}},{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(x=>this._onerror(new Error(`Failed to send cancellation: ${x}`)));let S=_ instanceof ie?_:new ie(ae.RequestTimeout,String(_));u(S)};this._responseHandlers.set(f,_=>{if(!n?.signal?.aborted){if(_ instanceof Error)return u(_);try{let S=Vs(r,_.result);S.success?l(S.data):u(S.error)}catch(S){u(S)}}}),n?.signal?.addEventListener("abort",()=>{m(n?.signal?.reason)});let h=n?.timeout??GGe,g=()=>m(ie.fromError(ae.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(f,h,n?.maxTotalTimeout,g,n?.resetTimeoutOnProgress??!1);let b=c?.taskId;if(b){let _=S=>{let x=this._responseHandlers.get(f);x?x(S):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,_),this._enqueueTaskMessage(b,{type:"request",message:p,timestamp:Date.now()}).catch(S=>{this._cleanupTimeout(f),u(S)})}else this._transport.send(p,{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(_=>{this._cleanupTimeout(f),u(_)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},iE,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},aE,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},_se,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Js]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Js]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Js]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(e,r){let n=C2(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,o)=>{let s=D2(e,i);return Promise.resolve(r(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=C2(e);this._notificationHandlers.set(n,i=>{let o=D2(e,i);return Promise.resolve(r(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,i)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let i of n)if(i.type==="request"&&Mz(i.message)){let o=i.message.id,s=this._requestResolvers.get(o);s?(s(new ie(ae.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(e);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,o)=>{if(r.aborted){o(new ie(ae.InvalidRequest,"Request cancelled"));return}let s=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(s),o(new ie(ae.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!e)throw new Error("No request provided");return await n.createTask(i,e.id,{method:e.method,params:e.params},r)},getTask:async i=>{let o=await n.getTask(i,r);if(!o)throw new ie(ae.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(i,o,s)=>{await n.storeTaskResult(i,o,s,r);let a=await n.getTask(i,r);if(a){let c=kg.parse({method:"notifications/tasks/status",params:a});await this.notification(c),Ys(a.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,o,s)=>{let a=await n.getTask(i,r);if(!a)throw new ie(ae.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(Ys(a.status))throw new ie(ae.InvalidParams,`Cannot update task "${i}" from terminal status "${a.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,o,s,r);let c=await n.getTask(i,r);if(c){let l=kg.parse({method:"notifications/tasks/status",params:c});await this.notification(l),Ys(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}}});var Pg=v(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.regexpCode=Fe.getEsmExportName=Fe.getProperty=Fe.safeStringify=Fe.stringify=Fe.strConcat=Fe.addCodeArg=Fe.str=Fe._=Fe.nil=Fe._Code=Fe.Name=Fe.IDENTIFIER=Fe._CodeOrName=void 0;var Rg=class{};Fe._CodeOrName=Rg;Fe.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var jc=class extends Rg{constructor(e){if(super(),!Fe.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Fe.Name=jc;var Bn=class extends Rg{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof jc&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Fe._Code=Bn;Fe.nil=new Bn("");function uae(t,...e){let r=[t[0]],n=0;for(;n{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.ValueScope=Wr.ValueScopeName=Wr.Scope=Wr.varKinds=Wr.UsedValueState=void 0;var Vr=Pg(),F2=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},TE;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(TE||(Wr.UsedValueState=TE={}));Wr.varKinds={const:new Vr.Name("const"),let:new Vr.Name("let"),var:new Vr.Name("var")};var OE=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Vr.Name?e:this.name(e)}name(e){return new Vr.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Wr.Scope=OE;var RE=class extends Vr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Vr._)`.${new Vr.Name(r)}[${n}]`}};Wr.ValueScopeName=RE;var eZe=(0,Vr._)`\n`,L2=class extends OE{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?eZe:Vr.nil}}get(){return this._scope}name(e){return new RE(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:o}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let u=a.get(s);if(u)return u}else a=this._values[o]=new Map;a.set(s,i);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:o,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Vr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let o=Vr.nil;for(let s in e){let a=e[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,TE.Started);let u=r(l);if(u){let d=this.opts.es5?Wr.varKinds.var:Wr.varKinds.const;o=(0,Vr._)`${o}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))o=(0,Vr._)`${o}${u}${this.opts._n}`;else throw new F2(l);c.set(l,TE.Completed)})}return o}};Wr.ValueScope=L2});var we=v(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.or=Ee.and=Ee.not=Ee.CodeGen=Ee.operators=Ee.varKinds=Ee.ValueScopeName=Ee.ValueScope=Ee.Scope=Ee.Name=Ee.regexpCode=Ee.stringify=Ee.getProperty=Ee.nil=Ee.strConcat=Ee.str=Ee._=void 0;var Pe=Pg(),yi=z2(),Qs=Pg();Object.defineProperty(Ee,"_",{enumerable:!0,get:function(){return Qs._}});Object.defineProperty(Ee,"str",{enumerable:!0,get:function(){return Qs.str}});Object.defineProperty(Ee,"strConcat",{enumerable:!0,get:function(){return Qs.strConcat}});Object.defineProperty(Ee,"nil",{enumerable:!0,get:function(){return Qs.nil}});Object.defineProperty(Ee,"getProperty",{enumerable:!0,get:function(){return Qs.getProperty}});Object.defineProperty(Ee,"stringify",{enumerable:!0,get:function(){return Qs.stringify}});Object.defineProperty(Ee,"regexpCode",{enumerable:!0,get:function(){return Qs.regexpCode}});Object.defineProperty(Ee,"Name",{enumerable:!0,get:function(){return Qs.Name}});var DE=z2();Object.defineProperty(Ee,"Scope",{enumerable:!0,get:function(){return DE.Scope}});Object.defineProperty(Ee,"ValueScope",{enumerable:!0,get:function(){return DE.ValueScope}});Object.defineProperty(Ee,"ValueScopeName",{enumerable:!0,get:function(){return DE.ValueScopeName}});Object.defineProperty(Ee,"varKinds",{enumerable:!0,get:function(){return DE.varKinds}});Ee.operators={GT:new Pe._Code(">"),GTE:new Pe._Code(">="),LT:new Pe._Code("<"),LTE:new Pe._Code("<="),EQ:new Pe._Code("==="),NEQ:new Pe._Code("!=="),NOT:new Pe._Code("!"),OR:new Pe._Code("||"),AND:new Pe._Code("&&"),ADD:new Pe._Code("+")};var qo=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},U2=class extends qo{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?yi.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=jd(this.rhs,e,r)),this}get names(){return this.rhs instanceof Pe._CodeOrName?this.rhs.names:{}}},IE=class extends qo{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Pe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=jd(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Pe.Name?{}:{...this.lhs.names};return CE(e,this.rhs)}},q2=class extends IE{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},B2=class extends qo{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},H2=class extends qo{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},G2=class extends qo{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Z2=class extends qo{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=jd(this.code,e,r),this}get names(){return this.code instanceof Pe._CodeOrName?this.code.names:{}}},Cg=class extends qo{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(e,r)||(tZe(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Lc(e,r.names),{})}},Bo=class extends Cg{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},V2=class extends Cg{},Nd=class extends Bo{};Nd.kind="else";var Mc=class t extends Bo{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Nd(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(fae(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=jd(this.condition,e,r),this}get names(){let e=super.names;return CE(e,this.condition),this.else&&Lc(e,this.else.names),e}};Mc.kind="if";var Fc=class extends Bo{};Fc.kind="for";var W2=class extends Fc{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=jd(this.iteration,e,r),this}get names(){return Lc(super.names,this.iteration.names)}},K2=class extends Fc{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?yi.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=CE(super.names,this.from);return CE(e,this.to)}},PE=class extends Fc{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=jd(this.iterable,e,r),this}get names(){return Lc(super.names,this.iterable.names)}},Dg=class extends Bo{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Dg.kind="func";var Ng=class extends Cg{render(e){return"return "+super.render(e)}};Ng.kind="return";var J2=class extends Bo{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Lc(e,this.catch.names),this.finally&&Lc(e,this.finally.names),e}},jg=class extends Bo{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};jg.kind="catch";var Mg=class extends Bo{render(e){return"finally"+super.render(e)}};Mg.kind="finally";var Y2=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?` `:""},this._extScope=e,this._scope=new yi.Scope({parent:e}),this._nodes=[new V2]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let o=this._scope.toName(r);return n!==void 0&&i&&(this._constants[o.str]=n),this._leafNode(new U2(e,o,n)),o}const(e,r,n){return this._def(yi.varKinds.const,e,r,n)}let(e,r,n){return this._def(yi.varKinds.let,e,r,n)}var(e,r,n){return this._def(yi.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new IE(e,r,n))}add(e,r){return this._leafNode(new q2(e,Ee.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Pe.nil&&this._leafNode(new Z2(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Pe.addCodeArg)(r,i));return r.push("}"),new Pe._Code(r)}if(e,r,n){if(this._blockNode(new Mc(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Mc(e))}else(){return this._elseNode(new Nd)}endIf(){return this._endBlockNode(Mc,Nd)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new W2(e),r)}forRange(e,r,n,i,o=this.opts.es5?yi.varKinds.var:yi.varKinds.let){let s=this._scope.toName(e);return this._for(new K2(o,s,r,n),()=>i(s))}forOf(e,r,n,i=yi.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=r instanceof Pe.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Pe._)`${s}.length`,a=>{this.var(o,(0,Pe._)`${s}[${a}]`),n(o)})}return this._for(new PE("of",i,o,r),()=>n(o))}forIn(e,r,n,i=this.opts.es5?yi.varKinds.var:yi.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Pe._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new PE("in",i,o,r),()=>n(o))}endFor(){return this._endBlockNode(Fc)}label(e){return this._leafNode(new B2(e))}break(e){return this._leafNode(new H2(e))}return(e){let r=new Ng;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ng)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new J2;if(this._blockNode(i),this.code(e),r){let o=this.name("e");this._currNode=i.catch=new jg(o),r(o)}return n&&(this._currNode=i.finally=new Mg,this.code(n)),this._endBlockNode(jg,Mg)}throw(e){return this._leafNode(new G2(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Pe.nil,n,i){return this._blockNode(new Dg(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Dg)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Mc))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};Ee.CodeGen=Y2;function Lc(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function CE(t,e){return e instanceof Pe._CodeOrName?Lc(t,e.names):t}function jd(t,e,r){if(t instanceof Pe.Name)return n(t);if(!i(t))return t;return new Pe._Code(t._items.reduce((o,s)=>(s instanceof Pe.Name&&(s=n(s)),s instanceof Pe._Code?o.push(...s._items):o.push(s),o),[]));function n(o){let s=r[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function i(o){return o instanceof Pe._Code&&o._items.some(s=>s instanceof Pe.Name&&e[s.str]===1&&r[s.str]!==void 0)}}function tZe(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function fae(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Pe._)`!${X2(t)}`}Ee.not=fae;var rZe=pae(Ee.operators.AND);function nZe(...t){return t.reduce(rZe)}Ee.and=nZe;var iZe=pae(Ee.operators.OR);function oZe(...t){return t.reduce(iZe)}Ee.or=oZe;function pae(t){return(e,r)=>e===Pe.nil?r:r===Pe.nil?e:(0,Pe._)`${X2(e)} ${t} ${X2(r)}`}function X2(t){return t instanceof Pe.Name?t:(0,Pe._)`(${t})`}});var Ne=v(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.checkStrictMode=Te.getErrorPath=Te.Type=Te.useFunc=Te.setEvaluated=Te.evaluatedPropsToName=Te.mergeEvaluated=Te.eachItem=Te.unescapeJsonPointer=Te.escapeJsonPointer=Te.escapeFragment=Te.unescapeFragment=Te.schemaRefOrVal=Te.schemaHasRulesButRef=Te.schemaHasRules=Te.checkUnknownRules=Te.alwaysValidSchema=Te.toHash=void 0;var ct=we(),sZe=Pg();function aZe(t){let e={};for(let r of t)e[r]=!0;return e}Te.toHash=aZe;function cZe(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(gae(t,e),!yae(e,t.self.RULES.all))}Te.alwaysValidSchema=cZe;function gae(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let o in e)i[o]||vae(t,`unknown keyword: "${o}"`)}Te.checkUnknownRules=gae;function yae(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Te.schemaHasRules=yae;function lZe(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Te.schemaHasRulesButRef=lZe;function uZe({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ct._)`${r}`}return(0,ct._)`${t}${e}${(0,ct.getProperty)(n)}`}Te.schemaRefOrVal=uZe;function dZe(t){return _ae(decodeURIComponent(t))}Te.unescapeFragment=dZe;function fZe(t){return encodeURIComponent(eU(t))}Te.escapeFragment=fZe;function eU(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Te.escapeJsonPointer=eU;function _ae(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Te.unescapeJsonPointer=_ae;function pZe(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Te.eachItem=pZe;function mae({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,o,s,a)=>{let c=s===void 0?o:s instanceof ct.Name?(o instanceof ct.Name?t(i,o,s):e(i,o,s),s):o instanceof ct.Name?(e(i,s,o),o):r(o,s);return a===ct.Name&&!(c instanceof ct.Name)?n(i,c):c}}Te.mergeEvaluated={props:mae({mergeNames:(t,e,r)=>t.if((0,ct._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ct._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ct._)`${r} || {}`).code((0,ct._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ct._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ct._)`${r} || {}`),tU(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:bae}),items:mae({mergeNames:(t,e,r)=>t.if((0,ct._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ct._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ct._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ct._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function bae(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ct._)`{}`);return e!==void 0&&tU(t,r,e),r}Te.evaluatedPropsToName=bae;function tU(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ct._)`${e}${(0,ct.getProperty)(n)}`,!0))}Te.setEvaluated=tU;var hae={};function mZe(t,e){return t.scopeValue("func",{ref:e,code:hae[e.code]||(hae[e.code]=new sZe._Code(e.code))})}Te.useFunc=mZe;var Q2;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Q2||(Te.Type=Q2={}));function hZe(t,e,r){if(t instanceof ct.Name){let n=e===Q2.Num;return r?n?(0,ct._)`"[" + ${t} + "]"`:(0,ct._)`"['" + ${t} + "']"`:n?(0,ct._)`"/" + ${t}`:(0,ct._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ct.getProperty)(t).toString():"/"+eU(t)}Te.getErrorPath=hZe;function vae(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Te.checkStrictMode=vae});var Ho=v(rU=>{"use strict";Object.defineProperty(rU,"__esModule",{value:!0});var gr=we(),gZe={data:new gr.Name("data"),valCxt:new gr.Name("valCxt"),instancePath:new gr.Name("instancePath"),parentData:new gr.Name("parentData"),parentDataProperty:new gr.Name("parentDataProperty"),rootData:new gr.Name("rootData"),dynamicAnchors:new gr.Name("dynamicAnchors"),vErrors:new gr.Name("vErrors"),errors:new gr.Name("errors"),this:new gr.Name("this"),self:new gr.Name("self"),scope:new gr.Name("scope"),json:new gr.Name("json"),jsonPos:new gr.Name("jsonPos"),jsonLen:new gr.Name("jsonLen"),jsonPart:new gr.Name("jsonPart")};rU.default=gZe});var Fg=v(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.extendErrors=yr.resetErrorsCount=yr.reportExtraError=yr.reportError=yr.keyword$DataError=yr.keywordError=void 0;var je=we(),NE=Ne(),Or=Ho();yr.keywordError={message:({keyword:t})=>(0,je.str)`must pass "${t}" keyword validation`};yr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,je.str)`"${t}" keyword must be ${e} ($data)`:(0,je.str)`"${t}" keyword is invalid ($data)`};function yZe(t,e=yr.keywordError,r,n){let{it:i}=t,{gen:o,compositeRule:s,allErrors:a}=i,c=xae(t,e,r);n??(s||a)?Sae(o,c):wae(i,(0,je._)`[${c}]`)}yr.reportError=yZe;function _Ze(t,e=yr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:o,allErrors:s}=n,a=xae(t,e,r);Sae(i,a),o||s||wae(n,Or.default.vErrors)}yr.reportExtraError=_Ze;function bZe(t,e){t.assign(Or.default.errors,e),t.if((0,je._)`${Or.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,je._)`${Or.default.vErrors}.length`,e),()=>t.assign(Or.default.vErrors,null)))}yr.resetErrorsCount=bZe;function vZe({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:o}){if(i===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",i,Or.default.errors,a=>{t.const(s,(0,je._)`${Or.default.vErrors}[${a}]`),t.if((0,je._)`${s}.instancePath === undefined`,()=>t.assign((0,je._)`${s}.instancePath`,(0,je.strConcat)(Or.default.instancePath,o.errorPath))),t.assign((0,je._)`${s}.schemaPath`,(0,je.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,je._)`${s}.schema`,r),t.assign((0,je._)`${s}.data`,n))})}yr.extendErrors=vZe;function Sae(t,e){let r=t.const("err",e);t.if((0,je._)`${Or.default.vErrors} === null`,()=>t.assign(Or.default.vErrors,(0,je._)`[${r}]`),(0,je._)`${Or.default.vErrors}.push(${r})`),t.code((0,je._)`${Or.default.errors}++`)}function wae(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,je._)`new ${t.ValidationError}(${e})`):(r.assign((0,je._)`${n}.errors`,e),r.return(!1))}var zc={keyword:new je.Name("keyword"),schemaPath:new je.Name("schemaPath"),params:new je.Name("params"),propertyName:new je.Name("propertyName"),message:new je.Name("message"),schema:new je.Name("schema"),parentSchema:new je.Name("parentSchema")};function xae(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,je._)`{}`:SZe(t,e,r)}function SZe(t,e,r={}){let{gen:n,it:i}=t,o=[wZe(i,r),xZe(t,r)];return $Ze(t,e,o),n.object(...o)}function wZe({errorPath:t},{instancePath:e}){let r=e?(0,je.str)`${t}${(0,NE.getErrorPath)(e,NE.Type.Str)}`:t;return[Or.default.instancePath,(0,je.strConcat)(Or.default.instancePath,r)]}function xZe({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,je.str)`${e}/${t}`;return r&&(i=(0,je.str)`${i}${(0,NE.getErrorPath)(r,NE.Type.Str)}`),[zc.schemaPath,i]}function $Ze(t,{params:e,message:r},n){let{keyword:i,data:o,schemaValue:s,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;n.push([zc.keyword,i],[zc.params,typeof e=="function"?e(t):e||(0,je._)`{}`]),c.messages&&n.push([zc.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([zc.schema,s],[zc.parentSchema,(0,je._)`${u}${d}`],[Or.default.data,o]),l&&n.push([zc.propertyName,l])}});var kae=v(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.boolOrEmptySchema=Md.topBoolOrEmptySchema=void 0;var kZe=Fg(),EZe=we(),AZe=Ho(),TZe={message:"boolean schema is false"};function OZe(t){let{gen:e,schema:r,validateName:n}=t;r===!1?$ae(t,!1):typeof r=="object"&&r.$async===!0?e.return(AZe.default.data):(e.assign((0,EZe._)`${n}.errors`,null),e.return(!0))}Md.topBoolOrEmptySchema=OZe;function RZe(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),$ae(t)):r.var(e,!0)}Md.boolOrEmptySchema=RZe;function $ae(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,kZe.reportError)(i,TZe,void 0,e)}});var nU=v(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.getRules=Fd.isJSONType=void 0;var IZe=["string","number","integer","boolean","null","object","array"],PZe=new Set(IZe);function CZe(t){return typeof t=="string"&&PZe.has(t)}Fd.isJSONType=CZe;function DZe(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Fd.getRules=DZe});var iU=v(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.shouldUseRule=ea.shouldUseGroup=ea.schemaHasRulesForType=void 0;function NZe({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Eae(t,n)}ea.schemaHasRulesForType=NZe;function Eae(t,e){return e.rules.some(r=>Aae(t,r))}ea.shouldUseGroup=Eae;function Aae(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}ea.shouldUseRule=Aae});var Lg=v(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.reportTypeError=_r.checkDataTypes=_r.checkDataType=_r.coerceAndCheckDataType=_r.getJSONTypes=_r.getSchemaTypes=_r.DataType=void 0;var jZe=nU(),MZe=iU(),FZe=Fg(),Se=we(),Tae=Ne(),Ld;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ld||(_r.DataType=Ld={}));function LZe(t){let e=Oae(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}_r.getSchemaTypes=LZe;function Oae(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(jZe.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}_r.getJSONTypes=Oae;function zZe(t,e){let{gen:r,data:n,opts:i}=t,o=UZe(e,i.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,MZe.schemaHasRulesForType)(t,e[0]));if(s){let a=sU(e,n,i.strictNumbers,Ld.Wrong);r.if(a,()=>{o.length?qZe(t,e,o):aU(t)})}return s}_r.coerceAndCheckDataType=zZe;var Rae=new Set(["string","number","integer","boolean","null"]);function UZe(t,e){return e?t.filter(r=>Rae.has(r)||e==="array"&&r==="array"):[]}function qZe(t,e,r){let{gen:n,data:i,opts:o}=t,s=n.let("dataType",(0,Se._)`typeof ${i}`),a=n.let("coerced",(0,Se._)`undefined`);o.coerceTypes==="array"&&n.if((0,Se._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Se._)`${i}[0]`).assign(s,(0,Se._)`typeof ${i}`).if(sU(e,i,o.strictNumbers),()=>n.assign(a,i))),n.if((0,Se._)`${a} !== undefined`);for(let l of r)(Rae.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);n.else(),aU(t),n.endIf(),n.if((0,Se._)`${a} !== undefined`,()=>{n.assign(i,a),BZe(t,a)});function c(l){switch(l){case"string":n.elseIf((0,Se._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,Se._)`"" + ${i}`).elseIf((0,Se._)`${i} === null`).assign(a,(0,Se._)`""`);return;case"number":n.elseIf((0,Se._)`${s} == "boolean" || ${i} === null || (${s} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,Se._)`+${i}`);return;case"integer":n.elseIf((0,Se._)`${s} === "boolean" || ${i} === null || (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,Se._)`+${i}`);return;case"boolean":n.elseIf((0,Se._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,Se._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":n.elseIf((0,Se._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(a,null);return;case"array":n.elseIf((0,Se._)`${s} === "string" || ${s} === "number" - || ${s} === "boolean" || ${i} === null`).assign(a,(0,Se._)`[${i}]`)}}}function BZe({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Se._)`${e} !== undefined`,()=>t.assign((0,Se._)`${e}[${r}]`,n))}function oU(t,e,r,n=Ld.Correct){let i=n===Ld.Correct?Se.operators.EQ:Se.operators.NEQ,o;switch(t){case"null":return(0,Se._)`${e} ${i} null`;case"array":o=(0,Se._)`Array.isArray(${e})`;break;case"object":o=(0,Se._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,Se._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,Se._)`typeof ${e} ${i} ${t}`}return n===Ld.Correct?o:(0,Se.not)(o);function s(a=Se.nil){return(0,Se.and)((0,Se._)`typeof ${e} == "number"`,a,r?(0,Se._)`isFinite(${e})`:Se.nil)}}_r.checkDataType=oU;function sU(t,e,r,n){if(t.length===1)return oU(t[0],e,r,n);let i,o=(0,Tae.toHash)(t);if(o.array&&o.object){let s=(0,Se._)`typeof ${e} != "object"`;i=o.null?s:(0,Se._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else i=Se.nil;o.number&&delete o.integer;for(let s in o)i=(0,Se.and)(i,oU(s,e,r,n));return i}_r.checkDataTypes=sU;var HZe={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Se._)`{type: ${t}}`:(0,Se._)`{type: ${e}}`};function aU(t){let e=GZe(t);(0,FZe.reportError)(e,HZe)}_r.reportTypeError=aU;function GZe(t){let{gen:e,data:r,schema:n}=t,i=(0,Tae.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var Pae=v(jE=>{"use strict";Object.defineProperty(jE,"__esModule",{value:!0});jE.assignDefaults=void 0;var zd=we(),ZZe=Ne();function VZe(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)Iae(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,o)=>Iae(t,o,i.default))}jE.assignDefaults=VZe;function Iae(t,e,r){let{gen:n,compositeRule:i,data:o,opts:s}=t;if(r===void 0)return;let a=(0,zd._)`${o}${(0,zd.getProperty)(e)}`;if(i){(0,ZZe.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,zd._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,zd._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,zd._)`${a} = ${(0,zd.stringify)(r)}`)}});var Hn=v(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.validateUnion=nt.validateArray=nt.usePattern=nt.callValidateCode=nt.schemaProperties=nt.allSchemaProperties=nt.noPropertyInData=nt.propertyInData=nt.isOwnProperty=nt.hasPropFunc=nt.reportMissingProp=nt.checkMissingProp=nt.checkReportMissingProp=void 0;var ft=we(),cU=Ne(),ta=Ho(),WZe=Ne();function KZe(t,e){let{gen:r,data:n,it:i}=t;r.if(uU(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ft._)`${e}`},!0),t.error()})}nt.checkReportMissingProp=KZe;function JZe({gen:t,data:e,it:{opts:r}},n,i){return(0,ft.or)(...n.map(o=>(0,ft.and)(uU(t,e,o,r.ownProperties),(0,ft._)`${i} = ${o}`)))}nt.checkMissingProp=JZe;function YZe(t,e){t.setParams({missingProperty:e},!0),t.error()}nt.reportMissingProp=YZe;function Cae(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ft._)`Object.prototype.hasOwnProperty`})}nt.hasPropFunc=Cae;function lU(t,e,r){return(0,ft._)`${Cae(t)}.call(${e}, ${r})`}nt.isOwnProperty=lU;function XZe(t,e,r,n){let i=(0,ft._)`${e}${(0,ft.getProperty)(r)} !== undefined`;return n?(0,ft._)`${i} && ${lU(t,e,r)}`:i}nt.propertyInData=XZe;function uU(t,e,r,n){let i=(0,ft._)`${e}${(0,ft.getProperty)(r)} === undefined`;return n?(0,ft.or)(i,(0,ft.not)(lU(t,e,r))):i}nt.noPropertyInData=uU;function Dae(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}nt.allSchemaProperties=Dae;function QZe(t,e){return Dae(e).filter(r=>!(0,cU.alwaysValidSchema)(t,e[r]))}nt.schemaProperties=QZe;function e9e({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:s},a,c,l){let u=l?(0,ft._)`${t}, ${e}, ${n}${i}`:e,d=[[ta.default.instancePath,(0,ft.strConcat)(ta.default.instancePath,o)],[ta.default.parentData,s.parentData],[ta.default.parentDataProperty,s.parentDataProperty],[ta.default.rootData,ta.default.rootData]];s.opts.dynamicRef&&d.push([ta.default.dynamicAnchors,ta.default.dynamicAnchors]);let f=(0,ft._)`${u}, ${r.object(...d)}`;return c!==ft.nil?(0,ft._)`${a}.call(${c}, ${f})`:(0,ft._)`${a}(${f})`}nt.callValidateCode=e9e;var t9e=(0,ft._)`new RegExp`;function r9e({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,o=i(r,n);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,ft._)`${i.code==="new RegExp"?t9e:(0,WZe.useFunc)(t,i)}(${r}, ${n})`})}nt.usePattern=r9e;function n9e(t){let{gen:e,data:r,keyword:n,it:i}=t,o=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){let c=e.const("len",(0,ft._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:cU.Type.Num},o),e.if((0,ft.not)(o),a)})}}nt.validateArray=n9e;function i9e(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,cU.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let s=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(s,(0,ft._)`${s} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,ft.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}nt.validateUnion=i9e});var Mae=v(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.validateKeywordUsage=ro.validSchemaType=ro.funcKeywordCode=ro.macroKeywordCode=void 0;var Rr=we(),Uc=Ho(),o9e=Hn(),s9e=Fg();function a9e(t,e){let{gen:r,keyword:n,schema:i,parentSchema:o,it:s}=t,a=e.macro.call(s.self,i,o,s),c=jae(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:Rr.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}ro.macroKeywordCode=a9e;function c9e(t,e){var r;let{gen:n,keyword:i,schema:o,parentSchema:s,$data:a,it:c}=t;u9e(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,s,c):e.validate,u=jae(n,i,l),d=n.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)h(),e.modifying&&Nae(t),g(()=>t.error());else{let b=e.async?p():m();e.modifying&&Nae(t),g(()=>l9e(t,b))}}function p(){let b=n.let("ruleErrs",null);return n.try(()=>h((0,Rr._)`await `),_=>n.assign(d,!1).if((0,Rr._)`${_} instanceof ${c.ValidationError}`,()=>n.assign(b,(0,Rr._)`${_}.errors`),()=>n.throw(_))),b}function m(){let b=(0,Rr._)`${u}.errors`;return n.assign(b,null),h(Rr.nil),b}function h(b=e.async?(0,Rr._)`await `:Rr.nil){let _=c.opts.passContext?Uc.default.this:Uc.default.self,S=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Rr._)`${b}${(0,o9e.callValidateCode)(t,u,_,S)}`,e.modifying)}function g(b){var _;n.if((0,Rr.not)((_=e.valid)!==null&&_!==void 0?_:d),b)}}ro.funcKeywordCode=c9e;function Nae(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Rr._)`${n.parentData}[${n.parentDataProperty}]`))}function l9e(t,e){let{gen:r}=t;r.if((0,Rr._)`Array.isArray(${e})`,()=>{r.assign(Uc.default.vErrors,(0,Rr._)`${Uc.default.vErrors} === null ? ${e} : ${Uc.default.vErrors}.concat(${e})`).assign(Uc.default.errors,(0,Rr._)`${Uc.default.vErrors}.length`),(0,s9e.extendErrors)(t)},()=>t.error())}function u9e({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function jae(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Rr.stringify)(r)})}function d9e(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}ro.validSchemaType=d9e;function f9e({schema:t,opts:e,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");let s=i.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}ro.validateKeywordUsage=f9e});var Lae=v(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.extendSubschemaMode=ra.extendSubschemaData=ra.getSubschema=void 0;var no=we(),Fae=Ne();function p9e(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,no._)`${t.schemaPath}${(0,no.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,no._)`${t.schemaPath}${(0,no.getProperty)(e)}${(0,no.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Fae.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}ra.getSubschema=p9e;function m9e(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:s}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,no._)`${e.data}${(0,no.getProperty)(r)}`,!0);c(f),t.errorPath=(0,no.str)`${l}${(0,Fae.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,no._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof no.Name?i:a.let("data",i,!0);c(l),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}ra.extendSubschemaData=m9e;function h9e(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}ra.extendSubschemaMode=h9e});var dU=v((UOt,zae)=>{"use strict";zae.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var s=o[i];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var qae=v((qOt,Uae)=>{"use strict";var na=Uae.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};ME(e,n,i,t,"",t)};na.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};na.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};na.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};na.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ME(t,e,r,n,i,o,s,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,o,s,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in na.arrayKeywords)for(var f=0;f{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.getSchemaRefs=Kr.resolveUrl=Kr.normalizeId=Kr._getFullPath=Kr.getFullPath=Kr.inlineRef=void 0;var y9e=Ne(),_9e=dU(),b9e=qae(),v9e=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function S9e(t,e=!0){return typeof t=="boolean"?!0:e===!0?!fU(t):e?Bae(t)<=e:!1}Kr.inlineRef=S9e;var w9e=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function fU(t){for(let e in t){if(w9e.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(fU)||typeof r=="object"&&fU(r))return!0}return!1}function Bae(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!v9e.has(r)&&(typeof t[r]=="object"&&(0,y9e.eachItem)(t[r],n=>e+=Bae(n)),e===1/0))return 1/0}return e}function Hae(t,e="",r){r!==!1&&(e=Ud(e));let n=t.parse(e);return Gae(t,n)}Kr.getFullPath=Hae;function Gae(t,e){return t.serialize(e).split("#")[0]+"#"}Kr._getFullPath=Gae;var x9e=/#\/?$/;function Ud(t){return t?t.replace(x9e,""):""}Kr.normalizeId=Ud;function $9e(t,e,r){return r=Ud(r),t.resolve(e,r)}Kr.resolveUrl=$9e;var k9e=/^[a-z_][-a-z0-9._]*$/i;function E9e(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Ud(t[r]||e),o={"":i},s=Hae(n,i,!1),a={},c=new Set;return b9e(t,{allKeys:!0},(d,f,p,m)=>{if(m===void 0)return;let h=s+f,g=o[m];typeof d[r]=="string"&&(g=b.call(this,d[r])),_.call(this,d.$anchor),_.call(this,d.$dynamicAnchor),o[f]=g;function b(S){let x=this.opts.uriResolver.resolve;if(S=Ud(g?x(g,S):S),c.has(S))throw u(S);c.add(S);let w=this.refs[S];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?l(d,w.schema,S):S!==Ud(h)&&(S[0]==="#"?(l(d,a[S],S),a[S]=d):this.refs[S]=h),S}function _(S){if(typeof S=="string"){if(!k9e.test(S))throw new Error(`invalid anchor "${S}"`);b.call(this,`#${S}`)}}}),a;function l(d,f,p){if(f!==void 0&&!_9e(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Kr.getSchemaRefs=E9e});var Bg=v(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.getData=ia.KeywordCxt=ia.validateFunctionCode=void 0;var Jae=kae(),Zae=Lg(),mU=iU(),FE=Lg(),A9e=Pae(),qg=Mae(),pU=Lae(),oe=we(),pe=Ho(),T9e=zg(),Go=Ne(),Ug=Fg();function O9e(t){if(Qae(t)&&(ece(t),Xae(t))){P9e(t);return}Yae(t,()=>(0,Jae.topBoolOrEmptySchema)(t))}ia.validateFunctionCode=O9e;function Yae({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},o){i.code.es5?t.func(e,(0,oe._)`${pe.default.data}, ${pe.default.valCxt}`,n.$async,()=>{t.code((0,oe._)`"use strict"; ${Vae(r,i)}`),I9e(t,i),t.code(o)}):t.func(e,(0,oe._)`${pe.default.data}, ${R9e(i)}`,n.$async,()=>t.code(Vae(r,i)).code(o))}function R9e(t){return(0,oe._)`{${pe.default.instancePath}="", ${pe.default.parentData}, ${pe.default.parentDataProperty}, ${pe.default.rootData}=${pe.default.data}${t.dynamicRef?(0,oe._)`, ${pe.default.dynamicAnchors}={}`:oe.nil}}={}`}function I9e(t,e){t.if(pe.default.valCxt,()=>{t.var(pe.default.instancePath,(0,oe._)`${pe.default.valCxt}.${pe.default.instancePath}`),t.var(pe.default.parentData,(0,oe._)`${pe.default.valCxt}.${pe.default.parentData}`),t.var(pe.default.parentDataProperty,(0,oe._)`${pe.default.valCxt}.${pe.default.parentDataProperty}`),t.var(pe.default.rootData,(0,oe._)`${pe.default.valCxt}.${pe.default.rootData}`),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,oe._)`${pe.default.valCxt}.${pe.default.dynamicAnchors}`)},()=>{t.var(pe.default.instancePath,(0,oe._)`""`),t.var(pe.default.parentData,(0,oe._)`undefined`),t.var(pe.default.parentDataProperty,(0,oe._)`undefined`),t.var(pe.default.rootData,pe.default.data),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,oe._)`{}`)})}function P9e(t){let{schema:e,opts:r,gen:n}=t;Yae(t,()=>{r.$comment&&e.$comment&&rce(t),M9e(t),n.let(pe.default.vErrors,null),n.let(pe.default.errors,0),r.unevaluated&&C9e(t),tce(t),z9e(t)})}function C9e(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,oe._)`${r}.evaluated`),e.if((0,oe._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,oe._)`${t.evaluated}.props`,(0,oe._)`undefined`)),e.if((0,oe._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,oe._)`${t.evaluated}.items`,(0,oe._)`undefined`))}function Vae(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,oe._)`/*# sourceURL=${r} */`:oe.nil}function D9e(t,e){if(Qae(t)&&(ece(t),Xae(t))){N9e(t,e);return}(0,Jae.boolOrEmptySchema)(t,e)}function Xae({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Qae(t){return typeof t.schema!="boolean"}function N9e(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&rce(t),F9e(t),L9e(t);let o=n.const("_errs",pe.default.errors);tce(t,o),n.var(e,(0,oe._)`${o} === ${pe.default.errors}`)}function ece(t){(0,Go.checkUnknownRules)(t),j9e(t)}function tce(t,e){if(t.opts.jtd)return Wae(t,[],!1,e);let r=(0,Zae.getSchemaTypes)(t.schema),n=(0,Zae.coerceAndCheckDataType)(t,r);Wae(t,r,!n,e)}function j9e(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Go.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function M9e(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Go.checkStrictMode)(t,"default is ignored in the schema root")}function F9e(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,T9e.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function L9e(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function rce({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let o=r.$comment;if(i.$comment===!0)t.code((0,oe._)`${pe.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){let s=(0,oe.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,oe._)`${pe.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function z9e(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=t;r.$async?e.if((0,oe._)`${pe.default.errors} === 0`,()=>e.return(pe.default.data),()=>e.throw((0,oe._)`new ${i}(${pe.default.vErrors})`)):(e.assign((0,oe._)`${n}.errors`,pe.default.vErrors),o.unevaluated&&U9e(t),e.return((0,oe._)`${pe.default.errors} === 0`))}function U9e({gen:t,evaluated:e,props:r,items:n}){r instanceof oe.Name&&t.assign((0,oe._)`${e}.props`,r),n instanceof oe.Name&&t.assign((0,oe._)`${e}.items`,n)}function Wae(t,e,r,n){let{gen:i,schema:o,data:s,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,Go.schemaHasRulesButRef)(o,u))){i.block(()=>ice(t,"$ref",u.all.$ref.definition));return}c.jtd||q9e(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,mU.shouldUseGroup)(o,f)&&(f.type?(i.if((0,FE.checkDataType)(f.type,s,c.strictNumbers)),Kae(t,f),e.length===1&&e[0]===f.type&&r&&(i.else(),(0,FE.reportTypeError)(t)),i.endIf()):Kae(t,f),a||i.if((0,oe._)`${pe.default.errors} === ${n||0}`))}}function Kae(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,A9e.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,mU.shouldUseRule)(n,o)&&ice(t,o.keyword,o.definition,e.type)})}function q9e(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(B9e(t,e),t.opts.allowUnionTypes||H9e(t,e),G9e(t,t.dataTypes))}function B9e(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{nce(t.dataTypes,r)||hU(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),V9e(t,e)}}function H9e(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&hU(t,"use allowUnionTypes to allow union type keyword")}function G9e(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,mU.shouldUseRule)(t.schema,i)){let{type:o}=i.definition;o.length&&!o.some(s=>Z9e(e,s))&&hU(t,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function Z9e(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function nce(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function V9e(t,e){let r=[];for(let n of t.dataTypes)nce(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function hU(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Go.checkStrictMode)(t,e,t.opts.strictTypes)}var LE=class{constructor(e,r,n){if((0,qg.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Go.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",oce(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,qg.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",pe.default.errors))}result(e,r,n){this.failResult((0,oe.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,oe.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,oe._)`${r} !== undefined && (${(0,oe.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Ug.reportExtraError:Ug.reportError)(this,this.def.error,r)}$dataError(){(0,Ug.reportError)(this,this.def.$dataError||Ug.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ug.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=oe.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=oe.nil,r=oe.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:o,def:s}=this;n.if((0,oe.or)((0,oe._)`${i} === undefined`,r)),e!==oe.nil&&n.assign(e,!0),(o.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==oe.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:o}=this;return(0,oe.or)(s(),a());function s(){if(n.length){if(!(r instanceof oe.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,oe._)`${(0,FE.checkDataTypes)(c,r,o.opts.strictNumbers,FE.DataType.Wrong)}`}return oe.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,oe._)`!${c}(${r})`}return oe.nil}}subschema(e,r){let n=(0,pU.getSubschema)(this.it,e);(0,pU.extendSubschemaData)(n,this.it,e),(0,pU.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return D9e(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Go.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Go.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,oe.Name)),!0}};ia.KeywordCxt=LE;function ice(t,e,r,n){let i=new LE(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,qg.funcKeywordCode)(i,r):"macro"in r?(0,qg.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,qg.funcKeywordCode)(i,r)}var W9e=/^\/(?:[^~]|~0|~1)*$/,K9e=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function oce(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,o;if(t==="")return pe.default.rootData;if(t[0]==="/"){if(!W9e.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,o=pe.default.rootData}else{let l=K9e.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=e)throw new Error(c("property/index",u));return n[e-u]}if(u>e)throw new Error(c("data",u));if(o=r[e-u],!i)return o}let s=o,a=i.split("/");for(let l of a)l&&(o=(0,oe._)`${o}${(0,oe.getProperty)((0,Go.unescapeJsonPointer)(l))}`,s=(0,oe._)`${s} && ${o}`);return s;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}ia.getData=oce});var zE=v(yU=>{"use strict";Object.defineProperty(yU,"__esModule",{value:!0});var gU=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};yU.default=gU});var Hg=v(vU=>{"use strict";Object.defineProperty(vU,"__esModule",{value:!0});var _U=zg(),bU=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,_U.resolveUrl)(e,r,n),this.missingSchema=(0,_U.normalizeId)((0,_U.getFullPath)(e,this.missingRef))}};vU.default=bU});var qE=v(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.resolveSchema=Gn.getCompilingSchema=Gn.resolveRef=Gn.compileSchema=Gn.SchemaEnv=void 0;var _i=we(),J9e=zE(),qc=Ho(),bi=zg(),sce=Ne(),Y9e=Bg(),qd=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,bi.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Gn.SchemaEnv=qd;function wU(t){let e=ace.call(this,t);if(e)return e;let r=(0,bi.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,s=new _i.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o}),a;t.$async&&(a=s.scopeValue("Error",{ref:J9e.default,code:(0,_i._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");t.validateName=c;let l={gen:s,allErrors:this.opts.allErrors,data:qc.default.data,parentData:qc.default.parentData,parentDataProperty:qc.default.parentDataProperty,dataNames:[qc.default.data],dataPathArr:[_i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,_i.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:_i.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,_i._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,Y9e.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();u=`${s.scopeRefs(qc.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let p=new Function(`${qc.default.self}`,`${qc.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:m,items:h}=l;p.evaluated={props:m instanceof _i.Name?void 0:m,items:h instanceof _i.Name?void 0:h,dynamicProps:m instanceof _i.Name,dynamicItems:h instanceof _i.Name},p.source&&(p.source.evaluated=(0,_i.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}Gn.compileSchema=wU;function X9e(t,e,r){var n;r=(0,bi.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let o=tVe.call(this,t,r);if(o===void 0){let s=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(o=new qd({schema:s,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=Q9e.call(this,o)}Gn.resolveRef=X9e;function Q9e(t){return(0,bi.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:wU.call(this,t)}function ace(t){for(let e of this._compilations)if(eVe(e,t))return e}Gn.getCompilingSchema=ace;function eVe(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function tVe(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||UE.call(this,t,e)}function UE(t,e){let r=this.opts.uriResolver.parse(e),n=(0,bi._getFullPath)(this.opts.uriResolver,r),i=(0,bi.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return SU.call(this,r,t);let o=(0,bi.normalizeId)(n),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let a=UE.call(this,t,s);return typeof a?.schema!="object"?void 0:SU.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||wU.call(this,s),o===(0,bi.normalizeId)(e)){let{schema:a}=s,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,bi.resolveUrl)(this.opts.uriResolver,i,l)),new qd({schema:a,schemaId:c,root:t,baseId:i})}return SU.call(this,r,s)}}Gn.resolveSchema=UE;var rVe=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function SU(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,sce.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!rVe.has(a)&&l&&(e=(0,bi.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,sce.schemaHasRulesButRef)(r,this.RULES)){let a=(0,bi.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=UE.call(this,n,a)}let{schemaId:s}=this.opts;if(o=o||new qd({schema:r,schemaId:s,root:n,baseId:e}),o.schema!==o.root.schema)return o}});var cce=v((WOt,nVe)=>{nVe.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var kU=v((KOt,mce)=>{"use strict";var iVe=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),uce=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),xU=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),dce=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),oVe=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function $U(t){let e="",r=0,n=0;for(n=0;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var sVe=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function lce(t){return t.length=0,!0}function aVe(t,e,r){if(t.length){let n=$U(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function cVe(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],o=!1,s=!1,a=aVe;for(let c=0;c7){r.error=!0;break}c>0&&t[c-1]===":"&&(o=!0),n.push(":");continue}else if(l==="%"){if(!a(i,n,r))break;a=lce}else{i.push(l);continue}}return i.length&&(a===lce?r.zone=i.join(""):s?n.push(i.join("")):n.push($U(i))),r.address=n.join(""),r}function fce(t){if(lVe(t,":")<2)return{host:t,isIPV6:!1};let e=cVe(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function lVe(t,e){let r=0;for(let n=0;ndVe[n])}function mVe(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";var{isUUID:_Ve}=kU(),bVe=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,vVe=["http","https","ws","wss","urn","urn:uuid"];function SVe(t){return vVe.indexOf(t)!==-1}function EU(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function hce(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function gce(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function wVe(t){return t.secure=EU(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function xVe(t){if((t.port===(EU(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function $Ve(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(bVe);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,o=AU(i);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function kVe(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,o=AU(i);o&&(t=o.serialize(t,e));let s=t,a=t.nss;return s.path=`${n||e.nid}:${a}`,e.skipEscape=!0,s}function EVe(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!_Ve(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function AVe(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var yce={scheme:"http",domainHost:!0,parse:hce,serialize:gce},TVe={scheme:"https",domainHost:yce.domainHost,parse:hce,serialize:gce},BE={scheme:"ws",domainHost:!0,parse:wVe,serialize:xVe},OVe={scheme:"wss",domainHost:BE.domainHost,parse:BE.parse,serialize:BE.serialize},RVe={scheme:"urn",parse:$Ve,serialize:kVe,skipNormalize:!0},IVe={scheme:"urn:uuid",parse:EVe,serialize:AVe,skipNormalize:!0},HE={http:yce,https:TVe,ws:BE,wss:OVe,urn:RVe,"urn:uuid":IVe};Object.setPrototypeOf(HE,null);function AU(t){return t&&(HE[t]||HE[t.toLowerCase()])||void 0}_ce.exports={wsIsSecure:EU,SCHEMES:HE,isValidSchemeName:SVe,getSchemeHandler:AU}});var kce=v((YOt,GE)=>{"use strict";var{normalizeIPv6:PVe,removeDotSegments:Gg,recomposeAuthority:CVe,normalizePercentEncoding:DVe,normalizePathEncoding:NVe,escapePreservingEscapes:jVe,reescapeHostDelimiters:MVe,isIPv4:FVe,nonSimpleDomain:LVe}=kU(),{SCHEMES:zVe,getSchemeHandler:Sce}=bce();function UVe(t,e){return typeof t=="string"?t=ZVe(t,e):typeof t=="object"&&(t=Bd(Bc(t,e),e)),t}function qVe(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=wce(Bd(t,n),Bd(e,n),n,!0);return n.skipEscape=!0,Bc(i,n)}function wce(t,e,r,n){let i={};return n||(t=Bd(Bc(t,r),r),e=Bd(Bc(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Gg(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Gg(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Gg(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=Gg(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function BVe(t,e,r){let n=vce(t,r),i=vce(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function Bc(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],o=Sce(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=DVe(r.path):(r.path=jVe(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let s=CVe(r);if(s!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(s),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(a=Gg(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var HVe=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function GVe(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function xce(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,o=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(HVe);if(s){n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]);let a=GVe(n,s);if(a!==void 0&&(n.error=n.error||a,i=!0),n.host)if(FVe(n.host)===!1){let u=PVe(n.host);n.host=u.host.toLowerCase(),o=u.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=Sce(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&o===!1&&LVe(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(l){n.error=n.error||"Host's domain name can not be converted to ASCII: "+l}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=MVe(unescape(n.host),o))),n.path&&(n.path=NVe(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function Bd(t,e){return xce(t,e).parsed}function ZVe(t,e){return $ce(t,e).normalized}function $ce(t,e){let{parsed:r,malformedAuthorityOrPort:n}=xce(t,e);return{normalized:n?t:Bc(r,e),malformedAuthorityOrPort:n}}function vce(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=$ce(t,e);return n?void 0:r}if(typeof t=="object")return Bc(t,e)}var TU={SCHEMES:zVe,normalize:UVe,resolve:qVe,resolveComponent:wce,equal:BVe,serialize:Bc,parse:Bd};GE.exports=TU;GE.exports.default=TU;GE.exports.fastUri=TU});var Ace=v(OU=>{"use strict";Object.defineProperty(OU,"__esModule",{value:!0});var Ece=kce();Ece.code='require("ajv/dist/runtime/uri").default';OU.default=Ece});var Nce=v(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.CodeGen=lr.Name=lr.nil=lr.stringify=lr.str=lr._=lr.KeywordCxt=void 0;var VVe=Bg();Object.defineProperty(lr,"KeywordCxt",{enumerable:!0,get:function(){return VVe.KeywordCxt}});var Hd=we();Object.defineProperty(lr,"_",{enumerable:!0,get:function(){return Hd._}});Object.defineProperty(lr,"str",{enumerable:!0,get:function(){return Hd.str}});Object.defineProperty(lr,"stringify",{enumerable:!0,get:function(){return Hd.stringify}});Object.defineProperty(lr,"nil",{enumerable:!0,get:function(){return Hd.nil}});Object.defineProperty(lr,"Name",{enumerable:!0,get:function(){return Hd.Name}});Object.defineProperty(lr,"CodeGen",{enumerable:!0,get:function(){return Hd.CodeGen}});var WVe=zE(),Pce=Hg(),KVe=nU(),Zg=qE(),JVe=we(),Vg=zg(),ZE=Lg(),IU=Ne(),Tce=cce(),YVe=Ace(),Cce=(t,e)=>new RegExp(t,e);Cce.code="new RegExp";var XVe=["removeAdditional","useDefaults","coerceTypes"],QVe=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),eWe={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},tWe={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Oce=200;function rWe(t){var e,r,n,i,o,s,a,c,l,u,d,f,p,m,h,g,b,_,S,x,w,O,T,A,D;let $=t.strict,ie=(e=t.code)===null||e===void 0?void 0:e.optimize,K=ie===!0||ie===void 0?1:ie||0,xe=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Cce,C=(i=t.uriResolver)!==null&&i!==void 0?i:YVe.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:$)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:$)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:$)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:$)!==null&&f!==void 0?f:"log",strictRequired:(m=(p=t.strictRequired)!==null&&p!==void 0?p:$)!==null&&m!==void 0?m:!1,code:t.code?{...t.code,optimize:K,regExp:xe}:{optimize:K,regExp:xe},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Oce,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Oce,meta:(b=t.meta)!==null&&b!==void 0?b:!0,messages:(_=t.messages)!==null&&_!==void 0?_:!0,inlineRefs:(S=t.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(x=t.schemaId)!==null&&x!==void 0?x:"$id",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(O=t.validateSchema)!==null&&O!==void 0?O:!0,validateFormats:(T=t.validateFormats)!==null&&T!==void 0?T:!0,unicodeRegExp:(A=t.unicodeRegExp)!==null&&A!==void 0?A:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:C}}var Wg=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...rWe(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new JVe.ValueScope({scope:{},prefixes:QVe,es5:r,lines:n}),this.logger=cWe(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,KVe.getRules)(),Rce.call(this,eWe,e,"NOT SUPPORTED"),Rce.call(this,tWe,e,"DEPRECATED","warn"),this._metaOpts=sWe.call(this),e.formats&&iWe.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&oWe.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),nWe.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=Tce;n==="id"&&(i={...Tce},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,d){await o.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||s.call(this,f)}async function o(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function s(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof Pce.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,n,i);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return r=(0,Vg.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return i}getSchema(e){let r;for(;typeof(r=Ice.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Zg.SchemaEnv({schema:{},schemaId:n});if(r=Zg.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Ice.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,Vg.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(uWe.call(this,n,r),!r)return(0,IU.eachItem)(n,o=>RU.call(this,o)),this;fWe.call(this,r);let i={...r,type:(0,ZE.getJSONTypes)(r.type),schemaType:(0,ZE.getJSONTypes)(r.schemaType)};return(0,IU.eachItem)(n,i.type.length===0?o=>RU.call(this,o,i):o=>i.type.forEach(s=>RU.call(this,o,i,s))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(o=>o.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,o)=>i+r+o)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let o=i.split("/").slice(1),s=e;for(let a of o)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=s[a];l&&u&&(s[a]=Dce(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof e=="object")s=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,Vg.normalizeId)(s||n);let l=Vg.getSchemaRefs.call(this,e,n);return c=new Zg.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Zg.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Zg.compileSchema.call(this,e)}finally{this.opts=r}}};Wg.ValidationError=WVe.default;Wg.MissingRefError=Pce.default;lr.default=Wg;function Rce(t,e,r,n="error"){for(let i in t){let o=i;o in e&&this.logger[n](`${r}: option ${i}. ${t[o]}`)}}function Ice(t){return t=(0,Vg.normalizeId)(t),this.schemas[t]||this.refs[t]}function nWe(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function iWe(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function oWe(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function sWe(){let t={...this.opts};for(let e of XVe)delete t[e];return t}var aWe={log(){},warn(){},error(){}};function cWe(t){if(t===!1)return aWe;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var lWe=/^[a-z_$][a-z0-9_$:-]*$/i;function uWe(t,e){let{RULES:r}=this;if((0,IU.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!lWe.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function RU(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=i?o.post:o.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,ZE.getJSONTypes)(e.type),schemaType:(0,ZE.getJSONTypes)(e.schemaType)}};e.before?dWe.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function dWe(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function fWe(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Dce(e)),t.validateSchema=this.compile(e,!0))}var pWe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Dce(t){return{anyOf:[t,pWe]}}});var jce=v(PU=>{"use strict";Object.defineProperty(PU,"__esModule",{value:!0});var mWe={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};PU.default=mWe});var zce=v(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.callRef=Hc.getValidate=void 0;var hWe=Hg(),Mce=Hn(),Jr=we(),Gd=Ho(),Fce=qE(),VE=Ne(),gWe={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:o,validateName:s,opts:a,self:c}=n,{root:l}=o;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=Fce.resolveRef.call(c,l,i,r);if(u===void 0)throw new hWe.default(n.opts.uriResolver,i,r);if(u instanceof Fce.SchemaEnv)return f(u);return p(u);function d(){if(o===l)return WE(t,s,o,o.$async);let m=e.scopeValue("root",{ref:l});return WE(t,(0,Jr._)`${m}.validate`,l,l.$async)}function f(m){let h=Lce(t,m);WE(t,h,m,m.$async)}function p(m){let h=e.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,Jr.stringify)(m)}:{ref:m}),g=e.name("valid"),b=t.subschema({schema:m,dataTypes:[],schemaPath:Jr.nil,topSchemaRef:h,errSchemaPath:r},g);t.mergeEvaluated(b),t.ok(g)}}};function Lce(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Jr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Hc.getValidate=Lce;function WE(t,e,r,n){let{gen:i,it:o}=t,{allErrors:s,schemaEnv:a,opts:c}=o,l=c.passContext?Gd.default.this:Jr.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=i.let("valid");i.try(()=>{i.code((0,Jr._)`await ${(0,Mce.callValidateCode)(t,e,l)}`),p(e),s||i.assign(m,!0)},h=>{i.if((0,Jr._)`!(${h} instanceof ${o.ValidationError})`,()=>i.throw(h)),f(h),s||i.assign(m,!1)}),t.ok(m)}function d(){t.result((0,Mce.callValidateCode)(t,e,l),()=>p(e),()=>f(e))}function f(m){let h=(0,Jr._)`${m}.errors`;i.assign(Gd.default.vErrors,(0,Jr._)`${Gd.default.vErrors} === null ? ${h} : ${Gd.default.vErrors}.concat(${h})`),i.assign(Gd.default.errors,(0,Jr._)`${Gd.default.vErrors}.length`)}function p(m){var h;if(!o.opts.unevaluated)return;let g=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(o.props=VE.mergeEvaluated.props(i,g.props,o.props));else{let b=i.var("props",(0,Jr._)`${m}.evaluated.props`);o.props=VE.mergeEvaluated.props(i,b,o.props,Jr.Name)}if(o.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(o.items=VE.mergeEvaluated.items(i,g.items,o.items));else{let b=i.var("items",(0,Jr._)`${m}.evaluated.items`);o.items=VE.mergeEvaluated.items(i,b,o.items,Jr.Name)}}}Hc.callRef=WE;Hc.default=gWe});var Uce=v(CU=>{"use strict";Object.defineProperty(CU,"__esModule",{value:!0});var yWe=jce(),_We=zce(),bWe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",yWe.default,_We.default];CU.default=bWe});var qce=v(DU=>{"use strict";Object.defineProperty(DU,"__esModule",{value:!0});var KE=we(),oa=KE.operators,JE={maximum:{okStr:"<=",ok:oa.LTE,fail:oa.GT},minimum:{okStr:">=",ok:oa.GTE,fail:oa.LT},exclusiveMaximum:{okStr:"<",ok:oa.LT,fail:oa.GTE},exclusiveMinimum:{okStr:">",ok:oa.GT,fail:oa.LTE}},vWe={message:({keyword:t,schemaCode:e})=>(0,KE.str)`must be ${JE[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,KE._)`{comparison: ${JE[t].okStr}, limit: ${e}}`},SWe={keyword:Object.keys(JE),type:"number",schemaType:"number",$data:!0,error:vWe,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,KE._)`${r} ${JE[e].fail} ${n} || isNaN(${r})`)}};DU.default=SWe});var Bce=v(NU=>{"use strict";Object.defineProperty(NU,"__esModule",{value:!0});var Kg=we(),wWe={message:({schemaCode:t})=>(0,Kg.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Kg._)`{multipleOf: ${t}}`},xWe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:wWe,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,Kg._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,Kg._)`${s} !== parseInt(${s})`;t.fail$data((0,Kg._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};NU.default=xWe});var Gce=v(jU=>{"use strict";Object.defineProperty(jU,"__esModule",{value:!0});function Hce(t){let e=t.length,r=0,n=0,i;for(;n=55296&&i<=56319&&n{"use strict";Object.defineProperty(MU,"__esModule",{value:!0});var Gc=we(),$We=Ne(),kWe=Gce(),EWe={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Gc.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Gc._)`{limit: ${t}}`},AWe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:EWe,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,o=e==="maxLength"?Gc.operators.GT:Gc.operators.LT,s=i.opts.unicode===!1?(0,Gc._)`${r}.length`:(0,Gc._)`${(0,$We.useFunc)(t.gen,kWe.default)}(${r})`;t.fail$data((0,Gc._)`${s} ${o} ${n}`)}};MU.default=AWe});var Vce=v(FU=>{"use strict";Object.defineProperty(FU,"__esModule",{value:!0});var TWe=Hn(),OWe=Ne(),Zd=we(),RWe={message:({schemaCode:t})=>(0,Zd.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Zd._)`{pattern: ${t}}`},IWe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:RWe,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t,a=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=s.opts.code,l=c.code==="new RegExp"?(0,Zd._)`new RegExp`:(0,OWe.useFunc)(e,c),u=e.let("valid");e.try(()=>e.assign(u,(0,Zd._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Zd._)`!${u}`)}else{let c=(0,TWe.usePattern)(t,i);t.fail$data((0,Zd._)`!${c}.test(${r})`)}}};FU.default=IWe});var Wce=v(LU=>{"use strict";Object.defineProperty(LU,"__esModule",{value:!0});var Jg=we(),PWe={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Jg.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Jg._)`{limit: ${t}}`},CWe={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:PWe,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Jg.operators.GT:Jg.operators.LT;t.fail$data((0,Jg._)`Object.keys(${r}).length ${i} ${n}`)}};LU.default=CWe});var Kce=v(zU=>{"use strict";Object.defineProperty(zU,"__esModule",{value:!0});var Yg=Hn(),Xg=we(),DWe=Ne(),NWe={message:({params:{missingProperty:t}})=>(0,Xg.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Xg._)`{missingProperty: ${t}}`},jWe={keyword:"required",type:"object",schemaType:"array",$data:!0,error:NWe,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:o,it:s}=t,{opts:a}=s;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?l():u(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:m}=t.it;for(let h of r)if(p?.[h]===void 0&&!m.has(h)){let g=s.schemaEnv.baseId+s.errSchemaPath,b=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,DWe.checkStrictMode)(s,b,s.opts.strictRequired)}}function l(){if(c||o)t.block$data(Xg.nil,d);else for(let p of r)(0,Yg.checkReportMissingProp)(t,p)}function u(){let p=e.let("missing");if(c||o){let m=e.let("valid",!0);t.block$data(m,()=>f(p,m)),t.ok(m)}else e.if((0,Yg.checkMissingProp)(t,r,p)),(0,Yg.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,Yg.noPropertyInData)(e,i,p,a.ownProperties),()=>t.error())})}function f(p,m){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(m,(0,Yg.propertyInData)(e,i,p,a.ownProperties)),e.if((0,Xg.not)(m),()=>{t.error(),e.break()})},Xg.nil)}}};zU.default=jWe});var Jce=v(UU=>{"use strict";Object.defineProperty(UU,"__esModule",{value:!0});var Qg=we(),MWe={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Qg.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Qg._)`{limit: ${t}}`},FWe={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:MWe,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Qg.operators.GT:Qg.operators.LT;t.fail$data((0,Qg._)`${r}.length ${i} ${n}`)}};UU.default=FWe});var YE=v(qU=>{"use strict";Object.defineProperty(qU,"__esModule",{value:!0});var Yce=dU();Yce.code='require("ajv/dist/runtime/equal").default';qU.default=Yce});var Xce=v(HU=>{"use strict";Object.defineProperty(HU,"__esModule",{value:!0});var BU=Lg(),ur=we(),LWe=Ne(),zWe=YE(),UWe={message:({params:{i:t,j:e}})=>(0,ur.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,ur._)`{i: ${t}, j: ${e}}`},qWe={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:UWe,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:o,schemaCode:s,it:a}=t;if(!n&&!i)return;let c=e.let("valid"),l=o.items?(0,BU.getSchemaTypes)(o.items):[];t.block$data(c,u,(0,ur._)`${s} === false`),t.ok(c);function u(){let m=e.let("i",(0,ur._)`${r}.length`),h=e.let("j");t.setParams({i:m,j:h}),e.assign(c,!0),e.if((0,ur._)`${m} > 1`,()=>(d()?f:p)(m,h))}function d(){return l.length>0&&!l.some(m=>m==="object"||m==="array")}function f(m,h){let g=e.name("item"),b=(0,BU.checkDataTypes)(l,g,a.opts.strictNumbers,BU.DataType.Wrong),_=e.const("indices",(0,ur._)`{}`);e.for((0,ur._)`;${m}--;`,()=>{e.let(g,(0,ur._)`${r}[${m}]`),e.if(b,(0,ur._)`continue`),l.length>1&&e.if((0,ur._)`typeof ${g} == "string"`,(0,ur._)`${g} += "_"`),e.if((0,ur._)`typeof ${_}[${g}] == "number"`,()=>{e.assign(h,(0,ur._)`${_}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,ur._)`${_}[${g}] = ${m}`)})}function p(m,h){let g=(0,LWe.useFunc)(e,zWe.default),b=e.name("outer");e.label(b).for((0,ur._)`;${m}--;`,()=>e.for((0,ur._)`${h} = ${m}; ${h}--;`,()=>e.if((0,ur._)`${g}(${r}[${m}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(b)})))}}};HU.default=qWe});var Qce=v(ZU=>{"use strict";Object.defineProperty(ZU,"__esModule",{value:!0});var GU=we(),BWe=Ne(),HWe=YE(),GWe={message:"must be equal to constant",params:({schemaCode:t})=>(0,GU._)`{allowedValue: ${t}}`},ZWe={keyword:"const",$data:!0,error:GWe,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:o}=t;n||o&&typeof o=="object"?t.fail$data((0,GU._)`!${(0,BWe.useFunc)(e,HWe.default)}(${r}, ${i})`):t.fail((0,GU._)`${o} !== ${r}`)}};ZU.default=ZWe});var ele=v(VU=>{"use strict";Object.defineProperty(VU,"__esModule",{value:!0});var ey=we(),VWe=Ne(),WWe=YE(),KWe={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,ey._)`{allowedValues: ${t}}`},JWe={keyword:"enum",schemaType:"array",$data:!0,error:KWe,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=s.opts.loopEnum,c,l=()=>c??(c=(0,VWe.useFunc)(e,WWe.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",o);u=(0,ey.or)(...i.map((m,h)=>f(p,h)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",o,p=>e.if((0,ey._)`${l()}(${r}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,m){let h=i[m];return typeof h=="object"&&h!==null?(0,ey._)`${l()}(${r}, ${p}[${m}])`:(0,ey._)`${r} === ${h}`}}};VU.default=JWe});var tle=v(WU=>{"use strict";Object.defineProperty(WU,"__esModule",{value:!0});var YWe=qce(),XWe=Bce(),QWe=Zce(),e3e=Vce(),t3e=Wce(),r3e=Kce(),n3e=Jce(),i3e=Xce(),o3e=Qce(),s3e=ele(),a3e=[YWe.default,XWe.default,QWe.default,e3e.default,t3e.default,r3e.default,n3e.default,i3e.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},o3e.default,s3e.default];WU.default=a3e});var JU=v(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.validateAdditionalItems=void 0;var Zc=we(),KU=Ne(),c3e={message:({params:{len:t}})=>(0,Zc.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Zc._)`{limit: ${t}}`},l3e={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:c3e,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,KU.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}rle(t,n)}};function rle(t,e){let{gen:r,schema:n,data:i,keyword:o,it:s}=t;s.items=!0;let a=r.const("len",(0,Zc._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Zc._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,KU.alwaysValidSchema)(s,n)){let l=r.var("valid",(0,Zc._)`${a} <= ${e.length}`);r.if((0,Zc.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:KU.Type.Num},l),s.allErrors||r.if((0,Zc.not)(l),()=>r.break())})}}ty.validateAdditionalItems=rle;ty.default=l3e});var YU=v(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.validateTuple=void 0;var nle=we(),XE=Ne(),u3e=Hn(),d3e={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return ile(t,"additionalItems",e);r.items=!0,!(0,XE.alwaysValidSchema)(r,e)&&t.ok((0,u3e.validateArray)(t))}};function ile(t,e,r=t.schema){let{gen:n,parentSchema:i,data:o,keyword:s,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=XE.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,nle._)`${o}.length`);r.forEach((d,f)=>{(0,XE.alwaysValidSchema)(a,d)||(n.if((0,nle._)`${l} > ${f}`,()=>t.subschema({keyword:s,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,m=r.length,h=m===d.minItems&&(m===d.maxItems||d[e]===!1);if(f.strictTuples&&!h){let g=`"${s}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,XE.checkStrictMode)(a,g,f.strictTuples)}}}ry.validateTuple=ile;ry.default=d3e});var ole=v(XU=>{"use strict";Object.defineProperty(XU,"__esModule",{value:!0});var f3e=YU(),p3e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,f3e.validateTuple)(t,"items")};XU.default=p3e});var ale=v(QU=>{"use strict";Object.defineProperty(QU,"__esModule",{value:!0});var sle=we(),m3e=Ne(),h3e=Hn(),g3e=JU(),y3e={message:({params:{len:t}})=>(0,sle.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,sle._)`{limit: ${t}}`},_3e={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:y3e,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,m3e.alwaysValidSchema)(n,e)&&(i?(0,g3e.validateAdditionalItems)(t,i):t.ok((0,h3e.validateArray)(t)))}};QU.default=_3e});var cle=v(eq=>{"use strict";Object.defineProperty(eq,"__esModule",{value:!0});var Zn=we(),QE=Ne(),b3e={message:({params:{min:t,max:e}})=>e===void 0?(0,Zn.str)`must contain at least ${t} valid item(s)`:(0,Zn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Zn._)`{minContains: ${t}}`:(0,Zn._)`{minContains: ${t}, maxContains: ${e}}`},v3e={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:b3e,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t,s,a,{minContains:c,maxContains:l}=n;o.opts.next?(s=c===void 0?1:c,a=l):s=1;let u=e.const("len",(0,Zn._)`${i}.length`);if(t.setParams({min:s,max:a}),a===void 0&&s===0){(0,QE.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,QE.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,QE.alwaysValidSchema)(o,r)){let h=(0,Zn._)`${u} >= ${s}`;a!==void 0&&(h=(0,Zn._)`${h} && ${u} <= ${a}`),t.pass(h);return}o.items=!0;let d=e.name("valid");a===void 0&&s===1?p(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),a!==void 0&&e.if((0,Zn._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let h=e.name("_valid"),g=e.let("count",0);p(h,()=>e.if(h,()=>m(g)))}function p(h,g){e.forRange("i",0,u,b=>{t.subschema({keyword:"contains",dataProp:b,dataPropType:QE.Type.Num,compositeRule:!0},h),g()})}function m(h){e.code((0,Zn._)`${h}++`),a===void 0?e.if((0,Zn._)`${h} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,Zn._)`${h} > ${a}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,Zn._)`${h} >= ${s}`,()=>e.assign(d,!0)))}}};eq.default=v3e});var dle=v(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.validateSchemaDeps=io.validatePropertyDeps=io.error=void 0;var tq=we(),S3e=Ne(),ny=Hn();io.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,tq.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,tq._)`{property: ${t}, + || ${s} === "boolean" || ${i} === null`).assign(a,(0,Se._)`[${i}]`)}}}function BZe({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Se._)`${e} !== undefined`,()=>t.assign((0,Se._)`${e}[${r}]`,n))}function oU(t,e,r,n=Ld.Correct){let i=n===Ld.Correct?Se.operators.EQ:Se.operators.NEQ,o;switch(t){case"null":return(0,Se._)`${e} ${i} null`;case"array":o=(0,Se._)`Array.isArray(${e})`;break;case"object":o=(0,Se._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,Se._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,Se._)`typeof ${e} ${i} ${t}`}return n===Ld.Correct?o:(0,Se.not)(o);function s(a=Se.nil){return(0,Se.and)((0,Se._)`typeof ${e} == "number"`,a,r?(0,Se._)`isFinite(${e})`:Se.nil)}}_r.checkDataType=oU;function sU(t,e,r,n){if(t.length===1)return oU(t[0],e,r,n);let i,o=(0,Tae.toHash)(t);if(o.array&&o.object){let s=(0,Se._)`typeof ${e} != "object"`;i=o.null?s:(0,Se._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else i=Se.nil;o.number&&delete o.integer;for(let s in o)i=(0,Se.and)(i,oU(s,e,r,n));return i}_r.checkDataTypes=sU;var HZe={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Se._)`{type: ${t}}`:(0,Se._)`{type: ${e}}`};function aU(t){let e=GZe(t);(0,FZe.reportError)(e,HZe)}_r.reportTypeError=aU;function GZe(t){let{gen:e,data:r,schema:n}=t,i=(0,Tae.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var Pae=v(jE=>{"use strict";Object.defineProperty(jE,"__esModule",{value:!0});jE.assignDefaults=void 0;var zd=we(),ZZe=Ne();function VZe(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)Iae(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,o)=>Iae(t,o,i.default))}jE.assignDefaults=VZe;function Iae(t,e,r){let{gen:n,compositeRule:i,data:o,opts:s}=t;if(r===void 0)return;let a=(0,zd._)`${o}${(0,zd.getProperty)(e)}`;if(i){(0,ZZe.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,zd._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,zd._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,zd._)`${a} = ${(0,zd.stringify)(r)}`)}});var Hn=v(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.validateUnion=nt.validateArray=nt.usePattern=nt.callValidateCode=nt.schemaProperties=nt.allSchemaProperties=nt.noPropertyInData=nt.propertyInData=nt.isOwnProperty=nt.hasPropFunc=nt.reportMissingProp=nt.checkMissingProp=nt.checkReportMissingProp=void 0;var ft=we(),cU=Ne(),ta=Ho(),WZe=Ne();function KZe(t,e){let{gen:r,data:n,it:i}=t;r.if(uU(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ft._)`${e}`},!0),t.error()})}nt.checkReportMissingProp=KZe;function JZe({gen:t,data:e,it:{opts:r}},n,i){return(0,ft.or)(...n.map(o=>(0,ft.and)(uU(t,e,o,r.ownProperties),(0,ft._)`${i} = ${o}`)))}nt.checkMissingProp=JZe;function YZe(t,e){t.setParams({missingProperty:e},!0),t.error()}nt.reportMissingProp=YZe;function Cae(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ft._)`Object.prototype.hasOwnProperty`})}nt.hasPropFunc=Cae;function lU(t,e,r){return(0,ft._)`${Cae(t)}.call(${e}, ${r})`}nt.isOwnProperty=lU;function XZe(t,e,r,n){let i=(0,ft._)`${e}${(0,ft.getProperty)(r)} !== undefined`;return n?(0,ft._)`${i} && ${lU(t,e,r)}`:i}nt.propertyInData=XZe;function uU(t,e,r,n){let i=(0,ft._)`${e}${(0,ft.getProperty)(r)} === undefined`;return n?(0,ft.or)(i,(0,ft.not)(lU(t,e,r))):i}nt.noPropertyInData=uU;function Dae(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}nt.allSchemaProperties=Dae;function QZe(t,e){return Dae(e).filter(r=>!(0,cU.alwaysValidSchema)(t,e[r]))}nt.schemaProperties=QZe;function e9e({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:s},a,c,l){let u=l?(0,ft._)`${t}, ${e}, ${n}${i}`:e,d=[[ta.default.instancePath,(0,ft.strConcat)(ta.default.instancePath,o)],[ta.default.parentData,s.parentData],[ta.default.parentDataProperty,s.parentDataProperty],[ta.default.rootData,ta.default.rootData]];s.opts.dynamicRef&&d.push([ta.default.dynamicAnchors,ta.default.dynamicAnchors]);let f=(0,ft._)`${u}, ${r.object(...d)}`;return c!==ft.nil?(0,ft._)`${a}.call(${c}, ${f})`:(0,ft._)`${a}(${f})`}nt.callValidateCode=e9e;var t9e=(0,ft._)`new RegExp`;function r9e({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,o=i(r,n);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,ft._)`${i.code==="new RegExp"?t9e:(0,WZe.useFunc)(t,i)}(${r}, ${n})`})}nt.usePattern=r9e;function n9e(t){let{gen:e,data:r,keyword:n,it:i}=t,o=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){let c=e.const("len",(0,ft._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:cU.Type.Num},o),e.if((0,ft.not)(o),a)})}}nt.validateArray=n9e;function i9e(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,cU.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let s=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(s,(0,ft._)`${s} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,ft.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}nt.validateUnion=i9e});var Mae=v(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.validateKeywordUsage=ro.validSchemaType=ro.funcKeywordCode=ro.macroKeywordCode=void 0;var Rr=we(),Uc=Ho(),o9e=Hn(),s9e=Fg();function a9e(t,e){let{gen:r,keyword:n,schema:i,parentSchema:o,it:s}=t,a=e.macro.call(s.self,i,o,s),c=jae(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:Rr.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}ro.macroKeywordCode=a9e;function c9e(t,e){var r;let{gen:n,keyword:i,schema:o,parentSchema:s,$data:a,it:c}=t;u9e(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,s,c):e.validate,u=jae(n,i,l),d=n.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)h(),e.modifying&&Nae(t),g(()=>t.error());else{let b=e.async?p():m();e.modifying&&Nae(t),g(()=>l9e(t,b))}}function p(){let b=n.let("ruleErrs",null);return n.try(()=>h((0,Rr._)`await `),_=>n.assign(d,!1).if((0,Rr._)`${_} instanceof ${c.ValidationError}`,()=>n.assign(b,(0,Rr._)`${_}.errors`),()=>n.throw(_))),b}function m(){let b=(0,Rr._)`${u}.errors`;return n.assign(b,null),h(Rr.nil),b}function h(b=e.async?(0,Rr._)`await `:Rr.nil){let _=c.opts.passContext?Uc.default.this:Uc.default.self,S=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Rr._)`${b}${(0,o9e.callValidateCode)(t,u,_,S)}`,e.modifying)}function g(b){var _;n.if((0,Rr.not)((_=e.valid)!==null&&_!==void 0?_:d),b)}}ro.funcKeywordCode=c9e;function Nae(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Rr._)`${n.parentData}[${n.parentDataProperty}]`))}function l9e(t,e){let{gen:r}=t;r.if((0,Rr._)`Array.isArray(${e})`,()=>{r.assign(Uc.default.vErrors,(0,Rr._)`${Uc.default.vErrors} === null ? ${e} : ${Uc.default.vErrors}.concat(${e})`).assign(Uc.default.errors,(0,Rr._)`${Uc.default.vErrors}.length`),(0,s9e.extendErrors)(t)},()=>t.error())}function u9e({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function jae(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Rr.stringify)(r)})}function d9e(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}ro.validSchemaType=d9e;function f9e({schema:t,opts:e,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");let s=i.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}ro.validateKeywordUsage=f9e});var Lae=v(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.extendSubschemaMode=ra.extendSubschemaData=ra.getSubschema=void 0;var no=we(),Fae=Ne();function p9e(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,no._)`${t.schemaPath}${(0,no.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,no._)`${t.schemaPath}${(0,no.getProperty)(e)}${(0,no.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Fae.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}ra.getSubschema=p9e;function m9e(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:s}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,no._)`${e.data}${(0,no.getProperty)(r)}`,!0);c(f),t.errorPath=(0,no.str)`${l}${(0,Fae.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,no._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof no.Name?i:a.let("data",i,!0);c(l),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}ra.extendSubschemaData=m9e;function h9e(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}ra.extendSubschemaMode=h9e});var dU=v((UOt,zae)=>{"use strict";zae.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var s=o[i];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var qae=v((qOt,Uae)=>{"use strict";var na=Uae.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};ME(e,n,i,t,"",t)};na.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};na.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};na.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};na.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ME(t,e,r,n,i,o,s,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,o,s,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in na.arrayKeywords)for(var f=0;f{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.getSchemaRefs=Kr.resolveUrl=Kr.normalizeId=Kr._getFullPath=Kr.getFullPath=Kr.inlineRef=void 0;var y9e=Ne(),_9e=dU(),b9e=qae(),v9e=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function S9e(t,e=!0){return typeof t=="boolean"?!0:e===!0?!fU(t):e?Bae(t)<=e:!1}Kr.inlineRef=S9e;var w9e=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function fU(t){for(let e in t){if(w9e.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(fU)||typeof r=="object"&&fU(r))return!0}return!1}function Bae(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!v9e.has(r)&&(typeof t[r]=="object"&&(0,y9e.eachItem)(t[r],n=>e+=Bae(n)),e===1/0))return 1/0}return e}function Hae(t,e="",r){r!==!1&&(e=Ud(e));let n=t.parse(e);return Gae(t,n)}Kr.getFullPath=Hae;function Gae(t,e){return t.serialize(e).split("#")[0]+"#"}Kr._getFullPath=Gae;var x9e=/#\/?$/;function Ud(t){return t?t.replace(x9e,""):""}Kr.normalizeId=Ud;function $9e(t,e,r){return r=Ud(r),t.resolve(e,r)}Kr.resolveUrl=$9e;var k9e=/^[a-z_][-a-z0-9._]*$/i;function E9e(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Ud(t[r]||e),o={"":i},s=Hae(n,i,!1),a={},c=new Set;return b9e(t,{allKeys:!0},(d,f,p,m)=>{if(m===void 0)return;let h=s+f,g=o[m];typeof d[r]=="string"&&(g=b.call(this,d[r])),_.call(this,d.$anchor),_.call(this,d.$dynamicAnchor),o[f]=g;function b(S){let x=this.opts.uriResolver.resolve;if(S=Ud(g?x(g,S):S),c.has(S))throw u(S);c.add(S);let w=this.refs[S];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?l(d,w.schema,S):S!==Ud(h)&&(S[0]==="#"?(l(d,a[S],S),a[S]=d):this.refs[S]=h),S}function _(S){if(typeof S=="string"){if(!k9e.test(S))throw new Error(`invalid anchor "${S}"`);b.call(this,`#${S}`)}}}),a;function l(d,f,p){if(f!==void 0&&!_9e(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Kr.getSchemaRefs=E9e});var Bg=v(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.getData=ia.KeywordCxt=ia.validateFunctionCode=void 0;var Jae=kae(),Zae=Lg(),mU=iU(),FE=Lg(),A9e=Pae(),qg=Mae(),pU=Lae(),oe=we(),pe=Ho(),T9e=zg(),Go=Ne(),Ug=Fg();function O9e(t){if(Qae(t)&&(ece(t),Xae(t))){P9e(t);return}Yae(t,()=>(0,Jae.topBoolOrEmptySchema)(t))}ia.validateFunctionCode=O9e;function Yae({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},o){i.code.es5?t.func(e,(0,oe._)`${pe.default.data}, ${pe.default.valCxt}`,n.$async,()=>{t.code((0,oe._)`"use strict"; ${Vae(r,i)}`),I9e(t,i),t.code(o)}):t.func(e,(0,oe._)`${pe.default.data}, ${R9e(i)}`,n.$async,()=>t.code(Vae(r,i)).code(o))}function R9e(t){return(0,oe._)`{${pe.default.instancePath}="", ${pe.default.parentData}, ${pe.default.parentDataProperty}, ${pe.default.rootData}=${pe.default.data}${t.dynamicRef?(0,oe._)`, ${pe.default.dynamicAnchors}={}`:oe.nil}}={}`}function I9e(t,e){t.if(pe.default.valCxt,()=>{t.var(pe.default.instancePath,(0,oe._)`${pe.default.valCxt}.${pe.default.instancePath}`),t.var(pe.default.parentData,(0,oe._)`${pe.default.valCxt}.${pe.default.parentData}`),t.var(pe.default.parentDataProperty,(0,oe._)`${pe.default.valCxt}.${pe.default.parentDataProperty}`),t.var(pe.default.rootData,(0,oe._)`${pe.default.valCxt}.${pe.default.rootData}`),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,oe._)`${pe.default.valCxt}.${pe.default.dynamicAnchors}`)},()=>{t.var(pe.default.instancePath,(0,oe._)`""`),t.var(pe.default.parentData,(0,oe._)`undefined`),t.var(pe.default.parentDataProperty,(0,oe._)`undefined`),t.var(pe.default.rootData,pe.default.data),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,oe._)`{}`)})}function P9e(t){let{schema:e,opts:r,gen:n}=t;Yae(t,()=>{r.$comment&&e.$comment&&rce(t),M9e(t),n.let(pe.default.vErrors,null),n.let(pe.default.errors,0),r.unevaluated&&C9e(t),tce(t),z9e(t)})}function C9e(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,oe._)`${r}.evaluated`),e.if((0,oe._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,oe._)`${t.evaluated}.props`,(0,oe._)`undefined`)),e.if((0,oe._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,oe._)`${t.evaluated}.items`,(0,oe._)`undefined`))}function Vae(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,oe._)`/*# sourceURL=${r} */`:oe.nil}function D9e(t,e){if(Qae(t)&&(ece(t),Xae(t))){N9e(t,e);return}(0,Jae.boolOrEmptySchema)(t,e)}function Xae({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function Qae(t){return typeof t.schema!="boolean"}function N9e(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&rce(t),F9e(t),L9e(t);let o=n.const("_errs",pe.default.errors);tce(t,o),n.var(e,(0,oe._)`${o} === ${pe.default.errors}`)}function ece(t){(0,Go.checkUnknownRules)(t),j9e(t)}function tce(t,e){if(t.opts.jtd)return Wae(t,[],!1,e);let r=(0,Zae.getSchemaTypes)(t.schema),n=(0,Zae.coerceAndCheckDataType)(t,r);Wae(t,r,!n,e)}function j9e(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Go.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function M9e(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Go.checkStrictMode)(t,"default is ignored in the schema root")}function F9e(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,T9e.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function L9e(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function rce({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let o=r.$comment;if(i.$comment===!0)t.code((0,oe._)`${pe.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){let s=(0,oe.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,oe._)`${pe.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function z9e(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=t;r.$async?e.if((0,oe._)`${pe.default.errors} === 0`,()=>e.return(pe.default.data),()=>e.throw((0,oe._)`new ${i}(${pe.default.vErrors})`)):(e.assign((0,oe._)`${n}.errors`,pe.default.vErrors),o.unevaluated&&U9e(t),e.return((0,oe._)`${pe.default.errors} === 0`))}function U9e({gen:t,evaluated:e,props:r,items:n}){r instanceof oe.Name&&t.assign((0,oe._)`${e}.props`,r),n instanceof oe.Name&&t.assign((0,oe._)`${e}.items`,n)}function Wae(t,e,r,n){let{gen:i,schema:o,data:s,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,Go.schemaHasRulesButRef)(o,u))){i.block(()=>ice(t,"$ref",u.all.$ref.definition));return}c.jtd||q9e(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,mU.shouldUseGroup)(o,f)&&(f.type?(i.if((0,FE.checkDataType)(f.type,s,c.strictNumbers)),Kae(t,f),e.length===1&&e[0]===f.type&&r&&(i.else(),(0,FE.reportTypeError)(t)),i.endIf()):Kae(t,f),a||i.if((0,oe._)`${pe.default.errors} === ${n||0}`))}}function Kae(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,A9e.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,mU.shouldUseRule)(n,o)&&ice(t,o.keyword,o.definition,e.type)})}function q9e(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(B9e(t,e),t.opts.allowUnionTypes||H9e(t,e),G9e(t,t.dataTypes))}function B9e(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{nce(t.dataTypes,r)||hU(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),V9e(t,e)}}function H9e(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&hU(t,"use allowUnionTypes to allow union type keyword")}function G9e(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,mU.shouldUseRule)(t.schema,i)){let{type:o}=i.definition;o.length&&!o.some(s=>Z9e(e,s))&&hU(t,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function Z9e(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function nce(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function V9e(t,e){let r=[];for(let n of t.dataTypes)nce(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function hU(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Go.checkStrictMode)(t,e,t.opts.strictTypes)}var LE=class{constructor(e,r,n){if((0,qg.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Go.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",oce(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,qg.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",pe.default.errors))}result(e,r,n){this.failResult((0,oe.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,oe.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,oe._)`${r} !== undefined && (${(0,oe.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Ug.reportExtraError:Ug.reportError)(this,this.def.error,r)}$dataError(){(0,Ug.reportError)(this,this.def.$dataError||Ug.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ug.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=oe.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=oe.nil,r=oe.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:o,def:s}=this;n.if((0,oe.or)((0,oe._)`${i} === undefined`,r)),e!==oe.nil&&n.assign(e,!0),(o.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==oe.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:o}=this;return(0,oe.or)(s(),a());function s(){if(n.length){if(!(r instanceof oe.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,oe._)`${(0,FE.checkDataTypes)(c,r,o.opts.strictNumbers,FE.DataType.Wrong)}`}return oe.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,oe._)`!${c}(${r})`}return oe.nil}}subschema(e,r){let n=(0,pU.getSubschema)(this.it,e);(0,pU.extendSubschemaData)(n,this.it,e),(0,pU.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return D9e(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Go.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Go.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,oe.Name)),!0}};ia.KeywordCxt=LE;function ice(t,e,r,n){let i=new LE(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,qg.funcKeywordCode)(i,r):"macro"in r?(0,qg.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,qg.funcKeywordCode)(i,r)}var W9e=/^\/(?:[^~]|~0|~1)*$/,K9e=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function oce(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,o;if(t==="")return pe.default.rootData;if(t[0]==="/"){if(!W9e.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,o=pe.default.rootData}else{let l=K9e.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=e)throw new Error(c("property/index",u));return n[e-u]}if(u>e)throw new Error(c("data",u));if(o=r[e-u],!i)return o}let s=o,a=i.split("/");for(let l of a)l&&(o=(0,oe._)`${o}${(0,oe.getProperty)((0,Go.unescapeJsonPointer)(l))}`,s=(0,oe._)`${s} && ${o}`);return s;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}ia.getData=oce});var zE=v(yU=>{"use strict";Object.defineProperty(yU,"__esModule",{value:!0});var gU=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};yU.default=gU});var Hg=v(vU=>{"use strict";Object.defineProperty(vU,"__esModule",{value:!0});var _U=zg(),bU=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,_U.resolveUrl)(e,r,n),this.missingSchema=(0,_U.normalizeId)((0,_U.getFullPath)(e,this.missingRef))}};vU.default=bU});var qE=v(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.resolveSchema=Gn.getCompilingSchema=Gn.resolveRef=Gn.compileSchema=Gn.SchemaEnv=void 0;var _i=we(),J9e=zE(),qc=Ho(),bi=zg(),sce=Ne(),Y9e=Bg(),qd=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,bi.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Gn.SchemaEnv=qd;function wU(t){let e=ace.call(this,t);if(e)return e;let r=(0,bi.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,s=new _i.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o}),a;t.$async&&(a=s.scopeValue("Error",{ref:J9e.default,code:(0,_i._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");t.validateName=c;let l={gen:s,allErrors:this.opts.allErrors,data:qc.default.data,parentData:qc.default.parentData,parentDataProperty:qc.default.parentDataProperty,dataNames:[qc.default.data],dataPathArr:[_i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,_i.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:_i.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,_i._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,Y9e.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();u=`${s.scopeRefs(qc.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let p=new Function(`${qc.default.self}`,`${qc.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:m,items:h}=l;p.evaluated={props:m instanceof _i.Name?void 0:m,items:h instanceof _i.Name?void 0:h,dynamicProps:m instanceof _i.Name,dynamicItems:h instanceof _i.Name},p.source&&(p.source.evaluated=(0,_i.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}Gn.compileSchema=wU;function X9e(t,e,r){var n;r=(0,bi.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let o=tVe.call(this,t,r);if(o===void 0){let s=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(o=new qd({schema:s,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=Q9e.call(this,o)}Gn.resolveRef=X9e;function Q9e(t){return(0,bi.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:wU.call(this,t)}function ace(t){for(let e of this._compilations)if(eVe(e,t))return e}Gn.getCompilingSchema=ace;function eVe(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function tVe(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||UE.call(this,t,e)}function UE(t,e){let r=this.opts.uriResolver.parse(e),n=(0,bi._getFullPath)(this.opts.uriResolver,r),i=(0,bi.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return SU.call(this,r,t);let o=(0,bi.normalizeId)(n),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let a=UE.call(this,t,s);return typeof a?.schema!="object"?void 0:SU.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||wU.call(this,s),o===(0,bi.normalizeId)(e)){let{schema:a}=s,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,bi.resolveUrl)(this.opts.uriResolver,i,l)),new qd({schema:a,schemaId:c,root:t,baseId:i})}return SU.call(this,r,s)}}Gn.resolveSchema=UE;var rVe=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function SU(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,sce.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!rVe.has(a)&&l&&(e=(0,bi.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,sce.schemaHasRulesButRef)(r,this.RULES)){let a=(0,bi.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=UE.call(this,n,a)}let{schemaId:s}=this.opts;if(o=o||new qd({schema:r,schemaId:s,root:n,baseId:e}),o.schema!==o.root.schema)return o}});var cce=v((WOt,nVe)=>{nVe.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var kU=v((KOt,mce)=>{"use strict";var iVe=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),uce=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),xU=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),dce=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),oVe=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function $U(t){let e="",r=0,n=0;for(n=0;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var sVe=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function lce(t){return t.length=0,!0}function aVe(t,e,r){if(t.length){let n=$U(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function cVe(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],o=!1,s=!1,a=aVe;for(let c=0;c7){r.error=!0;break}c>0&&t[c-1]===":"&&(o=!0),n.push(":");continue}else if(l==="%"){if(!a(i,n,r))break;a=lce}else{i.push(l);continue}}return i.length&&(a===lce?r.zone=i.join(""):s?n.push(i.join("")):n.push($U(i))),r.address=n.join(""),r}function fce(t){if(lVe(t,":")<2)return{host:t,isIPV6:!1};let e=cVe(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function lVe(t,e){let r=0;for(let n=0;ndVe[n])}function mVe(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";var{isUUID:_Ve}=kU(),bVe=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,vVe=["http","https","ws","wss","urn","urn:uuid"];function SVe(t){return vVe.indexOf(t)!==-1}function EU(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function hce(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function gce(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function wVe(t){return t.secure=EU(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function xVe(t){if((t.port===(EU(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function $Ve(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(bVe);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,o=AU(i);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function kVe(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,o=AU(i);o&&(t=o.serialize(t,e));let s=t,a=t.nss;return s.path=`${n||e.nid}:${a}`,e.skipEscape=!0,s}function EVe(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!_Ve(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function AVe(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var yce={scheme:"http",domainHost:!0,parse:hce,serialize:gce},TVe={scheme:"https",domainHost:yce.domainHost,parse:hce,serialize:gce},BE={scheme:"ws",domainHost:!0,parse:wVe,serialize:xVe},OVe={scheme:"wss",domainHost:BE.domainHost,parse:BE.parse,serialize:BE.serialize},RVe={scheme:"urn",parse:$Ve,serialize:kVe,skipNormalize:!0},IVe={scheme:"urn:uuid",parse:EVe,serialize:AVe,skipNormalize:!0},HE={http:yce,https:TVe,ws:BE,wss:OVe,urn:RVe,"urn:uuid":IVe};Object.setPrototypeOf(HE,null);function AU(t){return t&&(HE[t]||HE[t.toLowerCase()])||void 0}_ce.exports={wsIsSecure:EU,SCHEMES:HE,isValidSchemeName:SVe,getSchemeHandler:AU}});var kce=v((YOt,GE)=>{"use strict";var{normalizeIPv6:PVe,removeDotSegments:Gg,recomposeAuthority:CVe,normalizePercentEncoding:DVe,normalizePathEncoding:NVe,escapePreservingEscapes:jVe,reescapeHostDelimiters:MVe,isIPv4:FVe,nonSimpleDomain:LVe}=kU(),{SCHEMES:zVe,getSchemeHandler:Sce}=bce();function UVe(t,e){return typeof t=="string"?t=ZVe(t,e):typeof t=="object"&&(t=Bd(Bc(t,e),e)),t}function qVe(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=wce(Bd(t,n),Bd(e,n),n,!0);return n.skipEscape=!0,Bc(i,n)}function wce(t,e,r,n){let i={};return n||(t=Bd(Bc(t,r),r),e=Bd(Bc(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Gg(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Gg(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Gg(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=Gg(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function BVe(t,e,r){let n=vce(t,r),i=vce(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function Bc(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],o=Sce(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=DVe(r.path):(r.path=jVe(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let s=CVe(r);if(s!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(s),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(a=Gg(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var HVe=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function GVe(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function xce(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,o=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(HVe);if(s){n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]);let a=GVe(n,s);if(a!==void 0&&(n.error=n.error||a,i=!0),n.host)if(FVe(n.host)===!1){let u=PVe(n.host);n.host=u.host.toLowerCase(),o=u.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=Sce(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&o===!1&&LVe(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(l){n.error=n.error||"Host's domain name can not be converted to ASCII: "+l}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=MVe(unescape(n.host),o))),n.path&&(n.path=NVe(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function Bd(t,e){return xce(t,e).parsed}function ZVe(t,e){return $ce(t,e).normalized}function $ce(t,e){let{parsed:r,malformedAuthorityOrPort:n}=xce(t,e);return{normalized:n?t:Bc(r,e),malformedAuthorityOrPort:n}}function vce(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=$ce(t,e);return n?void 0:r}if(typeof t=="object")return Bc(t,e)}var TU={SCHEMES:zVe,normalize:UVe,resolve:qVe,resolveComponent:wce,equal:BVe,serialize:Bc,parse:Bd};GE.exports=TU;GE.exports.default=TU;GE.exports.fastUri=TU});var Ace=v(OU=>{"use strict";Object.defineProperty(OU,"__esModule",{value:!0});var Ece=kce();Ece.code='require("ajv/dist/runtime/uri").default';OU.default=Ece});var Nce=v(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.CodeGen=lr.Name=lr.nil=lr.stringify=lr.str=lr._=lr.KeywordCxt=void 0;var VVe=Bg();Object.defineProperty(lr,"KeywordCxt",{enumerable:!0,get:function(){return VVe.KeywordCxt}});var Hd=we();Object.defineProperty(lr,"_",{enumerable:!0,get:function(){return Hd._}});Object.defineProperty(lr,"str",{enumerable:!0,get:function(){return Hd.str}});Object.defineProperty(lr,"stringify",{enumerable:!0,get:function(){return Hd.stringify}});Object.defineProperty(lr,"nil",{enumerable:!0,get:function(){return Hd.nil}});Object.defineProperty(lr,"Name",{enumerable:!0,get:function(){return Hd.Name}});Object.defineProperty(lr,"CodeGen",{enumerable:!0,get:function(){return Hd.CodeGen}});var WVe=zE(),Pce=Hg(),KVe=nU(),Zg=qE(),JVe=we(),Vg=zg(),ZE=Lg(),IU=Ne(),Tce=cce(),YVe=Ace(),Cce=(t,e)=>new RegExp(t,e);Cce.code="new RegExp";var XVe=["removeAdditional","useDefaults","coerceTypes"],QVe=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),eWe={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},tWe={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Oce=200;function rWe(t){var e,r,n,i,o,s,a,c,l,u,d,f,p,m,h,g,b,_,S,x,w,O,T,A,D;let $=t.strict,re=(e=t.code)===null||e===void 0?void 0:e.optimize,K=re===!0||re===void 0?1:re||0,xe=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Cce,C=(i=t.uriResolver)!==null&&i!==void 0?i:YVe.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:$)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:$)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:$)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:$)!==null&&f!==void 0?f:"log",strictRequired:(m=(p=t.strictRequired)!==null&&p!==void 0?p:$)!==null&&m!==void 0?m:!1,code:t.code?{...t.code,optimize:K,regExp:xe}:{optimize:K,regExp:xe},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Oce,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Oce,meta:(b=t.meta)!==null&&b!==void 0?b:!0,messages:(_=t.messages)!==null&&_!==void 0?_:!0,inlineRefs:(S=t.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(x=t.schemaId)!==null&&x!==void 0?x:"$id",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(O=t.validateSchema)!==null&&O!==void 0?O:!0,validateFormats:(T=t.validateFormats)!==null&&T!==void 0?T:!0,unicodeRegExp:(A=t.unicodeRegExp)!==null&&A!==void 0?A:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:C}}var Wg=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...rWe(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new JVe.ValueScope({scope:{},prefixes:QVe,es5:r,lines:n}),this.logger=cWe(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,KVe.getRules)(),Rce.call(this,eWe,e,"NOT SUPPORTED"),Rce.call(this,tWe,e,"DEPRECATED","warn"),this._metaOpts=sWe.call(this),e.formats&&iWe.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&oWe.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),nWe.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=Tce;n==="id"&&(i={...Tce},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,d){await o.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||s.call(this,f)}async function o(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function s(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof Pce.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,n,i);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return r=(0,Vg.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return i}getSchema(e){let r;for(;typeof(r=Ice.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Zg.SchemaEnv({schema:{},schemaId:n});if(r=Zg.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Ice.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,Vg.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(uWe.call(this,n,r),!r)return(0,IU.eachItem)(n,o=>RU.call(this,o)),this;fWe.call(this,r);let i={...r,type:(0,ZE.getJSONTypes)(r.type),schemaType:(0,ZE.getJSONTypes)(r.schemaType)};return(0,IU.eachItem)(n,i.type.length===0?o=>RU.call(this,o,i):o=>i.type.forEach(s=>RU.call(this,o,i,s))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(o=>o.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,o)=>i+r+o)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let o=i.split("/").slice(1),s=e;for(let a of o)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=s[a];l&&u&&(s[a]=Dce(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof e=="object")s=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,Vg.normalizeId)(s||n);let l=Vg.getSchemaRefs.call(this,e,n);return c=new Zg.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Zg.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Zg.compileSchema.call(this,e)}finally{this.opts=r}}};Wg.ValidationError=WVe.default;Wg.MissingRefError=Pce.default;lr.default=Wg;function Rce(t,e,r,n="error"){for(let i in t){let o=i;o in e&&this.logger[n](`${r}: option ${i}. ${t[o]}`)}}function Ice(t){return t=(0,Vg.normalizeId)(t),this.schemas[t]||this.refs[t]}function nWe(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function iWe(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function oWe(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function sWe(){let t={...this.opts};for(let e of XVe)delete t[e];return t}var aWe={log(){},warn(){},error(){}};function cWe(t){if(t===!1)return aWe;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var lWe=/^[a-z_$][a-z0-9_$:-]*$/i;function uWe(t,e){let{RULES:r}=this;if((0,IU.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!lWe.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function RU(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=i?o.post:o.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,ZE.getJSONTypes)(e.type),schemaType:(0,ZE.getJSONTypes)(e.schemaType)}};e.before?dWe.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function dWe(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function fWe(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Dce(e)),t.validateSchema=this.compile(e,!0))}var pWe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Dce(t){return{anyOf:[t,pWe]}}});var jce=v(PU=>{"use strict";Object.defineProperty(PU,"__esModule",{value:!0});var mWe={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};PU.default=mWe});var zce=v(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.callRef=Hc.getValidate=void 0;var hWe=Hg(),Mce=Hn(),Jr=we(),Gd=Ho(),Fce=qE(),VE=Ne(),gWe={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:o,validateName:s,opts:a,self:c}=n,{root:l}=o;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=Fce.resolveRef.call(c,l,i,r);if(u===void 0)throw new hWe.default(n.opts.uriResolver,i,r);if(u instanceof Fce.SchemaEnv)return f(u);return p(u);function d(){if(o===l)return WE(t,s,o,o.$async);let m=e.scopeValue("root",{ref:l});return WE(t,(0,Jr._)`${m}.validate`,l,l.$async)}function f(m){let h=Lce(t,m);WE(t,h,m,m.$async)}function p(m){let h=e.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,Jr.stringify)(m)}:{ref:m}),g=e.name("valid"),b=t.subschema({schema:m,dataTypes:[],schemaPath:Jr.nil,topSchemaRef:h,errSchemaPath:r},g);t.mergeEvaluated(b),t.ok(g)}}};function Lce(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Jr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Hc.getValidate=Lce;function WE(t,e,r,n){let{gen:i,it:o}=t,{allErrors:s,schemaEnv:a,opts:c}=o,l=c.passContext?Gd.default.this:Jr.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=i.let("valid");i.try(()=>{i.code((0,Jr._)`await ${(0,Mce.callValidateCode)(t,e,l)}`),p(e),s||i.assign(m,!0)},h=>{i.if((0,Jr._)`!(${h} instanceof ${o.ValidationError})`,()=>i.throw(h)),f(h),s||i.assign(m,!1)}),t.ok(m)}function d(){t.result((0,Mce.callValidateCode)(t,e,l),()=>p(e),()=>f(e))}function f(m){let h=(0,Jr._)`${m}.errors`;i.assign(Gd.default.vErrors,(0,Jr._)`${Gd.default.vErrors} === null ? ${h} : ${Gd.default.vErrors}.concat(${h})`),i.assign(Gd.default.errors,(0,Jr._)`${Gd.default.vErrors}.length`)}function p(m){var h;if(!o.opts.unevaluated)return;let g=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(o.props=VE.mergeEvaluated.props(i,g.props,o.props));else{let b=i.var("props",(0,Jr._)`${m}.evaluated.props`);o.props=VE.mergeEvaluated.props(i,b,o.props,Jr.Name)}if(o.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(o.items=VE.mergeEvaluated.items(i,g.items,o.items));else{let b=i.var("items",(0,Jr._)`${m}.evaluated.items`);o.items=VE.mergeEvaluated.items(i,b,o.items,Jr.Name)}}}Hc.callRef=WE;Hc.default=gWe});var Uce=v(CU=>{"use strict";Object.defineProperty(CU,"__esModule",{value:!0});var yWe=jce(),_We=zce(),bWe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",yWe.default,_We.default];CU.default=bWe});var qce=v(DU=>{"use strict";Object.defineProperty(DU,"__esModule",{value:!0});var KE=we(),oa=KE.operators,JE={maximum:{okStr:"<=",ok:oa.LTE,fail:oa.GT},minimum:{okStr:">=",ok:oa.GTE,fail:oa.LT},exclusiveMaximum:{okStr:"<",ok:oa.LT,fail:oa.GTE},exclusiveMinimum:{okStr:">",ok:oa.GT,fail:oa.LTE}},vWe={message:({keyword:t,schemaCode:e})=>(0,KE.str)`must be ${JE[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,KE._)`{comparison: ${JE[t].okStr}, limit: ${e}}`},SWe={keyword:Object.keys(JE),type:"number",schemaType:"number",$data:!0,error:vWe,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,KE._)`${r} ${JE[e].fail} ${n} || isNaN(${r})`)}};DU.default=SWe});var Bce=v(NU=>{"use strict";Object.defineProperty(NU,"__esModule",{value:!0});var Kg=we(),wWe={message:({schemaCode:t})=>(0,Kg.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Kg._)`{multipleOf: ${t}}`},xWe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:wWe,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,Kg._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,Kg._)`${s} !== parseInt(${s})`;t.fail$data((0,Kg._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};NU.default=xWe});var Gce=v(jU=>{"use strict";Object.defineProperty(jU,"__esModule",{value:!0});function Hce(t){let e=t.length,r=0,n=0,i;for(;n=55296&&i<=56319&&n{"use strict";Object.defineProperty(MU,"__esModule",{value:!0});var Gc=we(),$We=Ne(),kWe=Gce(),EWe={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Gc.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Gc._)`{limit: ${t}}`},AWe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:EWe,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,o=e==="maxLength"?Gc.operators.GT:Gc.operators.LT,s=i.opts.unicode===!1?(0,Gc._)`${r}.length`:(0,Gc._)`${(0,$We.useFunc)(t.gen,kWe.default)}(${r})`;t.fail$data((0,Gc._)`${s} ${o} ${n}`)}};MU.default=AWe});var Vce=v(FU=>{"use strict";Object.defineProperty(FU,"__esModule",{value:!0});var TWe=Hn(),OWe=Ne(),Zd=we(),RWe={message:({schemaCode:t})=>(0,Zd.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Zd._)`{pattern: ${t}}`},IWe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:RWe,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t,a=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=s.opts.code,l=c.code==="new RegExp"?(0,Zd._)`new RegExp`:(0,OWe.useFunc)(e,c),u=e.let("valid");e.try(()=>e.assign(u,(0,Zd._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Zd._)`!${u}`)}else{let c=(0,TWe.usePattern)(t,i);t.fail$data((0,Zd._)`!${c}.test(${r})`)}}};FU.default=IWe});var Wce=v(LU=>{"use strict";Object.defineProperty(LU,"__esModule",{value:!0});var Jg=we(),PWe={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Jg.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Jg._)`{limit: ${t}}`},CWe={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:PWe,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Jg.operators.GT:Jg.operators.LT;t.fail$data((0,Jg._)`Object.keys(${r}).length ${i} ${n}`)}};LU.default=CWe});var Kce=v(zU=>{"use strict";Object.defineProperty(zU,"__esModule",{value:!0});var Yg=Hn(),Xg=we(),DWe=Ne(),NWe={message:({params:{missingProperty:t}})=>(0,Xg.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Xg._)`{missingProperty: ${t}}`},jWe={keyword:"required",type:"object",schemaType:"array",$data:!0,error:NWe,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:o,it:s}=t,{opts:a}=s;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?l():u(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:m}=t.it;for(let h of r)if(p?.[h]===void 0&&!m.has(h)){let g=s.schemaEnv.baseId+s.errSchemaPath,b=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,DWe.checkStrictMode)(s,b,s.opts.strictRequired)}}function l(){if(c||o)t.block$data(Xg.nil,d);else for(let p of r)(0,Yg.checkReportMissingProp)(t,p)}function u(){let p=e.let("missing");if(c||o){let m=e.let("valid",!0);t.block$data(m,()=>f(p,m)),t.ok(m)}else e.if((0,Yg.checkMissingProp)(t,r,p)),(0,Yg.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,Yg.noPropertyInData)(e,i,p,a.ownProperties),()=>t.error())})}function f(p,m){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(m,(0,Yg.propertyInData)(e,i,p,a.ownProperties)),e.if((0,Xg.not)(m),()=>{t.error(),e.break()})},Xg.nil)}}};zU.default=jWe});var Jce=v(UU=>{"use strict";Object.defineProperty(UU,"__esModule",{value:!0});var Qg=we(),MWe={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Qg.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Qg._)`{limit: ${t}}`},FWe={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:MWe,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Qg.operators.GT:Qg.operators.LT;t.fail$data((0,Qg._)`${r}.length ${i} ${n}`)}};UU.default=FWe});var YE=v(qU=>{"use strict";Object.defineProperty(qU,"__esModule",{value:!0});var Yce=dU();Yce.code='require("ajv/dist/runtime/equal").default';qU.default=Yce});var Xce=v(HU=>{"use strict";Object.defineProperty(HU,"__esModule",{value:!0});var BU=Lg(),ur=we(),LWe=Ne(),zWe=YE(),UWe={message:({params:{i:t,j:e}})=>(0,ur.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,ur._)`{i: ${t}, j: ${e}}`},qWe={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:UWe,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:o,schemaCode:s,it:a}=t;if(!n&&!i)return;let c=e.let("valid"),l=o.items?(0,BU.getSchemaTypes)(o.items):[];t.block$data(c,u,(0,ur._)`${s} === false`),t.ok(c);function u(){let m=e.let("i",(0,ur._)`${r}.length`),h=e.let("j");t.setParams({i:m,j:h}),e.assign(c,!0),e.if((0,ur._)`${m} > 1`,()=>(d()?f:p)(m,h))}function d(){return l.length>0&&!l.some(m=>m==="object"||m==="array")}function f(m,h){let g=e.name("item"),b=(0,BU.checkDataTypes)(l,g,a.opts.strictNumbers,BU.DataType.Wrong),_=e.const("indices",(0,ur._)`{}`);e.for((0,ur._)`;${m}--;`,()=>{e.let(g,(0,ur._)`${r}[${m}]`),e.if(b,(0,ur._)`continue`),l.length>1&&e.if((0,ur._)`typeof ${g} == "string"`,(0,ur._)`${g} += "_"`),e.if((0,ur._)`typeof ${_}[${g}] == "number"`,()=>{e.assign(h,(0,ur._)`${_}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,ur._)`${_}[${g}] = ${m}`)})}function p(m,h){let g=(0,LWe.useFunc)(e,zWe.default),b=e.name("outer");e.label(b).for((0,ur._)`;${m}--;`,()=>e.for((0,ur._)`${h} = ${m}; ${h}--;`,()=>e.if((0,ur._)`${g}(${r}[${m}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(b)})))}}};HU.default=qWe});var Qce=v(ZU=>{"use strict";Object.defineProperty(ZU,"__esModule",{value:!0});var GU=we(),BWe=Ne(),HWe=YE(),GWe={message:"must be equal to constant",params:({schemaCode:t})=>(0,GU._)`{allowedValue: ${t}}`},ZWe={keyword:"const",$data:!0,error:GWe,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:o}=t;n||o&&typeof o=="object"?t.fail$data((0,GU._)`!${(0,BWe.useFunc)(e,HWe.default)}(${r}, ${i})`):t.fail((0,GU._)`${o} !== ${r}`)}};ZU.default=ZWe});var ele=v(VU=>{"use strict";Object.defineProperty(VU,"__esModule",{value:!0});var ey=we(),VWe=Ne(),WWe=YE(),KWe={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,ey._)`{allowedValues: ${t}}`},JWe={keyword:"enum",schemaType:"array",$data:!0,error:KWe,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=s.opts.loopEnum,c,l=()=>c??(c=(0,VWe.useFunc)(e,WWe.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",o);u=(0,ey.or)(...i.map((m,h)=>f(p,h)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",o,p=>e.if((0,ey._)`${l()}(${r}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,m){let h=i[m];return typeof h=="object"&&h!==null?(0,ey._)`${l()}(${r}, ${p}[${m}])`:(0,ey._)`${r} === ${h}`}}};VU.default=JWe});var tle=v(WU=>{"use strict";Object.defineProperty(WU,"__esModule",{value:!0});var YWe=qce(),XWe=Bce(),QWe=Zce(),e3e=Vce(),t3e=Wce(),r3e=Kce(),n3e=Jce(),i3e=Xce(),o3e=Qce(),s3e=ele(),a3e=[YWe.default,XWe.default,QWe.default,e3e.default,t3e.default,r3e.default,n3e.default,i3e.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},o3e.default,s3e.default];WU.default=a3e});var JU=v(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.validateAdditionalItems=void 0;var Zc=we(),KU=Ne(),c3e={message:({params:{len:t}})=>(0,Zc.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Zc._)`{limit: ${t}}`},l3e={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:c3e,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,KU.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}rle(t,n)}};function rle(t,e){let{gen:r,schema:n,data:i,keyword:o,it:s}=t;s.items=!0;let a=r.const("len",(0,Zc._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Zc._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,KU.alwaysValidSchema)(s,n)){let l=r.var("valid",(0,Zc._)`${a} <= ${e.length}`);r.if((0,Zc.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:KU.Type.Num},l),s.allErrors||r.if((0,Zc.not)(l),()=>r.break())})}}ty.validateAdditionalItems=rle;ty.default=l3e});var YU=v(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.validateTuple=void 0;var nle=we(),XE=Ne(),u3e=Hn(),d3e={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return ile(t,"additionalItems",e);r.items=!0,!(0,XE.alwaysValidSchema)(r,e)&&t.ok((0,u3e.validateArray)(t))}};function ile(t,e,r=t.schema){let{gen:n,parentSchema:i,data:o,keyword:s,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=XE.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,nle._)`${o}.length`);r.forEach((d,f)=>{(0,XE.alwaysValidSchema)(a,d)||(n.if((0,nle._)`${l} > ${f}`,()=>t.subschema({keyword:s,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,m=r.length,h=m===d.minItems&&(m===d.maxItems||d[e]===!1);if(f.strictTuples&&!h){let g=`"${s}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,XE.checkStrictMode)(a,g,f.strictTuples)}}}ry.validateTuple=ile;ry.default=d3e});var ole=v(XU=>{"use strict";Object.defineProperty(XU,"__esModule",{value:!0});var f3e=YU(),p3e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,f3e.validateTuple)(t,"items")};XU.default=p3e});var ale=v(QU=>{"use strict";Object.defineProperty(QU,"__esModule",{value:!0});var sle=we(),m3e=Ne(),h3e=Hn(),g3e=JU(),y3e={message:({params:{len:t}})=>(0,sle.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,sle._)`{limit: ${t}}`},_3e={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:y3e,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,m3e.alwaysValidSchema)(n,e)&&(i?(0,g3e.validateAdditionalItems)(t,i):t.ok((0,h3e.validateArray)(t)))}};QU.default=_3e});var cle=v(eq=>{"use strict";Object.defineProperty(eq,"__esModule",{value:!0});var Zn=we(),QE=Ne(),b3e={message:({params:{min:t,max:e}})=>e===void 0?(0,Zn.str)`must contain at least ${t} valid item(s)`:(0,Zn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Zn._)`{minContains: ${t}}`:(0,Zn._)`{minContains: ${t}, maxContains: ${e}}`},v3e={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:b3e,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t,s,a,{minContains:c,maxContains:l}=n;o.opts.next?(s=c===void 0?1:c,a=l):s=1;let u=e.const("len",(0,Zn._)`${i}.length`);if(t.setParams({min:s,max:a}),a===void 0&&s===0){(0,QE.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,QE.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,QE.alwaysValidSchema)(o,r)){let h=(0,Zn._)`${u} >= ${s}`;a!==void 0&&(h=(0,Zn._)`${h} && ${u} <= ${a}`),t.pass(h);return}o.items=!0;let d=e.name("valid");a===void 0&&s===1?p(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),a!==void 0&&e.if((0,Zn._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let h=e.name("_valid"),g=e.let("count",0);p(h,()=>e.if(h,()=>m(g)))}function p(h,g){e.forRange("i",0,u,b=>{t.subschema({keyword:"contains",dataProp:b,dataPropType:QE.Type.Num,compositeRule:!0},h),g()})}function m(h){e.code((0,Zn._)`${h}++`),a===void 0?e.if((0,Zn._)`${h} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,Zn._)`${h} > ${a}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,Zn._)`${h} >= ${s}`,()=>e.assign(d,!0)))}}};eq.default=v3e});var dle=v(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.validateSchemaDeps=io.validatePropertyDeps=io.error=void 0;var tq=we(),S3e=Ne(),ny=Hn();io.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,tq.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,tq._)`{property: ${t}, missingProperty: ${n}, depsCount: ${e}, - deps: ${r}}`};var w3e={keyword:"dependencies",type:"object",schemaType:"object",error:io.error,code(t){let[e,r]=x3e(t);lle(t,e),ule(t,r)}};function x3e({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function lle(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let c=(0,ny.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,ny.checkReportMissingProp)(t,l)}):(r.if((0,tq._)`${c} && (${(0,ny.checkMissingProp)(t,a,o)})`),(0,ny.reportMissingProp)(t,o),r.else())}}io.validatePropertyDeps=lle;function ule(t,e=t.schema){let{gen:r,data:n,keyword:i,it:o}=t,s=r.name("valid");for(let a in e)(0,S3e.alwaysValidSchema)(o,e[a])||(r.if((0,ny.propertyInData)(r,n,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),t.ok(s))}io.validateSchemaDeps=ule;io.default=w3e});var ple=v(rq=>{"use strict";Object.defineProperty(rq,"__esModule",{value:!0});var fle=we(),$3e=Ne(),k3e={message:"property name must be valid",params:({params:t})=>(0,fle._)`{propertyName: ${t.propertyName}}`},E3e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:k3e,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,$3e.alwaysValidSchema)(i,r))return;let o=e.name("valid");e.forIn("key",n,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,fle.not)(o),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(o)}};rq.default=E3e});var iq=v(nq=>{"use strict";Object.defineProperty(nq,"__esModule",{value:!0});var eA=Hn(),vi=we(),A3e=Ho(),tA=Ne(),T3e={message:"must NOT have additional properties",params:({params:t})=>(0,vi._)`{additionalProperty: ${t.additionalProperty}}`},O3e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:T3e,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,tA.alwaysValidSchema)(s,r))return;let l=(0,eA.allSchemaProperties)(n.properties),u=(0,eA.allSchemaProperties)(n.patternProperties);d(),t.ok((0,vi._)`${o} === ${A3e.default.errors}`);function d(){e.forIn("key",i,g=>{!l.length&&!u.length?m(g):e.if(f(g),()=>m(g))})}function f(g){let b;if(l.length>8){let _=(0,tA.schemaRefOrVal)(s,n.properties,"properties");b=(0,eA.isOwnProperty)(e,_,g)}else l.length?b=(0,vi.or)(...l.map(_=>(0,vi._)`${g} === ${_}`)):b=vi.nil;return u.length&&(b=(0,vi.or)(b,...u.map(_=>(0,vi._)`${(0,eA.usePattern)(t,_)}.test(${g})`))),(0,vi.not)(b)}function p(g){e.code((0,vi._)`delete ${i}[${g}]`)}function m(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,tA.alwaysValidSchema)(s,r)){let b=e.name("valid");c.removeAdditional==="failing"?(h(g,b,!1),e.if((0,vi.not)(b),()=>{t.reset(),p(g)})):(h(g,b),a||e.if((0,vi.not)(b),()=>e.break()))}}function h(g,b,_){let S={keyword:"additionalProperties",dataProp:g,dataPropType:tA.Type.Str};_===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(S,b)}}};nq.default=O3e});var gle=v(sq=>{"use strict";Object.defineProperty(sq,"__esModule",{value:!0});var R3e=Bg(),mle=Hn(),oq=Ne(),hle=iq(),I3e={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&hle.default.code(new R3e.KeywordCxt(o,hle.default,"additionalProperties"));let s=(0,mle.allSchemaProperties)(r);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=oq.mergeEvaluated.props(e,(0,oq.toHash)(s),o.props));let a=s.filter(d=>!(0,oq.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,mle.propertyInData)(e,i,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};sq.default=I3e});var vle=v(aq=>{"use strict";Object.defineProperty(aq,"__esModule",{value:!0});var yle=Hn(),rA=we(),_le=Ne(),ble=Ne(),P3e={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:o}=t,{opts:s}=o,a=(0,yle.allSchemaProperties)(r),c=a.filter(h=>(0,_le.alwaysValidSchema)(o,r[h]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&i.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof rA.Name)&&(o.props=(0,ble.evaluatedPropsToName)(e,o.props));let{props:d}=o;f();function f(){for(let h of a)l&&p(h),o.allErrors?m(h):(e.var(u,!0),m(h),e.if(u))}function p(h){for(let g in l)new RegExp(h).test(g)&&(0,_le.checkStrictMode)(o,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function m(h){e.forIn("key",n,g=>{e.if((0,rA._)`${(0,yle.usePattern)(t,h)}.test(${g})`,()=>{let b=c.includes(h);b||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:ble.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,rA._)`${d}[${g}]`,!0):!b&&!o.allErrors&&e.if((0,rA.not)(u),()=>e.break())})})}}};aq.default=P3e});var Sle=v(cq=>{"use strict";Object.defineProperty(cq,"__esModule",{value:!0});var C3e=Ne(),D3e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,C3e.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};cq.default=D3e});var wle=v(lq=>{"use strict";Object.defineProperty(lq,"__esModule",{value:!0});var N3e=Hn(),j3e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:N3e.validateUnion,error:{message:"must match a schema in anyOf"}};lq.default=j3e});var xle=v(uq=>{"use strict";Object.defineProperty(uq,"__esModule",{value:!0});var nA=we(),M3e=Ne(),F3e={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,nA._)`{passingSchemas: ${t.passing}}`},L3e={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:F3e,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let o=r,s=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(s,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((u,d)=>{let f;(0,M3e.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,nA._)`${c} && ${s}`).assign(s,!1).assign(a,(0,nA._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),f&&t.mergeEvaluated(f,nA.Name)})})}}};uq.default=L3e});var $le=v(dq=>{"use strict";Object.defineProperty(dq,"__esModule",{value:!0});var z3e=Ne(),U3e={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((o,s)=>{if((0,z3e.alwaysValidSchema)(n,o))return;let a=t.subschema({keyword:"allOf",schemaProp:s},i);t.ok(i),t.mergeEvaluated(a)})}};dq.default=U3e});var Ale=v(fq=>{"use strict";Object.defineProperty(fq,"__esModule",{value:!0});var iA=we(),Ele=Ne(),q3e={message:({params:t})=>(0,iA.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,iA._)`{failingKeyword: ${t.ifClause}}`},B3e={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:q3e,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Ele.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=kle(n,"then"),o=kle(n,"else");if(!i&&!o)return;let s=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),i&&o){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else i?e.if(a,l("then")):e.if((0,iA.not)(a),l("else"));t.pass(s,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let f=t.subschema({keyword:u},a);e.assign(s,a),t.mergeValidEvaluated(f,s),d?e.assign(d,(0,iA._)`${u}`):t.setParams({ifClause:u})}}}};function kle(t,e){let r=t.schema[e];return r!==void 0&&!(0,Ele.alwaysValidSchema)(t,r)}fq.default=B3e});var Tle=v(pq=>{"use strict";Object.defineProperty(pq,"__esModule",{value:!0});var H3e=Ne(),G3e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,H3e.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};pq.default=G3e});var Ole=v(mq=>{"use strict";Object.defineProperty(mq,"__esModule",{value:!0});var Z3e=JU(),V3e=ole(),W3e=YU(),K3e=ale(),J3e=cle(),Y3e=dle(),X3e=ple(),Q3e=iq(),eKe=gle(),tKe=vle(),rKe=Sle(),nKe=wle(),iKe=xle(),oKe=$le(),sKe=Ale(),aKe=Tle();function cKe(t=!1){let e=[rKe.default,nKe.default,iKe.default,oKe.default,sKe.default,aKe.default,X3e.default,Q3e.default,Y3e.default,eKe.default,tKe.default];return t?e.push(V3e.default,K3e.default):e.push(Z3e.default,W3e.default),e.push(J3e.default),e}mq.default=cKe});var Rle=v(hq=>{"use strict";Object.defineProperty(hq,"__esModule",{value:!0});var Pt=we(),lKe={message:({schemaCode:t})=>(0,Pt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Pt._)`{format: ${t}}`},uKe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:lKe,code(t,e){let{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():p();function f(){let m=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,Pt._)`${m}[${s}]`),g=r.let("fType"),b=r.let("format");r.if((0,Pt._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,Pt._)`${h}.type || "string"`).assign(b,(0,Pt._)`${h}.validate`),()=>r.assign(g,(0,Pt._)`"string"`).assign(b,h)),t.fail$data((0,Pt.or)(_(),S()));function _(){return c.strictSchema===!1?Pt.nil:(0,Pt._)`${s} && !${b}`}function S(){let x=u.$async?(0,Pt._)`(${h}.async ? await ${b}(${n}) : ${b}(${n}))`:(0,Pt._)`${b}(${n})`,w=(0,Pt._)`(typeof ${b} == "function" ? ${x} : ${b}.test(${n}))`;return(0,Pt._)`${b} && ${b} !== true && ${g} === ${e} && !${w}`}}function p(){let m=d.formats[o];if(!m){_();return}if(m===!0)return;let[h,g,b]=S(m);h===e&&t.pass(x());function _(){if(c.strictSchema===!1){d.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function S(w){let O=w instanceof RegExp?(0,Pt.regexpCode)(w):c.code.formats?(0,Pt._)`${c.code.formats}${(0,Pt.getProperty)(o)}`:void 0,T=r.scopeValue("formats",{key:o,ref:w,code:O});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,Pt._)`${T}.validate`]:["string",w,T]}function x(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Pt._)`await ${b}(${n})`}return typeof g=="function"?(0,Pt._)`${b}(${n})`:(0,Pt._)`${b}.test(${n})`}}}};hq.default=uKe});var Ile=v(gq=>{"use strict";Object.defineProperty(gq,"__esModule",{value:!0});var dKe=Rle(),fKe=[dKe.default];gq.default=fKe});var Ple=v(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.contentVocabulary=Vd.metadataVocabulary=void 0;Vd.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Vd.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Dle=v(yq=>{"use strict";Object.defineProperty(yq,"__esModule",{value:!0});var pKe=Uce(),mKe=tle(),hKe=Ole(),gKe=Ile(),Cle=Ple(),yKe=[pKe.default,mKe.default,(0,hKe.default)(),gKe.default,Cle.metadataVocabulary,Cle.contentVocabulary];yq.default=yKe});var jle=v(oA=>{"use strict";Object.defineProperty(oA,"__esModule",{value:!0});oA.DiscrError=void 0;var Nle;(function(t){t.Tag="tag",t.Mapping="mapping"})(Nle||(oA.DiscrError=Nle={}))});var Fle=v(bq=>{"use strict";Object.defineProperty(bq,"__esModule",{value:!0});var Wd=we(),_q=jle(),Mle=qE(),_Ke=Hg(),bKe=Ne(),vKe={message:({params:{discrError:t,tagName:e}})=>t===_q.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Wd._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},SKe={keyword:"discriminator",type:"object",schemaType:"object",error:vKe,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:o}=t,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,Wd._)`${r}${(0,Wd.getProperty)(a)}`);e.if((0,Wd._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:_q.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let p=f();e.if(!1);for(let m in p)e.elseIf((0,Wd._)`${l} === ${m}`),e.assign(c,d(p[m]));e.else(),t.error(!1,{discrError:_q.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let m=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:p},m);return t.mergeEvaluated(h,Wd.Name),m}function f(){var p;let m={},h=b(i),g=!0;for(let x=0;x{wKe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Sq=v((pt,vq)=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.MissingRefError=pt.ValidationError=pt.CodeGen=pt.Name=pt.nil=pt.stringify=pt.str=pt._=pt.KeywordCxt=pt.Ajv=void 0;var xKe=Nce(),$Ke=Dle(),kKe=Fle(),zle=Lle(),EKe=["/properties"],sA="http://json-schema.org/draft-07/schema",Kd=class extends xKe.default{_addVocabularies(){super._addVocabularies(),$Ke.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(kKe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(zle,EKe):zle;this.addMetaSchema(e,sA,!1),this.refs["http://json-schema.org/schema"]=sA}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(sA)?sA:void 0)}};pt.Ajv=Kd;vq.exports=pt=Kd;vq.exports.Ajv=Kd;Object.defineProperty(pt,"__esModule",{value:!0});pt.default=Kd;var AKe=Bg();Object.defineProperty(pt,"KeywordCxt",{enumerable:!0,get:function(){return AKe.KeywordCxt}});var Jd=we();Object.defineProperty(pt,"_",{enumerable:!0,get:function(){return Jd._}});Object.defineProperty(pt,"str",{enumerable:!0,get:function(){return Jd.str}});Object.defineProperty(pt,"stringify",{enumerable:!0,get:function(){return Jd.stringify}});Object.defineProperty(pt,"nil",{enumerable:!0,get:function(){return Jd.nil}});Object.defineProperty(pt,"Name",{enumerable:!0,get:function(){return Jd.Name}});Object.defineProperty(pt,"CodeGen",{enumerable:!0,get:function(){return Jd.CodeGen}});var TKe=zE();Object.defineProperty(pt,"ValidationError",{enumerable:!0,get:function(){return TKe.default}});var OKe=Hg();Object.defineProperty(pt,"MissingRefError",{enumerable:!0,get:function(){return OKe.default}})});var Wle=v(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.formatNames=so.fastFormats=so.fullFormats=void 0;function oo(t,e){return{validate:t,compare:e}}so.fullFormats={date:oo(Hle,kq),time:oo(xq(!0),Eq),"date-time":oo(Ule(!0),Zle),"iso-time":oo(xq(),Gle),"iso-date-time":oo(Ule(),Vle),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:NKe,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:qKe,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:jKe,int32:{type:"number",validate:LKe},int64:{type:"number",validate:zKe},float:{type:"number",validate:Ble},double:{type:"number",validate:Ble},password:!0,binary:!0};so.fastFormats={...so.fullFormats,date:oo(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,kq),time:oo(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Eq),"date-time":oo(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Zle),"iso-time":oo(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Gle),"iso-date-time":oo(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Vle),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};so.formatNames=Object.keys(so.fullFormats);function RKe(t){return t%4===0&&(t%100!==0||t%400===0)}var IKe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,PKe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Hle(t){let e=IKe.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&RKe(r)?29:PKe[n])}function kq(t,e){if(t&&e)return t>e?1:t23||u>59||t&&!a)return!1;if(i<=23&&o<=59&&s<60)return!0;let d=o-u*c,f=i-l*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&s<61}}function Eq(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function Gle(t,e){if(!(t&&e))return;let r=wq.exec(t),n=wq.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=MKe}function zKe(t){return Number.isInteger(t)}function Ble(){return!0}var UKe=/[^\\]\\Z/;function qKe(t){if(UKe.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Kle=v(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.formatLimitDefinition=void 0;var BKe=Sq(),Si=we(),sa=Si.operators,aA={formatMaximum:{okStr:"<=",ok:sa.LTE,fail:sa.GT},formatMinimum:{okStr:">=",ok:sa.GTE,fail:sa.LT},formatExclusiveMaximum:{okStr:"<",ok:sa.LT,fail:sa.GTE},formatExclusiveMinimum:{okStr:">",ok:sa.GT,fail:sa.LTE}},HKe={message:({keyword:t,schemaCode:e})=>(0,Si.str)`should be ${aA[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Si._)`{comparison: ${aA[t].okStr}, limit: ${e}}`};Yd.formatLimitDefinition={keyword:Object.keys(aA),type:"string",schemaType:"string",$data:!0,error:HKe,code(t){let{gen:e,data:r,schemaCode:n,keyword:i,it:o}=t,{opts:s,self:a}=o;if(!s.validateFormats)return;let c=new BKe.KeywordCxt(o,a.RULES.all.format.definition,"format");c.$data?l():u();function l(){let f=e.scopeValue("formats",{ref:a.formats,code:s.code.formats}),p=e.const("fmt",(0,Si._)`${f}[${c.schemaCode}]`);t.fail$data((0,Si.or)((0,Si._)`typeof ${p} != "object"`,(0,Si._)`${p} instanceof RegExp`,(0,Si._)`typeof ${p}.compare != "function"`,d(p)))}function u(){let f=c.schema,p=a.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${i}": format "${f}" does not define "compare" function`);let m=e.scopeValue("formats",{key:f,ref:p,code:s.code.formats?(0,Si._)`${s.code.formats}${(0,Si.getProperty)(f)}`:void 0});t.fail$data(d(m))}function d(f){return(0,Si._)`${f}.compare(${r}, ${n}) ${aA[i].fail} 0`}},dependencies:["format"]};var GKe=t=>(t.addKeyword(Yd.formatLimitDefinition),t);Yd.default=GKe});var Qle=v((iy,Xle)=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});var Xd=Wle(),ZKe=Kle(),Aq=we(),Jle=new Aq.Name("fullFormats"),VKe=new Aq.Name("fastFormats"),Tq=(t,e={keywords:!0})=>{if(Array.isArray(e))return Yle(t,e,Xd.fullFormats,Jle),t;let[r,n]=e.mode==="fast"?[Xd.fastFormats,VKe]:[Xd.fullFormats,Jle],i=e.formats||Xd.formatNames;return Yle(t,i,r,n),e.keywords&&(0,ZKe.default)(t),t};Tq.get=(t,e="full")=>{let n=(e==="fast"?Xd.fastFormats:Xd.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function Yle(t,e,r,n){var i,o;(i=(o=t.opts.code).formats)!==null&&i!==void 0||(o.formats=(0,Aq._)`require("ajv-formats/dist/formats").${n}`);for(let s of e)t.addFormat(s,r[s])}Xle.exports=iy=Tq;Object.defineProperty(iy,"__esModule",{value:!0});iy.default=Tq});function WKe(){let t=new eue.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,tue.default)(t),t}var eue,tue,cA,rue=y(()=>{eue=St(Sq(),1),tue=St(Qle(),1);cA=class{constructor(e){this._ajv=e??WKe()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var lA,nue=y(()=>{Nc();lA=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],o=Array.isArray(i.content)?i.content:[i.content],s=o.some(u=>u.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],l=c.some(u=>u.type==="tool_use");if(s){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let u=new Set(c.filter(f=>f.type==="tool_use").map(f=>f.id)),d=new Set(o.filter(f=>f.type==="tool_result").map(f=>f.toolUseId));if(u.size!==d.size||![...u].every(f=>d.has(f)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},Tg,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),i=e.mode??"form";switch(i){case"url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=i==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},Dd,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}}});function iue(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function oue(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var sue=y(()=>{});var uA,aue=y(()=>{lae();Nc();rue();rg();nue();sue();uA=class extends AE{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Ag.options.map((n,i)=>[n,i])),this.isMessageIgnored=(n,i)=>{let o=this._loggingLevels.get(i);return o?this.LOG_LEVEL_SEVERITY.get(n)this._oninitialize(n)),this.setNotificationHandler(Uz,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Jz,async(n,i)=>{let o=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=Ag.safeParse(s);return a.success&&this._loggingLevels.set(o,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new lA(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=cae(this._capabilities,e)}setRequestHandler(e,r){let i=Ws(e)?.method;if(!i)throw new Error("Schema is missing a method literal");let o;if(Ln(i)){let a=i;o=a._zod?.def?.value??a.value}else{let a=i;o=a._def?.value??a.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let a=async(c,l)=>{let u=Vs(Cd,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new ne(ae.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=Vs(Id,f);if(!m.success){let h=m.error instanceof Error?m.error.message:String(m.error);throw new ne(ae.InvalidParams,`Invalid task creation result: ${h}`)}return m.data}let p=Vs(hE,f);if(!p.success){let m=p.error instanceof Error?p.error.message:String(p.error);throw new ne(ae.InvalidParams,`Invalid tools/call result: ${m}`)}return p.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){oue(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&iue(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:cse.includes(r)?r:Nz,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Qk)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],i=Array.isArray(n.content)?n.content:[n.content],o=i.some(l=>l.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(l=>l.type==="tool_use");if(o){if(i.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let l=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),u=new Set(i.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(l.size!==u.size||![...l].every(d=>u.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},Yz,r):this.request({method:"sampling/createMessage",params:e},Tg,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let i=e;return this.request({method:"elicitation/create",params:i},Dd,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let i=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:i},Dd,r);if(o.action==="accept"&&o.content&&i.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(i.requestedSchema)(o.content);if(!a.valid)throw new ne(ae.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof ne?s:new ne(ae.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},Xz,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function Oq(t){return!!t&&typeof t=="object"&&lue in t}function uue(t){return t[lue]?.complete}var lue,cue,due=y(()=>{lue=Symbol.for("mcp.completable");(function(t){t.Completable="McpCompletable"})(cue||(cue={}))});var fue=y(()=>{});function JKe(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!KKe.test(t)){let r=t.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,i,o)=>o.indexOf(n)===i);return e.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function YKe(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function Rq(t){let e=JKe(t);return YKe(t,e.warnings),e.isValid}var KKe,pue=y(()=>{KKe=/^[A-Za-z0-9._-]{1,128}$/});var dA,mue=y(()=>{dA=class{constructor(e){this._mcpServer=e}registerToolTask(e,r,n){let i={taskSupport:"required",...r.execution};if(i.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,i,r._meta,n)}}});var Iq=y(()=>{Kk();Kk()});function yue(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function _ue(t){return"_def"in t||"_zod"in t||yue(t)}function Pq(t){return typeof t!="object"||t===null||_ue(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(yue)}function hue(t){if(t){if(Pq(t))return Cc(t);if(!_ue(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function QKe(t){let e=Ws(t);return e?Object.entries(e).map(([r,n])=>{let i=qie(n),o=Bie(n);return{name:r,description:i,required:!o}}):[]}function aa(t){let r=Ws(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=_k(r);if(typeof n=="string")return n;throw new Error("Schema method literal must be a string")}function gue(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var fA,XKe,oy,bue=y(()=>{aue();rg();N2();Nc();due();fue();pue();mue();Iq();fA=class{constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new uA(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new dA(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(aa(mE)),this.server.assertCanSetRequestHandler(aa(Cd)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(mE,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let n={name:e,title:r.title,description:r.description,inputSchema:(()=>{let i=vd(r.inputSchema);return i?P2(i,{strictUnions:!0,pipeStrategy:"input"}):XKe})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let i=vd(r.outputSchema);i&&(n.outputSchema=P2(i,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Cd,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new ne(ae.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new ne(ae.InvalidParams,`Tool ${e.params.name} disabled`);let i=!!e.params.task,o=n.execution?.taskSupport,s="createTask"in n.handler;if((o==="required"||o==="optional")&&!s)throw new ne(ae.InternalError,`Tool ${e.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!i)throw new ne(ae.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!i&&s)return await this.handleAutomaticTaskPolling(n,e,r);let a=await this.validateToolInput(n,e.params.arguments,e.params.name),c=await this.executeToolHandler(n,a,r);return i||await this.validateToolOutput(n,c,e.params.name),c}catch(n){if(n instanceof ne&&n.code===ae.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,n){if(!e.inputSchema)return;let o=vd(e.inputSchema)??e.inputSchema,s=await gk(o,r);if(!s.success){let a="error"in s?s.error:"Unknown error",c=yk(a);throw new ne(ae.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${c}`)}return s.data}async validateToolOutput(e,r,n){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new ne(ae.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let i=vd(e.outputSchema),o=await gk(i,r.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",a=yk(s);throw new ne(ae.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${a}`)}}async executeToolHandler(e,r,n){let i=e.handler;if("createTask"in i){if(!n.taskStore)throw new Error("No task store provided.");let s={...n,taskStore:n.taskStore};if(e.inputSchema){let a=i;return await Promise.resolve(a.createTask(r,s))}else{let a=i;return await Promise.resolve(a.createTask(s))}}if(e.inputSchema){let s=i;return await Promise.resolve(s(r,n))}else{let s=i;return await Promise.resolve(s(n))}}async handleAutomaticTaskPolling(e,r,n){if(!n.taskStore)throw new Error("No task store provided for task-capable tool.");let i=await this.validateToolInput(e,r.params.arguments,r.params.name),o=e.handler,s={...n,taskStore:n.taskStore},a=i?await Promise.resolve(o.createTask(i,s)):await Promise.resolve(o.createTask(s)),c=a.task.taskId,l=a.task,u=l.pollInterval??5e3;for(;l.status!=="completed"&&l.status!=="failed"&&l.status!=="cancelled";){await new Promise(f=>setTimeout(f,u));let d=await n.taskStore.getTask(c);if(!d)throw new ne(ae.InternalError,`Task ${c} not found during polling`);l=d}return await n.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(aa(gE)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(gE,async e=>{switch(e.params.ref.type){case"ref/prompt":return $se(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return kse(e),this.handleResourceCompletion(e,e.params.ref);default:throw new ne(ae.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new ne(ae.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new ne(ae.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return oy;let o=Ws(n.argsSchema)?.[e.params.argument.name];if(!Oq(o))return oy;let s=uue(o);if(!s)return oy;let a=await s(e.params.argument.value,e.params.context);return gue(a)}async handleResourceCompletion(e,r){let n=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return oy;throw new ne(ae.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let i=n.resourceTemplate.completeCallback(e.params.argument.name);if(!i)return oy;let o=await i(e.params.argument.value,e.params.context);return gue(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(aa(lE)),this.server.assertCanSetRequestHandler(aa(uE)),this.server.assertCanSetRequestHandler(aa(dE)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(lE,async(e,r)=>{let n=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),i=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(r);for(let a of s.resources)i.push({...o.metadata,...a})}return{resources:[...n,...i]}}),this.server.setRequestHandler(uE,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,n])=>({name:r,uriTemplate:n.resourceTemplate.uriTemplate.toString(),...n.metadata}))})),this.server.setRequestHandler(dE,async(e,r)=>{let n=new URL(e.params.uri),i=this._registeredResources[n.toString()];if(i){if(!i.enabled)throw new ne(ae.InvalidParams,`Resource ${n} disabled`);return i.readCallback(n,r)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(n.toString());if(s)return o.readCallback(n,s,r)}throw new ne(ae.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(aa(fE)),this.server.assertCanSetRequestHandler(aa(pE)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(fE,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?QKe(r.argsSchema):void 0}))})),this.server.setRequestHandler(pE,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new ne(ae.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new ne(ae.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let i=vd(n.argsSchema),o=await gk(i,e.params.arguments);if(!o.success){let c="error"in o?o.error:"Unknown error",l=yk(c);throw new ne(ae.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${l}`)}let s=o.data,a=n.callback;return await Promise.resolve(a(s,r))}else{let i=n.callback;return await Promise.resolve(i(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...n){let i;typeof n[0]=="object"&&(i=n.shift());let o=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,void 0,r,i,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,r,i,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,r,n,i){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let o=this._createRegisteredResource(e,n.title,r,n,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,n.title,r,n,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(e,r,n,i,o){let s={name:e,title:r,metadata:i,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:a=>{typeof a.uri<"u"&&a.uri!==n&&(delete this._registeredResources[n],a.uri&&(this._registeredResources[a.uri]=s)),typeof a.name<"u"&&(s.name=a.name),typeof a.title<"u"&&(s.title=a.title),typeof a.metadata<"u"&&(s.metadata=a.metadata),typeof a.callback<"u"&&(s.readCallback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[n]=s,s}_createRegisteredResourceTemplate(e,r,n,i,o){let s={resourceTemplate:n,title:r,metadata:i,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredResourceTemplates[e],l.name&&(this._registeredResourceTemplates[l.name]=s)),typeof l.title<"u"&&(s.title=l.title),typeof l.template<"u"&&(s.resourceTemplate=l.template),typeof l.metadata<"u"&&(s.metadata=l.metadata),typeof l.callback<"u"&&(s.readCallback=l.callback),typeof l.enabled<"u"&&(s.enabled=l.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let a=n.uriTemplate.variableNames;return Array.isArray(a)&&a.some(l=>!!n.completeCallback(l))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,r,n,i,o){let s={title:r,description:n,argsSchema:i===void 0?void 0:Cc(i),callback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{typeof a.name<"u"&&a.name!==e&&(delete this._registeredPrompts[e],a.name&&(this._registeredPrompts[a.name]=s)),typeof a.title<"u"&&(s.title=a.title),typeof a.description<"u"&&(s.description=a.description),typeof a.argsSchema<"u"&&(s.argsSchema=Cc(a.argsSchema)),typeof a.callback<"u"&&(s.callback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=s,i&&Object.values(i).some(c=>{let l=c instanceof Od?c._def?.innerType:c;return Oq(l)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(e,r,n,i,o,s,a,c,l){Rq(e);let u={title:r,description:n,inputSchema:hue(i),outputSchema:hue(o),annotations:s,execution:a,_meta:c,handler:l,enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==e&&(typeof d.name=="string"&&Rq(d.name),delete this._registeredTools[e],d.name&&(this._registeredTools[d.name]=u)),typeof d.title<"u"&&(u.title=d.title),typeof d.description<"u"&&(u.description=d.description),typeof d.paramsSchema<"u"&&(u.inputSchema=Cc(d.paramsSchema)),typeof d.outputSchema<"u"&&(u.outputSchema=Cc(d.outputSchema)),typeof d.callback<"u"&&(u.handler=d.callback),typeof d.annotations<"u"&&(u.annotations=d.annotations),typeof d._meta<"u"&&(u._meta=d._meta),typeof d.enabled<"u"&&(u.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=u,this.setToolRequestHandlers(),this.sendToolListChanged(),u}tool(e,...r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let n,i,o,s;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let c=r[0];if(Pq(c))i=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!Pq(r[0])&&(s=r.shift());else if(typeof c=="object"&&c!==null){if(Object.values(c).some(l=>typeof l=="object"&&l!==null))throw new Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=r.shift()}}let a=r[0];return this._createRegisteredTool(e,void 0,n,i,o,s,{taskSupport:"forbidden"},void 0,a)}registerTool(e,r,n){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:i,description:o,inputSchema:s,outputSchema:a,annotations:c,_meta:l}=r;return this._createRegisteredTool(e,i,o,s,a,c,{taskSupport:"forbidden"},l,n)}prompt(e,...r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let i;r.length>1&&(i=r.shift());let o=r[0],s=this._createRegisteredPrompt(e,void 0,n,i,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,r,n){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:i,description:o,argsSchema:s}=r,a=this._createRegisteredPrompt(e,i,o,s,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},XKe={type:"object",properties:{}};oy={completion:{values:[],hasMore:!1}}});import{readFileSync as eJe,existsSync as Sue}from"node:fs";import{dirname as tJe,join as pA}from"node:path";import{fileURLToPath as rJe}from"node:url";function sy(t,e){let r=iJe[t];r&&process.stderr.write(`cladding: persona '${t}' is now '${r}' \u2014 the old id is removed in 0.8 + deps: ${r}}`};var w3e={keyword:"dependencies",type:"object",schemaType:"object",error:io.error,code(t){let[e,r]=x3e(t);lle(t,e),ule(t,r)}};function x3e({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function lle(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let c=(0,ny.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,ny.checkReportMissingProp)(t,l)}):(r.if((0,tq._)`${c} && (${(0,ny.checkMissingProp)(t,a,o)})`),(0,ny.reportMissingProp)(t,o),r.else())}}io.validatePropertyDeps=lle;function ule(t,e=t.schema){let{gen:r,data:n,keyword:i,it:o}=t,s=r.name("valid");for(let a in e)(0,S3e.alwaysValidSchema)(o,e[a])||(r.if((0,ny.propertyInData)(r,n,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),t.ok(s))}io.validateSchemaDeps=ule;io.default=w3e});var ple=v(rq=>{"use strict";Object.defineProperty(rq,"__esModule",{value:!0});var fle=we(),$3e=Ne(),k3e={message:"property name must be valid",params:({params:t})=>(0,fle._)`{propertyName: ${t.propertyName}}`},E3e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:k3e,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,$3e.alwaysValidSchema)(i,r))return;let o=e.name("valid");e.forIn("key",n,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,fle.not)(o),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(o)}};rq.default=E3e});var iq=v(nq=>{"use strict";Object.defineProperty(nq,"__esModule",{value:!0});var eA=Hn(),vi=we(),A3e=Ho(),tA=Ne(),T3e={message:"must NOT have additional properties",params:({params:t})=>(0,vi._)`{additionalProperty: ${t.additionalProperty}}`},O3e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:T3e,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,tA.alwaysValidSchema)(s,r))return;let l=(0,eA.allSchemaProperties)(n.properties),u=(0,eA.allSchemaProperties)(n.patternProperties);d(),t.ok((0,vi._)`${o} === ${A3e.default.errors}`);function d(){e.forIn("key",i,g=>{!l.length&&!u.length?m(g):e.if(f(g),()=>m(g))})}function f(g){let b;if(l.length>8){let _=(0,tA.schemaRefOrVal)(s,n.properties,"properties");b=(0,eA.isOwnProperty)(e,_,g)}else l.length?b=(0,vi.or)(...l.map(_=>(0,vi._)`${g} === ${_}`)):b=vi.nil;return u.length&&(b=(0,vi.or)(b,...u.map(_=>(0,vi._)`${(0,eA.usePattern)(t,_)}.test(${g})`))),(0,vi.not)(b)}function p(g){e.code((0,vi._)`delete ${i}[${g}]`)}function m(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,tA.alwaysValidSchema)(s,r)){let b=e.name("valid");c.removeAdditional==="failing"?(h(g,b,!1),e.if((0,vi.not)(b),()=>{t.reset(),p(g)})):(h(g,b),a||e.if((0,vi.not)(b),()=>e.break()))}}function h(g,b,_){let S={keyword:"additionalProperties",dataProp:g,dataPropType:tA.Type.Str};_===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(S,b)}}};nq.default=O3e});var gle=v(sq=>{"use strict";Object.defineProperty(sq,"__esModule",{value:!0});var R3e=Bg(),mle=Hn(),oq=Ne(),hle=iq(),I3e={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&hle.default.code(new R3e.KeywordCxt(o,hle.default,"additionalProperties"));let s=(0,mle.allSchemaProperties)(r);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=oq.mergeEvaluated.props(e,(0,oq.toHash)(s),o.props));let a=s.filter(d=>!(0,oq.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,mle.propertyInData)(e,i,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};sq.default=I3e});var vle=v(aq=>{"use strict";Object.defineProperty(aq,"__esModule",{value:!0});var yle=Hn(),rA=we(),_le=Ne(),ble=Ne(),P3e={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:o}=t,{opts:s}=o,a=(0,yle.allSchemaProperties)(r),c=a.filter(h=>(0,_le.alwaysValidSchema)(o,r[h]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&i.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof rA.Name)&&(o.props=(0,ble.evaluatedPropsToName)(e,o.props));let{props:d}=o;f();function f(){for(let h of a)l&&p(h),o.allErrors?m(h):(e.var(u,!0),m(h),e.if(u))}function p(h){for(let g in l)new RegExp(h).test(g)&&(0,_le.checkStrictMode)(o,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function m(h){e.forIn("key",n,g=>{e.if((0,rA._)`${(0,yle.usePattern)(t,h)}.test(${g})`,()=>{let b=c.includes(h);b||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:ble.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,rA._)`${d}[${g}]`,!0):!b&&!o.allErrors&&e.if((0,rA.not)(u),()=>e.break())})})}}};aq.default=P3e});var Sle=v(cq=>{"use strict";Object.defineProperty(cq,"__esModule",{value:!0});var C3e=Ne(),D3e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,C3e.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};cq.default=D3e});var wle=v(lq=>{"use strict";Object.defineProperty(lq,"__esModule",{value:!0});var N3e=Hn(),j3e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:N3e.validateUnion,error:{message:"must match a schema in anyOf"}};lq.default=j3e});var xle=v(uq=>{"use strict";Object.defineProperty(uq,"__esModule",{value:!0});var nA=we(),M3e=Ne(),F3e={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,nA._)`{passingSchemas: ${t.passing}}`},L3e={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:F3e,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let o=r,s=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(s,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((u,d)=>{let f;(0,M3e.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,nA._)`${c} && ${s}`).assign(s,!1).assign(a,(0,nA._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),f&&t.mergeEvaluated(f,nA.Name)})})}}};uq.default=L3e});var $le=v(dq=>{"use strict";Object.defineProperty(dq,"__esModule",{value:!0});var z3e=Ne(),U3e={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((o,s)=>{if((0,z3e.alwaysValidSchema)(n,o))return;let a=t.subschema({keyword:"allOf",schemaProp:s},i);t.ok(i),t.mergeEvaluated(a)})}};dq.default=U3e});var Ale=v(fq=>{"use strict";Object.defineProperty(fq,"__esModule",{value:!0});var iA=we(),Ele=Ne(),q3e={message:({params:t})=>(0,iA.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,iA._)`{failingKeyword: ${t.ifClause}}`},B3e={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:q3e,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Ele.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=kle(n,"then"),o=kle(n,"else");if(!i&&!o)return;let s=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),i&&o){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else i?e.if(a,l("then")):e.if((0,iA.not)(a),l("else"));t.pass(s,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let f=t.subschema({keyword:u},a);e.assign(s,a),t.mergeValidEvaluated(f,s),d?e.assign(d,(0,iA._)`${u}`):t.setParams({ifClause:u})}}}};function kle(t,e){let r=t.schema[e];return r!==void 0&&!(0,Ele.alwaysValidSchema)(t,r)}fq.default=B3e});var Tle=v(pq=>{"use strict";Object.defineProperty(pq,"__esModule",{value:!0});var H3e=Ne(),G3e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,H3e.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};pq.default=G3e});var Ole=v(mq=>{"use strict";Object.defineProperty(mq,"__esModule",{value:!0});var Z3e=JU(),V3e=ole(),W3e=YU(),K3e=ale(),J3e=cle(),Y3e=dle(),X3e=ple(),Q3e=iq(),eKe=gle(),tKe=vle(),rKe=Sle(),nKe=wle(),iKe=xle(),oKe=$le(),sKe=Ale(),aKe=Tle();function cKe(t=!1){let e=[rKe.default,nKe.default,iKe.default,oKe.default,sKe.default,aKe.default,X3e.default,Q3e.default,Y3e.default,eKe.default,tKe.default];return t?e.push(V3e.default,K3e.default):e.push(Z3e.default,W3e.default),e.push(J3e.default),e}mq.default=cKe});var Rle=v(hq=>{"use strict";Object.defineProperty(hq,"__esModule",{value:!0});var Pt=we(),lKe={message:({schemaCode:t})=>(0,Pt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Pt._)`{format: ${t}}`},uKe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:lKe,code(t,e){let{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():p();function f(){let m=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,Pt._)`${m}[${s}]`),g=r.let("fType"),b=r.let("format");r.if((0,Pt._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,Pt._)`${h}.type || "string"`).assign(b,(0,Pt._)`${h}.validate`),()=>r.assign(g,(0,Pt._)`"string"`).assign(b,h)),t.fail$data((0,Pt.or)(_(),S()));function _(){return c.strictSchema===!1?Pt.nil:(0,Pt._)`${s} && !${b}`}function S(){let x=u.$async?(0,Pt._)`(${h}.async ? await ${b}(${n}) : ${b}(${n}))`:(0,Pt._)`${b}(${n})`,w=(0,Pt._)`(typeof ${b} == "function" ? ${x} : ${b}.test(${n}))`;return(0,Pt._)`${b} && ${b} !== true && ${g} === ${e} && !${w}`}}function p(){let m=d.formats[o];if(!m){_();return}if(m===!0)return;let[h,g,b]=S(m);h===e&&t.pass(x());function _(){if(c.strictSchema===!1){d.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function S(w){let O=w instanceof RegExp?(0,Pt.regexpCode)(w):c.code.formats?(0,Pt._)`${c.code.formats}${(0,Pt.getProperty)(o)}`:void 0,T=r.scopeValue("formats",{key:o,ref:w,code:O});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,Pt._)`${T}.validate`]:["string",w,T]}function x(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Pt._)`await ${b}(${n})`}return typeof g=="function"?(0,Pt._)`${b}(${n})`:(0,Pt._)`${b}.test(${n})`}}}};hq.default=uKe});var Ile=v(gq=>{"use strict";Object.defineProperty(gq,"__esModule",{value:!0});var dKe=Rle(),fKe=[dKe.default];gq.default=fKe});var Ple=v(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.contentVocabulary=Vd.metadataVocabulary=void 0;Vd.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Vd.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Dle=v(yq=>{"use strict";Object.defineProperty(yq,"__esModule",{value:!0});var pKe=Uce(),mKe=tle(),hKe=Ole(),gKe=Ile(),Cle=Ple(),yKe=[pKe.default,mKe.default,(0,hKe.default)(),gKe.default,Cle.metadataVocabulary,Cle.contentVocabulary];yq.default=yKe});var jle=v(oA=>{"use strict";Object.defineProperty(oA,"__esModule",{value:!0});oA.DiscrError=void 0;var Nle;(function(t){t.Tag="tag",t.Mapping="mapping"})(Nle||(oA.DiscrError=Nle={}))});var Fle=v(bq=>{"use strict";Object.defineProperty(bq,"__esModule",{value:!0});var Wd=we(),_q=jle(),Mle=qE(),_Ke=Hg(),bKe=Ne(),vKe={message:({params:{discrError:t,tagName:e}})=>t===_q.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Wd._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},SKe={keyword:"discriminator",type:"object",schemaType:"object",error:vKe,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:o}=t,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,Wd._)`${r}${(0,Wd.getProperty)(a)}`);e.if((0,Wd._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:_q.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let p=f();e.if(!1);for(let m in p)e.elseIf((0,Wd._)`${l} === ${m}`),e.assign(c,d(p[m]));e.else(),t.error(!1,{discrError:_q.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let m=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:p},m);return t.mergeEvaluated(h,Wd.Name),m}function f(){var p;let m={},h=b(i),g=!0;for(let x=0;x{wKe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Sq=v((pt,vq)=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.MissingRefError=pt.ValidationError=pt.CodeGen=pt.Name=pt.nil=pt.stringify=pt.str=pt._=pt.KeywordCxt=pt.Ajv=void 0;var xKe=Nce(),$Ke=Dle(),kKe=Fle(),zle=Lle(),EKe=["/properties"],sA="http://json-schema.org/draft-07/schema",Kd=class extends xKe.default{_addVocabularies(){super._addVocabularies(),$Ke.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(kKe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(zle,EKe):zle;this.addMetaSchema(e,sA,!1),this.refs["http://json-schema.org/schema"]=sA}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(sA)?sA:void 0)}};pt.Ajv=Kd;vq.exports=pt=Kd;vq.exports.Ajv=Kd;Object.defineProperty(pt,"__esModule",{value:!0});pt.default=Kd;var AKe=Bg();Object.defineProperty(pt,"KeywordCxt",{enumerable:!0,get:function(){return AKe.KeywordCxt}});var Jd=we();Object.defineProperty(pt,"_",{enumerable:!0,get:function(){return Jd._}});Object.defineProperty(pt,"str",{enumerable:!0,get:function(){return Jd.str}});Object.defineProperty(pt,"stringify",{enumerable:!0,get:function(){return Jd.stringify}});Object.defineProperty(pt,"nil",{enumerable:!0,get:function(){return Jd.nil}});Object.defineProperty(pt,"Name",{enumerable:!0,get:function(){return Jd.Name}});Object.defineProperty(pt,"CodeGen",{enumerable:!0,get:function(){return Jd.CodeGen}});var TKe=zE();Object.defineProperty(pt,"ValidationError",{enumerable:!0,get:function(){return TKe.default}});var OKe=Hg();Object.defineProperty(pt,"MissingRefError",{enumerable:!0,get:function(){return OKe.default}})});var Wle=v(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.formatNames=so.fastFormats=so.fullFormats=void 0;function oo(t,e){return{validate:t,compare:e}}so.fullFormats={date:oo(Hle,kq),time:oo(xq(!0),Eq),"date-time":oo(Ule(!0),Zle),"iso-time":oo(xq(),Gle),"iso-date-time":oo(Ule(),Vle),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:NKe,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:qKe,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:jKe,int32:{type:"number",validate:LKe},int64:{type:"number",validate:zKe},float:{type:"number",validate:Ble},double:{type:"number",validate:Ble},password:!0,binary:!0};so.fastFormats={...so.fullFormats,date:oo(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,kq),time:oo(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Eq),"date-time":oo(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Zle),"iso-time":oo(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Gle),"iso-date-time":oo(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Vle),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};so.formatNames=Object.keys(so.fullFormats);function RKe(t){return t%4===0&&(t%100!==0||t%400===0)}var IKe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,PKe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Hle(t){let e=IKe.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&RKe(r)?29:PKe[n])}function kq(t,e){if(t&&e)return t>e?1:t23||u>59||t&&!a)return!1;if(i<=23&&o<=59&&s<60)return!0;let d=o-u*c,f=i-l*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&s<61}}function Eq(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function Gle(t,e){if(!(t&&e))return;let r=wq.exec(t),n=wq.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=MKe}function zKe(t){return Number.isInteger(t)}function Ble(){return!0}var UKe=/[^\\]\\Z/;function qKe(t){if(UKe.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Kle=v(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.formatLimitDefinition=void 0;var BKe=Sq(),Si=we(),sa=Si.operators,aA={formatMaximum:{okStr:"<=",ok:sa.LTE,fail:sa.GT},formatMinimum:{okStr:">=",ok:sa.GTE,fail:sa.LT},formatExclusiveMaximum:{okStr:"<",ok:sa.LT,fail:sa.GTE},formatExclusiveMinimum:{okStr:">",ok:sa.GT,fail:sa.LTE}},HKe={message:({keyword:t,schemaCode:e})=>(0,Si.str)`should be ${aA[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Si._)`{comparison: ${aA[t].okStr}, limit: ${e}}`};Yd.formatLimitDefinition={keyword:Object.keys(aA),type:"string",schemaType:"string",$data:!0,error:HKe,code(t){let{gen:e,data:r,schemaCode:n,keyword:i,it:o}=t,{opts:s,self:a}=o;if(!s.validateFormats)return;let c=new BKe.KeywordCxt(o,a.RULES.all.format.definition,"format");c.$data?l():u();function l(){let f=e.scopeValue("formats",{ref:a.formats,code:s.code.formats}),p=e.const("fmt",(0,Si._)`${f}[${c.schemaCode}]`);t.fail$data((0,Si.or)((0,Si._)`typeof ${p} != "object"`,(0,Si._)`${p} instanceof RegExp`,(0,Si._)`typeof ${p}.compare != "function"`,d(p)))}function u(){let f=c.schema,p=a.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${i}": format "${f}" does not define "compare" function`);let m=e.scopeValue("formats",{key:f,ref:p,code:s.code.formats?(0,Si._)`${s.code.formats}${(0,Si.getProperty)(f)}`:void 0});t.fail$data(d(m))}function d(f){return(0,Si._)`${f}.compare(${r}, ${n}) ${aA[i].fail} 0`}},dependencies:["format"]};var GKe=t=>(t.addKeyword(Yd.formatLimitDefinition),t);Yd.default=GKe});var Qle=v((iy,Xle)=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});var Xd=Wle(),ZKe=Kle(),Aq=we(),Jle=new Aq.Name("fullFormats"),VKe=new Aq.Name("fastFormats"),Tq=(t,e={keywords:!0})=>{if(Array.isArray(e))return Yle(t,e,Xd.fullFormats,Jle),t;let[r,n]=e.mode==="fast"?[Xd.fastFormats,VKe]:[Xd.fullFormats,Jle],i=e.formats||Xd.formatNames;return Yle(t,i,r,n),e.keywords&&(0,ZKe.default)(t),t};Tq.get=(t,e="full")=>{let n=(e==="fast"?Xd.fastFormats:Xd.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function Yle(t,e,r,n){var i,o;(i=(o=t.opts.code).formats)!==null&&i!==void 0||(o.formats=(0,Aq._)`require("ajv-formats/dist/formats").${n}`);for(let s of e)t.addFormat(s,r[s])}Xle.exports=iy=Tq;Object.defineProperty(iy,"__esModule",{value:!0});iy.default=Tq});function WKe(){let t=new eue.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,tue.default)(t),t}var eue,tue,cA,rue=y(()=>{eue=St(Sq(),1),tue=St(Qle(),1);cA=class{constructor(e){this._ajv=e??WKe()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var lA,nue=y(()=>{Nc();lA=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],o=Array.isArray(i.content)?i.content:[i.content],s=o.some(u=>u.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],l=c.some(u=>u.type==="tool_use");if(s){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let u=new Set(c.filter(f=>f.type==="tool_use").map(f=>f.id)),d=new Set(o.filter(f=>f.type==="tool_result").map(f=>f.toolUseId));if(u.size!==d.size||![...u].every(f=>d.has(f)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},Tg,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),i=e.mode??"form";switch(i){case"url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=i==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},Dd,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}}});function iue(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function oue(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var sue=y(()=>{});var uA,aue=y(()=>{lae();Nc();rue();rg();nue();sue();uA=class extends AE{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Ag.options.map((n,i)=>[n,i])),this.isMessageIgnored=(n,i)=>{let o=this._loggingLevels.get(i);return o?this.LOG_LEVEL_SEVERITY.get(n)this._oninitialize(n)),this.setNotificationHandler(Uz,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Jz,async(n,i)=>{let o=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=Ag.safeParse(s);return a.success&&this._loggingLevels.set(o,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new lA(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=cae(this._capabilities,e)}setRequestHandler(e,r){let i=Ws(e)?.method;if(!i)throw new Error("Schema is missing a method literal");let o;if(Ln(i)){let a=i;o=a._zod?.def?.value??a.value}else{let a=i;o=a._def?.value??a.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let a=async(c,l)=>{let u=Vs(Cd,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new ie(ae.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=Vs(Id,f);if(!m.success){let h=m.error instanceof Error?m.error.message:String(m.error);throw new ie(ae.InvalidParams,`Invalid task creation result: ${h}`)}return m.data}let p=Vs(hE,f);if(!p.success){let m=p.error instanceof Error?p.error.message:String(p.error);throw new ie(ae.InvalidParams,`Invalid tools/call result: ${m}`)}return p.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){oue(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&iue(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:cse.includes(r)?r:Nz,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Qk)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],i=Array.isArray(n.content)?n.content:[n.content],o=i.some(l=>l.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(l=>l.type==="tool_use");if(o){if(i.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let l=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),u=new Set(i.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(l.size!==u.size||![...l].every(d=>u.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},Yz,r):this.request({method:"sampling/createMessage",params:e},Tg,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let i=e;return this.request({method:"elicitation/create",params:i},Dd,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let i=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:i},Dd,r);if(o.action==="accept"&&o.content&&i.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(i.requestedSchema)(o.content);if(!a.valid)throw new ie(ae.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof ie?s:new ie(ae.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},Xz,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function Oq(t){return!!t&&typeof t=="object"&&lue in t}function uue(t){return t[lue]?.complete}var lue,cue,due=y(()=>{lue=Symbol.for("mcp.completable");(function(t){t.Completable="McpCompletable"})(cue||(cue={}))});var fue=y(()=>{});function JKe(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!KKe.test(t)){let r=t.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,i,o)=>o.indexOf(n)===i);return e.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function YKe(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function Rq(t){let e=JKe(t);return YKe(t,e.warnings),e.isValid}var KKe,pue=y(()=>{KKe=/^[A-Za-z0-9._-]{1,128}$/});var dA,mue=y(()=>{dA=class{constructor(e){this._mcpServer=e}registerToolTask(e,r,n){let i={taskSupport:"required",...r.execution};if(i.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,i,r._meta,n)}}});var Iq=y(()=>{Kk();Kk()});function yue(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function _ue(t){return"_def"in t||"_zod"in t||yue(t)}function Pq(t){return typeof t!="object"||t===null||_ue(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(yue)}function hue(t){if(t){if(Pq(t))return Cc(t);if(!_ue(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function QKe(t){let e=Ws(t);return e?Object.entries(e).map(([r,n])=>{let i=qie(n),o=Bie(n);return{name:r,description:i,required:!o}}):[]}function aa(t){let r=Ws(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=_k(r);if(typeof n=="string")return n;throw new Error("Schema method literal must be a string")}function gue(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var fA,XKe,oy,bue=y(()=>{aue();rg();N2();Nc();due();fue();pue();mue();Iq();fA=class{constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new uA(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new dA(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(aa(mE)),this.server.assertCanSetRequestHandler(aa(Cd)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(mE,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let n={name:e,title:r.title,description:r.description,inputSchema:(()=>{let i=vd(r.inputSchema);return i?P2(i,{strictUnions:!0,pipeStrategy:"input"}):XKe})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let i=vd(r.outputSchema);i&&(n.outputSchema=P2(i,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Cd,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new ie(ae.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new ie(ae.InvalidParams,`Tool ${e.params.name} disabled`);let i=!!e.params.task,o=n.execution?.taskSupport,s="createTask"in n.handler;if((o==="required"||o==="optional")&&!s)throw new ie(ae.InternalError,`Tool ${e.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!i)throw new ie(ae.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!i&&s)return await this.handleAutomaticTaskPolling(n,e,r);let a=await this.validateToolInput(n,e.params.arguments,e.params.name),c=await this.executeToolHandler(n,a,r);return i||await this.validateToolOutput(n,c,e.params.name),c}catch(n){if(n instanceof ie&&n.code===ae.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,n){if(!e.inputSchema)return;let o=vd(e.inputSchema)??e.inputSchema,s=await gk(o,r);if(!s.success){let a="error"in s?s.error:"Unknown error",c=yk(a);throw new ie(ae.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${c}`)}return s.data}async validateToolOutput(e,r,n){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new ie(ae.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let i=vd(e.outputSchema),o=await gk(i,r.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",a=yk(s);throw new ie(ae.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${a}`)}}async executeToolHandler(e,r,n){let i=e.handler;if("createTask"in i){if(!n.taskStore)throw new Error("No task store provided.");let s={...n,taskStore:n.taskStore};if(e.inputSchema){let a=i;return await Promise.resolve(a.createTask(r,s))}else{let a=i;return await Promise.resolve(a.createTask(s))}}if(e.inputSchema){let s=i;return await Promise.resolve(s(r,n))}else{let s=i;return await Promise.resolve(s(n))}}async handleAutomaticTaskPolling(e,r,n){if(!n.taskStore)throw new Error("No task store provided for task-capable tool.");let i=await this.validateToolInput(e,r.params.arguments,r.params.name),o=e.handler,s={...n,taskStore:n.taskStore},a=i?await Promise.resolve(o.createTask(i,s)):await Promise.resolve(o.createTask(s)),c=a.task.taskId,l=a.task,u=l.pollInterval??5e3;for(;l.status!=="completed"&&l.status!=="failed"&&l.status!=="cancelled";){await new Promise(f=>setTimeout(f,u));let d=await n.taskStore.getTask(c);if(!d)throw new ie(ae.InternalError,`Task ${c} not found during polling`);l=d}return await n.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(aa(gE)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(gE,async e=>{switch(e.params.ref.type){case"ref/prompt":return $se(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return kse(e),this.handleResourceCompletion(e,e.params.ref);default:throw new ie(ae.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new ie(ae.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new ie(ae.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return oy;let o=Ws(n.argsSchema)?.[e.params.argument.name];if(!Oq(o))return oy;let s=uue(o);if(!s)return oy;let a=await s(e.params.argument.value,e.params.context);return gue(a)}async handleResourceCompletion(e,r){let n=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return oy;throw new ie(ae.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let i=n.resourceTemplate.completeCallback(e.params.argument.name);if(!i)return oy;let o=await i(e.params.argument.value,e.params.context);return gue(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(aa(lE)),this.server.assertCanSetRequestHandler(aa(uE)),this.server.assertCanSetRequestHandler(aa(dE)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(lE,async(e,r)=>{let n=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),i=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(r);for(let a of s.resources)i.push({...o.metadata,...a})}return{resources:[...n,...i]}}),this.server.setRequestHandler(uE,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,n])=>({name:r,uriTemplate:n.resourceTemplate.uriTemplate.toString(),...n.metadata}))})),this.server.setRequestHandler(dE,async(e,r)=>{let n=new URL(e.params.uri),i=this._registeredResources[n.toString()];if(i){if(!i.enabled)throw new ie(ae.InvalidParams,`Resource ${n} disabled`);return i.readCallback(n,r)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(n.toString());if(s)return o.readCallback(n,s,r)}throw new ie(ae.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(aa(fE)),this.server.assertCanSetRequestHandler(aa(pE)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(fE,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?QKe(r.argsSchema):void 0}))})),this.server.setRequestHandler(pE,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new ie(ae.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new ie(ae.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let i=vd(n.argsSchema),o=await gk(i,e.params.arguments);if(!o.success){let c="error"in o?o.error:"Unknown error",l=yk(c);throw new ie(ae.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${l}`)}let s=o.data,a=n.callback;return await Promise.resolve(a(s,r))}else{let i=n.callback;return await Promise.resolve(i(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...n){let i;typeof n[0]=="object"&&(i=n.shift());let o=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,void 0,r,i,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,r,i,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,r,n,i){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let o=this._createRegisteredResource(e,n.title,r,n,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,n.title,r,n,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(e,r,n,i,o){let s={name:e,title:r,metadata:i,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:a=>{typeof a.uri<"u"&&a.uri!==n&&(delete this._registeredResources[n],a.uri&&(this._registeredResources[a.uri]=s)),typeof a.name<"u"&&(s.name=a.name),typeof a.title<"u"&&(s.title=a.title),typeof a.metadata<"u"&&(s.metadata=a.metadata),typeof a.callback<"u"&&(s.readCallback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[n]=s,s}_createRegisteredResourceTemplate(e,r,n,i,o){let s={resourceTemplate:n,title:r,metadata:i,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredResourceTemplates[e],l.name&&(this._registeredResourceTemplates[l.name]=s)),typeof l.title<"u"&&(s.title=l.title),typeof l.template<"u"&&(s.resourceTemplate=l.template),typeof l.metadata<"u"&&(s.metadata=l.metadata),typeof l.callback<"u"&&(s.readCallback=l.callback),typeof l.enabled<"u"&&(s.enabled=l.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let a=n.uriTemplate.variableNames;return Array.isArray(a)&&a.some(l=>!!n.completeCallback(l))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,r,n,i,o){let s={title:r,description:n,argsSchema:i===void 0?void 0:Cc(i),callback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{typeof a.name<"u"&&a.name!==e&&(delete this._registeredPrompts[e],a.name&&(this._registeredPrompts[a.name]=s)),typeof a.title<"u"&&(s.title=a.title),typeof a.description<"u"&&(s.description=a.description),typeof a.argsSchema<"u"&&(s.argsSchema=Cc(a.argsSchema)),typeof a.callback<"u"&&(s.callback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=s,i&&Object.values(i).some(c=>{let l=c instanceof Od?c._def?.innerType:c;return Oq(l)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(e,r,n,i,o,s,a,c,l){Rq(e);let u={title:r,description:n,inputSchema:hue(i),outputSchema:hue(o),annotations:s,execution:a,_meta:c,handler:l,enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==e&&(typeof d.name=="string"&&Rq(d.name),delete this._registeredTools[e],d.name&&(this._registeredTools[d.name]=u)),typeof d.title<"u"&&(u.title=d.title),typeof d.description<"u"&&(u.description=d.description),typeof d.paramsSchema<"u"&&(u.inputSchema=Cc(d.paramsSchema)),typeof d.outputSchema<"u"&&(u.outputSchema=Cc(d.outputSchema)),typeof d.callback<"u"&&(u.handler=d.callback),typeof d.annotations<"u"&&(u.annotations=d.annotations),typeof d._meta<"u"&&(u._meta=d._meta),typeof d.enabled<"u"&&(u.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=u,this.setToolRequestHandlers(),this.sendToolListChanged(),u}tool(e,...r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let n,i,o,s;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let c=r[0];if(Pq(c))i=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!Pq(r[0])&&(s=r.shift());else if(typeof c=="object"&&c!==null){if(Object.values(c).some(l=>typeof l=="object"&&l!==null))throw new Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=r.shift()}}let a=r[0];return this._createRegisteredTool(e,void 0,n,i,o,s,{taskSupport:"forbidden"},void 0,a)}registerTool(e,r,n){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:i,description:o,inputSchema:s,outputSchema:a,annotations:c,_meta:l}=r;return this._createRegisteredTool(e,i,o,s,a,c,{taskSupport:"forbidden"},l,n)}prompt(e,...r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let i;r.length>1&&(i=r.shift());let o=r[0],s=this._createRegisteredPrompt(e,void 0,n,i,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,r,n){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:i,description:o,argsSchema:s}=r,a=this._createRegisteredPrompt(e,i,o,s,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},XKe={type:"object",properties:{}};oy={completion:{values:[],hasMore:!1}}});import{readFileSync as eJe,existsSync as Sue}from"node:fs";import{dirname as tJe,join as pA}from"node:path";import{fileURLToPath as rJe}from"node:url";function sy(t,e){let r=iJe[t];r&&process.stderr.write(`cladding: persona '${t}' is now '${r}' \u2014 the old id is removed in 0.8 `);let n=r??t,i=oJe(n,e),o=vue.get(i);if(o)return o;if(!Sue(i))throw new Error(`agents/${n}.md not found at ${i}`);let s=sJe(n,eJe(i,"utf8"));return vue.set(i,s),s}function oJe(t,e){if(e)return pA(e,"agents",`${t}.md`);let r=tJe(rJe(import.meta.url)),n=[pA(r,`${t}.md`),pA(r,"agents",`${t}.md`),pA(r,"..","plugins","claude-code","agents",`${t}.md`)];return n.find(i=>Sue(i))??n[1]}function sJe(t,e){let{frontmatter:r,body:n}=aJe(e),i=cJe(r.capabilities);return{id:r.name??t,body:n.trim(),capabilities:i}}function aJe(t){if(!t.startsWith(`--- `))return{frontmatter:{},body:t};let e=t.indexOf(` --- @@ -643,8 +643,8 @@ name: ${i} `))}catch{return"failed"}}function aCe(t){try{let e=oi(t),r=e==null?{}:JSON.parse(e),n=r.permissions;if(n!==void 0&&(typeof n!="object"||n===null||Array.isArray(n)))return"skipped-different";let i=n??{},o=i.allow;if(o!==void 0&&(!Array.isArray(o)||o.some(u=>typeof u!="string")))return"skipped-different";let s=i.deny;if(s!==void 0&&(!Array.isArray(s)||s.some(u=>typeof u!="string")))return"skipped-different";let a=o??[],c=s??[],l=[...a];for(let u of ZPe)l.includes(u)||l.push(u);return l.length===a.length&&s!==void 0?"unchanged":(i.allow=l,i.deny=c,r.permissions=i,Qa(t,`${JSON.stringify(r,null,2)} `))}catch{return"failed"}}async function cCe(t,e,r){try{let{parse:n,stringify:i}=await Promise.resolve().then(()=>(UC(),zC)),o=oi(t),s=o==null?{}:n(o);(!s.mcp_servers||typeof s.mcp_servers!="object")&&(s.mcp_servers={});let a=s.mcp_servers,c=a.cladding,l={command:e.command,args:e.args,description:"cladding MCP server (project-scoped by `clad setup`)",default_tools_approval_mode:"writes"};return JSON.stringify(c)===JSON.stringify(l)?"unchanged":c&&!r&&!Hp(c,[])?"skipped-different":(a.cladding=l,Qa(t,i(s)))}catch{return"failed"}}function lCe(t){let e=["---","description: Cladding bootstrap boundary","alwaysApply: true","---","","Cladding is available only in this project. Do not initialize or invoke Cladding for ordinary work.","Use the cladding-init skill only when the user explicitly names Cladding and asks to initialize, adopt, or refresh it.",""].join(` `);return Qa(he(t,".cursor","rules","cladding-bootstrap.mdc"),e)}function Vl(t){return t.includes("failed")?"failed":t.includes("skipped-different")?"skipped-different":t.includes("manual-required")?"manual-required":t.includes("removed")?"removed":t.includes("rewired")?"rewired":t.includes("created")?"created":"unchanged"}function NY(t){try{return JSON.parse(_S(t,"utf8")).cladding_version??null}catch{return null}}function OY(t,e,r,n){t==="failed"&&r.push({step:e,message:"project wiring failed"}),t==="skipped-different"&&n.push({step:e,message:"existing non-Cladding configuration was preserved; use --force to replace only the cladding entry"}),t==="manual-required"&&n.push({step:e,message:"run `claude plugin uninstall claude-code@cladding --scope user --keep-data` to remove the legacy user plugin"})}async function ZC(t={}){let e=t.home??IY(),r=Ss(t.projectRoot??process.cwd()),n=t.pkgRoot??jY(),i=t.version??MY(n),o=dCe(e),s=new Set(t.hosts??GPe.filter(K=>o[K])),a=t.force??!1,c=he(r,".cladding",BC),l=NY(c),u=[],d=[];hS(r),oCe(r);let f=[Qa(he(r,HC),nCe(n))];s.has("gemini")&&f.push(Qa(he(r,GC),iCe()));let p=Vl(f),m=he(n,"plugins","codex","skills","init"),h=s.has("codex")||s.has("gemini")||s.has("antigravity")?qC(m,he(r,".agents","skills","cladding-init"),a):"unchanged",g=sCe(),b=WPe(e,n),_=yS(he(e,".claude","plugins","cladding"),b),S=_==="removed"?rCe(t.activate??!0):"unchanged",x={claude_plugin:Vl([_,S]),gemini_extension:yS(he(e,".gemini","extensions","cladding"),b),antigravity_plugin:eCe(e,b),codex_skills:KPe(e,b),codex_mcp:await YPe(e,b),cursor_mcp:XPe(e,b)},w=s.has("codex")?await cCe(he(r,".codex","config.toml"),g,a):"skipped-not-selected",O=s.has("gemini")?Bp(he(r,".gemini","settings.json"),g,a):"skipped-not-selected",T=s.has("antigravity")?Vl([Bp(he(r,".agents","mcp_config.json"),g,a),QPe(e,n,a)]):"skipped-not-selected",A=s.has("claude")?Vl([qC(m,he(r,".claude","skills","cladding-init"),a),Bp(he(r,".mcp.json"),g,a)]):"skipped-not-selected",D=s.has("cursor")?Vl([qC(m,he(r,".cursor","skills","cladding-init"),a),Bp(he(r,".cursor","mcp.json"),g,a),aCe(he(r,".cursor","cli.json")),lCe(r)]):"skipped-not-selected",$={runtime:p,shared_init_skill:h,claude:A,codex:w,gemini:O,antigravity:T,cursor:D};s.size===0&&d.push({step:"hosts",message:"no supported AI host detected on this machine \u2014 only the shared runtime was written; use `clad setup --host ` to wire explicitly"});for(let[K,xe]of Object.entries($))OY(xe,K,u,d);for(let[K,xe]of Object.entries(x))OY(xe,`legacy:${K}`,u,d);hS(vs(c)),Xa(c,`${JSON.stringify({project_root:r,cladding_root:n,cladding_version:i,last_run:new Date().toISOString()},null,2)} -`,"utf8");let ie={projectRoot:r,wiring:$,legacyCleanup:x,errors:u,warnings:d,statusFile:c,cladding_root:n,cladding_version:i,last_setup_version:l};return t.quiet||process.stdout.write(`${uCe(ie)} -`),ie}function qp(t){switch(t){case"created":return"wired";case"rewired":return"updated";case"unchanged":return"already ready";case"removed":return"legacy global removed";case"skipped-not-selected":return"not selected";case"skipped-different":return"preserved conflict";case"manual-required":return"manual cleanup required";default:return"failed"}}function uCe(t,e){let r=[`cladding setup \u2014 project activation: ${t.projectRoot}`,"",` Claude Code \u2192 ${qp(t.wiring.claude)}`,` Codex \u2192 ${qp(t.wiring.codex)}`,` Gemini CLI \u2192 ${qp(t.wiring.gemini)}`,` Antigravity \u2192 ${qp(t.wiring.antigravity)}`,` Cursor \u2192 ${qp(t.wiring.cursor)}`];(t.wiring.antigravity==="created"||t.wiring.antigravity==="rewired")&&r.push(""," Note: Antigravity reads MCP config machine-wide only, so its wire lives in ~/.gemini/config/plugins/cladding (each session still resolves the project from its working directory).");let n=Object.values(t.legacyCleanup).filter(i=>i==="removed").length;n>0&&r.push("",`Removed ${n} legacy global Cladding wire(s).`);for(let i of t.warnings)r.push(` ! ${i.step}: ${i.message}`);return r.push("","Next steps:"," 1. Start a new AI session in this project directory",' 2. Ask: "Apply Cladding to this project"'," 3. Review the preview and reply with its exact approval phrase"," 4. After initialization, develop normally in natural language"),r.join(` +`,"utf8");let re={projectRoot:r,wiring:$,legacyCleanup:x,errors:u,warnings:d,statusFile:c,cladding_root:n,cladding_version:i,last_setup_version:l};return t.quiet||process.stdout.write(`${uCe(re)} +`),re}function qp(t){switch(t){case"created":return"wired";case"rewired":return"updated";case"unchanged":return"already ready";case"removed":return"legacy global removed";case"skipped-not-selected":return"not selected";case"skipped-different":return"preserved conflict";case"manual-required":return"manual cleanup required";default:return"failed"}}function uCe(t,e){let r=[`cladding setup \u2014 project activation: ${t.projectRoot}`,"",` Claude Code \u2192 ${qp(t.wiring.claude)}`,` Codex \u2192 ${qp(t.wiring.codex)}`,` Gemini CLI \u2192 ${qp(t.wiring.gemini)}`,` Antigravity \u2192 ${qp(t.wiring.antigravity)}`,` Cursor \u2192 ${qp(t.wiring.cursor)}`];(t.wiring.antigravity==="created"||t.wiring.antigravity==="rewired")&&r.push(""," Note: Antigravity reads MCP config machine-wide only, so its wire lives in ~/.gemini/config/plugins/cladding (each session still resolves the project from its working directory).");let n=Object.values(t.legacyCleanup).filter(i=>i==="removed").length;n>0&&r.push("",`Removed ${n} legacy global Cladding wire(s).`);for(let i of t.warnings)r.push(` ! ${i.step}: ${i.message}`);return r.push("","Next steps:"," 1. Start a new AI session in this project directory",' 2. Ask: "Apply Cladding to this project"'," 3. Review the preview and reply with its exact approval phrase"," 4. After initialization, develop normally in natural language"),r.join(` `)}function jY(){let t=HPe(import.meta.url),e=vs(t);for(let r=0;r<7;r++){try{if(JSON.parse(_S(he(e,"package.json"),"utf8")).name==="cladding")return e}catch{}e=vs(e)}return Ss(vs(t),"..")}function MY(t){try{return JSON.parse(_S(he(t,"package.json"),"utf8")).version??"unknown"}catch{return"unknown"}}function Wl(){let t=MY(jY());return t==="unknown"?null:t}function FY(t=process.cwd()){return NY(he(Ss(t),".cladding",BC))}function dCe(t=IY()){return{claude:In(he(t,".claude")),gemini:In(he(t,".gemini")),antigravity:In(he(t,".gemini","config"))||In(he(t,".gemini","antigravity-cli")),codex:In(he(t,".codex")),agents:In(he(t,".agents")),cursor:In(he(t,".cursor"))}}Be();Oi();var mCe=["claude","gemini","antigravity","codex","cursor"],Eo={"list-features":{pattern:/F-[0-9a-f]{6,8}/,label:"a real feature id (F-xxxxxx)"},"get-feature":{pattern:/F-[0-9a-f]{6,8}/,label:"the queried feature id echoed"},"run-check":{pattern:/\b[Dd]rift\b|\b[Ff]indings?\b|\bGREEN\b|\bRED\b/,label:"a drift verdict (drift/findings/GREEN/RED)"}};function Kl(t,e=200){let r=t.replace(/\s+/g," ").trim();return r.length<=e?r:r.slice(-e)}function hCe(t,e,r){if(/\b(?:MCP|tool|clad_[a-z0-9_]+)(?:\s+tool)?(?:\s+calls?)?[^.\n]{0,80}\b(?:rejected|denied|refused|cancelled|canceled|not approved)\b|\buser cancelle?d MCP tool call\b|\bno tool payload\b|\bdon't have a findings count\b|\bre-approve the cladding MCP tool\b/i.test(e))return{result:"fail",sentinel:Eo[t].label,evidence:Kl(e)};let i=Eo[t].pattern,o=Eo[t].label;return t==="get-feature"&&r&&(i=new RegExp(r),o=`the queried id ${r} echoed`),{result:i.test(e)?"pass":"fail",sentinel:o,evidence:Kl(e)}}var gCe={"list-features":()=>"Call the clad_list_features MCP tool and print exactly one feature id (format F-xxxxxxxx) from the result, nothing else.","get-feature":t=>`Call the clad_get_feature MCP tool for id ${t} and print that id verbatim.`,"run-check":()=>"Call the clad_run_check MCP tool and print the number of findings plus the word 'findings'."};function yCe(t,e){switch(t){case"claude":return{command:"claude",args:["-p",e,"--output-format","text","--settings",'{"enableAllProjectMcpServers":true}']};case"gemini":return{command:"gemini",args:["--skip-trust","--approval-mode","plan","--policy",GC,"--allowed-mcp-server-names","cladding","-o","text","-p",e]};case"antigravity":return{command:"agy",args:["--dangerously-skip-permissions","-p",e]};case"codex":return{command:"codex",args:["exec","--dangerously-bypass-approvals-and-sandbox",e]};case"cursor":return{command:"cursor-agent",args:["-p","--mode","ask","--trust","--approve-mcps",e]}}}function _Ce(t){return t==="antigravity"?"agy":t==="cursor"?"cursor-agent":t}var LY={"list-features":12e4,"get-feature":12e4,"run-check":3e5},bCe=1e4;function vCe(t){let e=KC()==="win32"?"where":"which";return WC(e,[t],{stdio:"ignore"}).status===0}function SCe(t,e,r){let n=WC(t,[...e],{cwd:r.cwd,encoding:"utf8",timeout:r.timeoutMs,shell:KC()==="win32"});return{stdout:n.stdout??"",stderr:n.stderr??"",timedOut:n.signal==="SIGTERM"||n.error?.code==="ETIMEDOUT",code:n.status}}function wCe(t,e,r){let n=JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2024-11-05",capabilities:{},clientInfo:{name:"clad-doctor-hosts",version:"1"}}}),i=JSON.stringify({jsonrpc:"2.0",method:"notifications/initialized"}),o=JSON.stringify({jsonrpc:"2.0",id:2,method:"tools/list",params:{}}),s=`${n} ${i} ${o} @@ -815,10 +815,10 @@ ${r} `),!0}function oUe(t){let e=_c(t,".github","workflows","cladding.yml");return Gm(e)?"exists":(wx(_c(t,".github","workflows"),{recursive:!0}),Zm(e,["# Cladding \xB7 authoritative gate \u2014 scaffolded by `clad init --with-ci`.","# Local git hooks reduce latency; THIS check (as a required status check","# under branch protection) is where enforcement is real.","name: cladding gate","on:"," push:"," pull_request:","jobs:"," gate:"," runs-on: ubuntu-latest"," steps:"," - uses: actions/checkout@v4"," with:"," fetch-depth: 0 # history-aware detectors (attestation/staleness) need more than a shallow clone"," - uses: actions/setup-node@v4"," with: {node-version: 22}"," - run: npm ci || npm install"," - run: npx --yes cladding check --tier=pre-push --strict --json",""].join(` `),"utf8"),"created")}function sUe(t,e){return t==null?"host channels not wired yet \u2014 run `clad setup`, restart your AI tool, then ask it to apply Cladding to this project":e&&t!==e?`this project's host wiring was set up at v${t} (current binary v${e}) \u2014 run \`clad setup\` in this project to refresh its local runtime`:null}async function dj(t={}){let e=t.cwd??".",r=t.force??!1,n=[],i=[],o=dt(e).language,s=o==="unknown"?"typescript":o,a=t.scan===!1?null:yx({cwd:e,roots:t.roots}),l=a!==null&&(t.scan===!0||a.stats.filesScanned>=3),u=a&&a.stats.dominantLanguage!=="unknown"&&a.stats.dominantLanguage!=="other"?a.stats.dominantLanguage:s,d=t.projectName??xx(Tee(e)),f=t.intent?.trim(),p=f;if(f&&f.length>0){let $=Eee(f,e);$.warning&&process.stderr.write(`[clad init] ${$.warning} `),$.loadedFrom&&process.stderr.write(`[clad init] loaded intent from ${$.loadedFrom} -`),p=$.intent}let m=null,h=t.hostDispatcher??qm({noLlm:t.noLlm});if(p&&p.length>0){let $={cwdBasename:xx(Tee(e)),language:u,sourceFileCount:a?.stats.filesScanned??0,readmePresent:!!a?.projectContext?.readmeFirstParagraph,readmeFirstParagraph:a?.projectContext?.readmeFirstParagraph??null,projectName:d};m=await lee(p,$,h,e);let ie={intent:p,language:u,projectName:d,mode:m.mode,startedAt:new Date().toISOString(),status:m.clarifyingQuestions.length===0?"done":"active",qa:m.clarifyingQuestions.map(K=>({question:K,answer:null}))};yc(e,ie),m.source!=="llm"&&(t.noLlm?process.stderr.write(`[clad init] \u2139 deterministic mode (--no-llm): spec/scenarios are stubs derived from the intent verbatim (scenarios empty). Re-run without --no-llm \u2014 or use 'clad clarify' \u2014 for domain-aware generation. +`),p=$.intent}let m=null,h=t.hostDispatcher??qm({noLlm:t.noLlm});if(p&&p.length>0){let $={cwdBasename:xx(Tee(e)),language:u,sourceFileCount:a?.stats.filesScanned??0,readmePresent:!!a?.projectContext?.readmeFirstParagraph,readmeFirstParagraph:a?.projectContext?.readmeFirstParagraph??null,projectName:d};m=await lee(p,$,h,e);let re={intent:p,language:u,projectName:d,mode:m.mode,startedAt:new Date().toISOString(),status:m.clarifyingQuestions.length===0?"done":"active",qa:m.clarifyingQuestions.map(K=>({question:K,answer:null}))};yc(e,re),m.source!=="llm"&&(t.noLlm?process.stderr.write(`[clad init] \u2139 deterministic mode (--no-llm): spec/scenarios are stubs derived from the intent verbatim (scenarios empty). Re-run without --no-llm \u2014 or use 'clad clarify' \u2014 for domain-aware generation. `):m.source==="deterministic"?process.stderr.write(`[clad init] \u26A0 LLM dispatcher did not fire \u2014 spec/scenarios are deterministic stubs (scenarios empty, intent quoted). Wire a host (run cladding as an MCP server in your AI tool) or set an API key, then re-run or use 'clad clarify'. See 'clad doctor' for details. `):process.stderr.write(`[clad init] \u26A0 LLM dispatcher fired only partially \u2014 some spec/doc sections fell back to deterministic stubs. Run 'clad clarify' to complete them; see 'clad doctor' for the missed sections. -`))}let g=_c(e,"spec.yaml");if(Gm(g)&&!r)i.push("spec.yaml (exists)");else{let $=p?{description:Ree(p),intent_summary:Ree(p),ai_hints:m?.aiHints}:void 0;Zm(g,nUe(d,u,$)),n.push("spec.yaml")}let b=_c(e,".cladding");Gm(b)?i.push(".cladding/ (exists)"):(wx(b,{recursive:!0}),n.push(".cladding/"));let _=_c(e,".gitignore");iUe(_,".cladding/",".cladding/")?n.push(".gitignore (.cladding/ entry appended)"):i.push(".gitignore (.cladding/ entry already present)");let x=[];if(l&&a){let $=await T1(a,h,e);Wi(e,"docs/conventions.md",$.conventionsMd,n,x),Wi(e,"spec/architecture.yaml",$.architectureYaml,n,x),Wi(e,"spec/capabilities.yaml",$.capabilitiesYaml,n,x),Wi(e,"spec/scenarios/README.md",Oee,n,x)}else Wi(e,"docs/conventions.md",tee(u,d),n,x),Wi(e,"spec/architecture.yaml",m?.architectureYaml??Bm(u),n,x),Wi(e,"spec/capabilities.yaml",m?.capabilitiesYaml??Hm(d),n,x),Wi(e,"spec/scenarios/README.md",Oee,n,x);let w=a?.projectContext??null,O;if(m?O=m.projectContextMd:h?O=await R1(w,d,h,e):O=Yp(w,d),Wi(e,"docs/project-context.md",O,n,x),m&&m.scenarios.length>0)for(let $ of m.scenarios){let ie=$.id.replace(/^S-/,""),K=`spec/scenarios/${$.slug}-${ie}.yaml`,xe=aUe($);Wi(e,K,xe,n,x)}let T=eu(e);T==="created"?n.push("AGENTS.md"):T==="updated"?n.push("AGENTS.md (managed block refreshed from spec)"):T==="skipped-unmanaged"?i.push("AGENTS.md (hand-authored \u2014 no clad markers, left untouched)"):i.push("AGENTS.md (managed block already current)");let A=Wl(),D=sUe(FY(e),A);if(D&&i.push(D),t.withHook)for(let $ of["pre-commit","pre-push"]){let ie=$==="pre-commit"?"clad check --tier=pre-commit":"clad check --tier=pre-push --strict",K=$ee($,e,{version:A??void 0});switch(K.result){case"created":n.push(`.git/hooks/${$} (${ie})`);break;case"updated":n.push(`.git/hooks/${$} (refreshed to current version)`);break;case"unchanged":i.push(`.git/hooks/${$} (already installed)`);break;case"skipped-foreign":i.push(`.git/hooks/${$} exists and is not cladding-authored \u2014 pass --force to overwrite`);break;case"skipped-no-git":i.push("--with-hook: no .git directory \u2014 run `git init` first, then re-run with --with-hook");break}if(K.result==="skipped-no-git")break}if(t.withCi){let $=oUe(e);$==="created"?n.push(".github/workflows/cladding.yml (clad check --tier=pre-push --strict \u2014 the authoritative gate)"):$==="exists"&&i.push(".github/workflows/cladding.yml already exists \u2014 cladding never overwrites a CI workflow")}if(m){let $=gc(e);$&&yc(e,{...$,artifactDigests:Tu(e)})}return{created:n,skipped:i,language:u,proposals:x.length?x:void 0,clarifyingQuestions:m?.clarifyingQuestions.length?[...m.clarifyingQuestions]:void 0,onboardingMode:m?.mode,onboardingSource:m?.source}}function aUe(t){let e=t.title.replace(/"/g,'\\"'),r=t.flow.split(` +`))}let g=_c(e,"spec.yaml");if(Gm(g)&&!r)i.push("spec.yaml (exists)");else{let $=p?{description:Ree(p),intent_summary:Ree(p),ai_hints:m?.aiHints}:void 0;Zm(g,nUe(d,u,$)),n.push("spec.yaml")}let b=_c(e,".cladding");Gm(b)?i.push(".cladding/ (exists)"):(wx(b,{recursive:!0}),n.push(".cladding/"));let _=_c(e,".gitignore");iUe(_,".cladding/",".cladding/")?n.push(".gitignore (.cladding/ entry appended)"):i.push(".gitignore (.cladding/ entry already present)");let x=[];if(l&&a){let $=await T1(a,h,e);Wi(e,"docs/conventions.md",$.conventionsMd,n,x),Wi(e,"spec/architecture.yaml",$.architectureYaml,n,x);let re=m?.source==="llm"?m.capabilitiesYaml:$.capabilitiesYaml;Wi(e,"spec/capabilities.yaml",re,n,x),Wi(e,"spec/scenarios/README.md",Oee,n,x)}else Wi(e,"docs/conventions.md",tee(u,d),n,x),Wi(e,"spec/architecture.yaml",m?.architectureYaml??Bm(u),n,x),Wi(e,"spec/capabilities.yaml",m?.capabilitiesYaml??Hm(d),n,x),Wi(e,"spec/scenarios/README.md",Oee,n,x);let w=a?.projectContext??null,O;if(m?O=m.projectContextMd:h?O=await R1(w,d,h,e):O=Yp(w,d),Wi(e,"docs/project-context.md",O,n,x),m&&m.scenarios.length>0)for(let $ of m.scenarios){let re=$.id.replace(/^S-/,""),K=`spec/scenarios/${$.slug}-${re}.yaml`,xe=aUe($);Wi(e,K,xe,n,x)}let T=eu(e);T==="created"?n.push("AGENTS.md"):T==="updated"?n.push("AGENTS.md (managed block refreshed from spec)"):T==="skipped-unmanaged"?i.push("AGENTS.md (hand-authored \u2014 no clad markers, left untouched)"):i.push("AGENTS.md (managed block already current)");let A=Wl(),D=sUe(FY(e),A);if(D&&i.push(D),t.withHook)for(let $ of["pre-commit","pre-push"]){let re=$==="pre-commit"?"clad check --tier=pre-commit":"clad check --tier=pre-push --strict",K=$ee($,e,{version:A??void 0});switch(K.result){case"created":n.push(`.git/hooks/${$} (${re})`);break;case"updated":n.push(`.git/hooks/${$} (refreshed to current version)`);break;case"unchanged":i.push(`.git/hooks/${$} (already installed)`);break;case"skipped-foreign":i.push(`.git/hooks/${$} exists and is not cladding-authored \u2014 pass --force to overwrite`);break;case"skipped-no-git":i.push("--with-hook: no .git directory \u2014 run `git init` first, then re-run with --with-hook");break}if(K.result==="skipped-no-git")break}if(t.withCi){let $=oUe(e);$==="created"?n.push(".github/workflows/cladding.yml (clad check --tier=pre-push --strict \u2014 the authoritative gate)"):$==="exists"&&i.push(".github/workflows/cladding.yml already exists \u2014 cladding never overwrites a CI workflow")}if(m){let $=gc(e);$&&yc(e,{...$,artifactDigests:Tu(e)})}return{created:n,skipped:i,language:u,proposals:x.length?x:void 0,clarifyingQuestions:m?.clarifyingQuestions.length?[...m.clarifyingQuestions]:void 0,onboardingMode:m?.mode,onboardingSource:m?.source}}function aUe(t){let e=t.title.replace(/"/g,'\\"'),r=t.flow.split(` `).map(n=>` ${n}`).join(` `);return["# Cladding \xB7 Tier A \xB7 SSoT \u2014 onboarding output, edit-friendly \xB7 Refreshed by: clad init / clad clarify",`id: ${t.id}`,`slug: ${t.slug}`,`title: "${e}"`,"flow: |",r||" (no flow described)","features: []",""].join(` `)}function Wi(t,e,r,n,i){let o=_c(t,e);if(Gm(o)){let s=_c(t,".cladding","scan",`${xx(e)}.proposal`);wx(Aee(s),{recursive:!0}),Zm(s,r),i.push(`${e} \u2192 ${e.startsWith("docs/")||e.startsWith("spec/")?".cladding/scan/":""}${xx(e)}.proposal`);return}wx(Aee(o),{recursive:!0}),Zm(o,r),n.push(e)}import{existsSync as Ax,mkdirSync as kx,readFileSync as mj,rmSync as Pee,writeFileSync as Vm}from"node:fs";import{basename as Ou,dirname as Ex,join as Ki,resolve as Iee}from"node:path";import Do from"node:process";Oi();async function hj(t,e={}){let r=e.cwd??".",n;try{n=gc(r)}catch(w){return{ok:!1,code:1,error:w.message,created:[],proposals:[]}}if(n===null)return{ok:!1,code:2,error:"no onboarding session \u2014 initialize Cladding with a project intent first",created:[],proposals:[]};if(n.status==="done")return{ok:!0,code:0,message:"onboarding already complete (state.yaml status: done)",report:fj(r,null,[],null,n),created:[],proposals:[]};let i=Sx(n);if(i===-1){let w=lj(n);return yc(r,w),{ok:!0,code:0,message:"onboarding complete \xB7 state.yaml marked done",report:fj(r,null,[],null,w),created:[],proposals:[]}}if(!t.trim())return{ok:!1,code:2,error:`provide an answer for: "${n.qa[i].question}"`,created:[],proposals:[]};let o=t.trim(),s=yee(n,o),a=s.projectName||Ou(Iee(r)),c={cwdBasename:Ou(Iee(r)),language:s.language,sourceFileCount:0,readmePresent:!1,readmeFirstParagraph:null,projectName:a},l=lUe(r),u=s.qa.flatMap(w=>w.answer===null?[]:[{question:w.question,answer:w.answer}]),d=e.hostDispatcher??qm({noLlm:e.noLlm}),f=await mee(s.intent,c,u,l,d,r),p=[],m=[],h=vee(r,n),g=f.scenarios.map(w=>`spec/scenarios/${w.slug}-${w.id.replace(/^S-/,"")}.yaml`),b=["docs/project-context.md","spec/architecture.yaml","spec/capabilities.yaml",...g,".cladding/onboarding/state.yaml",...h?[]:["project-context.md","architecture.yaml","capabilities.yaml",...g.map(w=>Ou(w))].map(w=>`.cladding/scan/${w}.proposal`)],_=Dee(r,b),S;try{$x(r,"docs/project-context.md",f.projectContextMd,m,p,h),$x(r,"spec/architecture.yaml",f.architectureYaml,m,p,h),$x(r,"spec/capabilities.yaml",f.capabilitiesYaml,m,p,h),f.scenarios.forEach((w,O)=>{$x(r,g[O],uUe(w),m,p,h)}),S=_ee(s,f.clarifyingQuestions),h?(S={...S,artifactDigests:Tu(r)},f.clarifyingQuestions.length===0&&bee(S)&&(S=lj(S))):S={...S,status:"needs_review",pendingReview:["docs/project-context.md","spec/architecture.yaml","spec/capabilities.yaml",...g]},yc(r,S)}catch(w){return Nee(r,b,_),{ok:!1,code:1,error:`onboarding refinement failed; active design was restored: ${w.message}`,created:[],proposals:[]}}let x=s.qa[i];return{ok:!0,code:0,report:fj(r,{question:x.question,answer:o},f.clarifyingQuestions,f.mode,S),source:f.source,created:m,proposals:p}}function Cee(t,e={}){let r=e.cwd??".",n=gc(r);if(!n||n.status!=="needs_review"||!n.pendingReview?.length)return{ok:!1,changed:!1,error:"no onboarding design review is pending"};let i=[...new Set(t)];if(i.length===0||i.some(u=>!n.pendingReview.includes(u)))return{ok:!1,changed:!1,error:"targets must be selected from the pending onboarding review"};if(i.some(u=>!cUe(u)))return{ok:!1,changed:!1,error:"review targets must be Cladding onboarding design artifacts"};let o=i.map(u=>({target:u,proposal:`.cladding/scan/${Ou(u)}.proposal`})),s=o.filter(({proposal:u})=>!Ax(Ki(r,u))).map(({target:u})=>u);if(s.length>0)return{ok:!1,changed:!1,error:`proposal missing for: ${s.join(", ")}`};let c=[".cladding/onboarding/state.yaml",...o.flatMap(({target:u,proposal:d})=>[u,d])],l=Dee(r,c);try{for(let{target:f,proposal:p}of o)kx(Ex(Ki(r,f)),{recursive:!0}),Vm(Ki(r,f),mj(Ki(r,p))),Pee(Ki(r,p),{force:!0});let u=n.pendingReview.filter(f=>!i.includes(f)),d={...n,status:u.length>0?"needs_review":Sx(n)>=0?"active":"done",pendingReview:u.length>0?u:void 0};return d={...d,artifactDigests:Tu(r)},yc(r,d),{ok:!0,changed:!0,status:d.status,remaining:u}}catch(u){return Nee(r,c,l),{ok:!1,changed:!1,error:`review apply failed; files were restored: ${u.message}`}}}function cUe(t){return t==="docs/project-context.md"||t==="spec/architecture.yaml"||t==="spec/capabilities.yaml"||/^spec\/scenarios\/[a-z0-9][a-z0-9-]*-[a-f0-9]{6}\.yaml$/.test(t)}function Dee(t,e){return new Map(e.map(r=>{let n=Ki(t,r);return[r,Ax(n)?mj(n):null]}))}function Nee(t,e,r){for(let n of e){let i=Ki(t,n),o=r.get(n);o==null?Pee(i,{force:!0}):(kx(Ex(i),{recursive:!0}),Vm(i,o))}}async function jee(t,e={}){let r=(t??[]).join(" ").trim(),n=await hj(r,{cwd:e.cwd,noLlm:e.noLlm});if(!n.ok){L("fail","clarify",n.error),Do.exit(n.code);return}if(e.json){Do.stdout.write(`${JSON.stringify(n.report,null,2)} diff --git a/spec.yaml b/spec.yaml index 89d69ec..f3cde6c 100644 --- a/spec.yaml +++ b/spec.yaml @@ -54,7 +54,7 @@ project: # Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand. inventory: - features: 255 + features: 256 scenarios: 2 capabilities: 6 test_files: 237 diff --git a/spec/attestation.yaml b/spec/attestation.yaml index 533e67e..87931e3 100644 --- a/spec/attestation.yaml +++ b/spec/attestation.yaml @@ -38,7 +38,7 @@ attested_modules: docs/ab-evaluation/README.md: 2467808b9871dcf0 docs/ab-evaluation/case-doverunner-scale.md: 2a435b6855823d41 docs/ab-evaluation/case-efficiency-measurement.md: 348aca146a7b2faa - docs/ab-evaluation/case-existing-adoption.md: ec78b64f115d9c91 + docs/ab-evaluation/case-existing-adoption.md: d9d0d649861024ce docs/ab-evaluation/case-graph-efficiency.md: 83d3956d14a1517d docs/ab-evaluation/case-iterative-vs-fixed-vapt.md: 1d242b8b6071f343 docs/ab-evaluation/case-payment-saas.md: ca1a9a22b933c5cf @@ -113,7 +113,7 @@ attested_modules: skills/serve/SKILL.md: f08bbdbbfeb05041 skills/status/SKILL.md: 09faadc50b3449da skills/sync/SKILL.md: 775c0f990a52a3d9 - spec.yaml: 59840b10bd055d32 + spec.yaml: 82491ca5dc73636f spec/README.md: 7c257426396d435c spec/architecture.yaml: f0888480405a13a8 spec/features/: a4d0f0eb87fed960 @@ -155,7 +155,7 @@ attested_modules: src/cli/graph.ts: bab410061b8c746a src/cli/hook.ts: 201f82f4c89e173f src/cli/host-onboarding.ts: b046571d4be7280c - src/cli/init.ts: ccd14da690621d88 + src/cli/init.ts: 04135bc767e58e02 src/cli/intent-from-path.ts: e69862821d979f22 src/cli/measure.ts: 3a562f16589e26c2 src/cli/report.ts: 911f859b2446834b @@ -586,6 +586,7 @@ attested_features: F-6ed216f3: ok F-6f80e7: ok F-7076f7: ok + F-70ed1afd: ok F-723c81dd: ok F-7794a6bc: ok F-77a90ac6: ok diff --git a/spec/features/adoption-honors-host-capabilities-70ed1afd.yaml b/spec/features/adoption-honors-host-capabilities-70ed1afd.yaml new file mode 100644 index 0000000..d7a98d1 --- /dev/null +++ b/spec/features/adoption-honors-host-capabilities-70ed1afd.yaml @@ -0,0 +1,34 @@ +id: F-70ed1afd +slug: adoption-honors-host-capabilities +title: "Existing-project adoption honors the host draft's approved capabilities" +status: done +modules: + - src/cli/init.ts +acceptance_criteria: + - id: AC-d20df076 + ears: event + condition: "when an existing project is adopted through the onboarding flow and the host/LLM draft dispatch fires fully (onboarding source is 'llm')" + action: "select onboarding.capabilitiesYaml over interp.capabilitiesYaml in the scan branch" + response: "spec/capabilities.yaml carries the draft's id/title/summary/surface entries" + text: "The system shall write the draft's approved capabilities to spec/capabilities.yaml instead of the scanner's README-derived capabilities." + test_refs: ["tests/serve/init-tools.test.ts"] + - id: AC-039f62b6 + ears: unwanted + condition: "if the adopted repository has no README ## headings" + response: "spec/capabilities.yaml is the draft's capabilities, never 'capabilities: []' when a fired draft provided them" + text: "The system shall not write an empty capabilities list when a fired draft supplied capabilities, and shall persist the draft's capabilities instead." + test_refs: ["tests/serve/init-tools.test.ts"] + - id: AC-6421da1f + ears: state + condition: "while the onboarding dispatch did not fire (source is 'deterministic') or no intent was provided so there is no onboarding pass" + text: "The system shall fall back to the scanner-derived capabilities, preserving prior behavior for --no-llm and no-intent scans." + test_refs: ["tests/cli/init.test.ts"] + - id: AC-aa2d0e2c + ears: ubiquitous + text: "The system shall keep docs/conventions.md and spec/architecture.yaml sourced from the scanner (code-grounded), unaffected by the capability-source preference." + test_refs: ["tests/scenarios/existing-adoption-lifecycle.test.ts"] +design_impact: + classification: none + rationale: "Behavioral fix to how the init scan-branch sources spec/capabilities.yaml; it does not alter cladding's own capabilities, architecture, or project-context artifacts." + status: resolved + artifacts: [] diff --git a/spec/index.yaml b/spec/index.yaml index 1daf12c..95178bf 100644 --- a/spec/index.yaml +++ b/spec/index.yaml @@ -159,6 +159,7 @@ features: F-6ed216f3: {slug: interactive-drift-profile, status: done, modules: 5} F-6f80e7: {slug: claude-code-dogfood, status: done, modules: 1} F-7076f7: {slug: smoke-probe-demand, status: done, modules: 3} + F-70ed1afd: {slug: adoption-honors-host-capabilities, status: done, modules: 1} F-723c81dd: {slug: agent-interpreter-rule, status: done, modules: 7} F-7794a6bc: {slug: impact-blast-radius, status: done, modules: 3} F-77a90ac6: {slug: scan-layer-glob-source-root, status: done, modules: 1} diff --git a/src/cli/init.ts b/src/cli/init.ts index c6875ee..fb21f82 100644 --- a/src/cli/init.ts +++ b/src/cli/init.ts @@ -511,7 +511,20 @@ export async function runInit(opts: InitOptions = {}): Promise { // directly instead of re-parsing docs/project-context.md. LLM // refinement (when a dispatcher is available) adds `summary` + // `surface` per entry; deterministic mode ships id + title only. - writeArtifact(cwd, 'spec/capabilities.yaml', interp.capabilitiesYaml, created, proposals); + // + // v0.9.1 — an existing-project adoption still carries the host/LLM's + // approved, domain-aware capabilities via the onboarding pass. The scan + // interpreter can't see them: its total-fallback fires on the absent + // CONVENTIONS_MD sentinel (a host draft never emits it) and re-derives + // capabilities from README headings — or `[]` when there are none — + // silently discarding the draft's schema-validated 3–8 entries. Prefer + // the onboarding capabilities when the dispatcher genuinely fired + // (`source === 'llm'`), mirroring the greenfield branch below; the + // scanner still owns conventions.md + architecture.yaml, which are + // code-grounded and correct for a real codebase. + const capabilitiesYaml = + onboarding?.source === 'llm' ? onboarding.capabilitiesYaml : interp.capabilitiesYaml; + writeArtifact(cwd, 'spec/capabilities.yaml', capabilitiesYaml, created, proposals); // v0.3.30 — scenarios are not auto-extracted from observed code. // A user journey is *intent*, not architecture, so cladding leaves diff --git a/tests/serve/init-tools.test.ts b/tests/serve/init-tools.test.ts index fe3c7cd..dadf735 100644 --- a/tests/serve/init-tools.test.ts +++ b/tests/serve/init-tools.test.ts @@ -7,6 +7,7 @@ import {dirname, join} from 'node:path'; import {Client} from '@modelcontextprotocol/sdk/client/index.js'; import {InMemoryTransport} from '@modelcontextprotocol/sdk/inMemory.js'; import {afterEach, beforeEach, describe, expect, test} from 'vitest'; +import {parse as parseYaml} from 'yaml'; import {refineOnboarding, resolveOnboardingReview} from '../../src/cli/clarify.js'; import {prepareHostClarify, prepareHostInit, renderHostDraft} from '../../src/cli/host-onboarding.js'; import {runInit} from '../../src/cli/init.js'; @@ -427,6 +428,16 @@ describe('serve/server — natural-language init tools', () => { const conventions = readFileSync(join(dir, 'docs', 'conventions.md'), 'utf8'); expect(conventions).toContain('derived from observed code'); expect(conventions).toContain('## Observed style'); + // Regression: an existing-project adoption with no README `##` headings must still + // persist the host draft's approved capabilities — not land `capabilities: []`. + const capabilitiesBody = readFileSync(join(dir, 'spec', 'capabilities.yaml'), 'utf8'); + expect(capabilitiesBody).not.toContain('capabilities: []'); + const capabilities = (parseYaml(capabilitiesBody) as {capabilities?: Array<{id?: string}>}).capabilities ?? []; + expect(capabilities.length).toBeGreaterThanOrEqual(3); + const capabilityIds = capabilities.map((capability) => capability.id); + for (const id of ['payments', 'audit', 'webhooks']) { + expect(capabilityIds).toContain(id); + } } finally { await cleanup(); } From 196bc62678b99681b60cef8dd350eedeaecbd73b Mon Sep 17 00:00:00 2001 From: qwerfunch Date: Mon, 20 Jul 2026 21:12:51 +0900 Subject: [PATCH 2/6] feat(gate): polyglot gate fidelity + feature-cycle signals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Land the in-flight pytest/convention-drift work and add three feature-cycle signals, each authored spec-first (shard → sync → implement → tests → clad done, strict gate GREEN). - pytest test-run dedup (F-49f6f2d2): on pytest projects the unit and coverage stages now share ONE coverage-instrumented run instead of spawning the whole suite twice; the zero-executed-tests guard learned pytest's `collected 0 items` and applies on the shared run, so the dedup can never pass a vacuous run. - lint multi-finding + fix hint (F-4643d99d): check-only formatters (dart/dotnet) now list EVERY dirty file with its path, plus a one-line `fix: run` hint — not just the first line collapsed to one finding. - unbound-edit nudge (F-f9891175): a non-blocking, debounced, once-per-window post-edit card when source edits keep resolving to no feature, so the spec-first cycle gets triggered instead of skipped. - enforcement advisory (F-f4e184f7): `clad check` flags a project that has undone features but neither a git hook nor CI enforcing the gate. Informational only; never changes the exit status. - convention-drift: recognise `#` comments and Python docstrings. Rebuilt bundle + plugin mirrors; READMEs + CHANGELOG updated. Strict pre-push gate GREEN — 2586 tests, 41 detectors, 258 features (255 done). Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 15 + README.html | 8 +- README.ja.md | 4 +- README.ko.html | 8 +- README.ko.md | 4 +- README.md | 4 +- README.zh.md | 4 +- plugins/claude-code/dist/clad.js | 794 +++++++++--------- spec.yaml | 4 +- spec/attestation.yaml | 40 +- .../enforcement-advisory-f4e184f7.yaml | 31 + .../features/lint-multi-finding-4643d99d.yaml | 33 + spec/features/test-run-dedup-49f6f2d2.yaml | 16 + .../features/unbound-edit-nudge-f9891175.yaml | 37 + spec/index.yaml | 5 +- src/cli/clad.ts | 13 +- src/cli/enforcement-advisory.ts | 46 + src/cli/hook.ts | 83 +- src/init/git-hook.ts | 17 + src/stages/detectors/convention-drift.ts | 12 +- src/stages/finding-parser.ts | 27 + src/stages/lint.ts | 20 +- src/stages/test-run-cache.ts | 8 +- src/stages/types.ts | 6 + src/stages/unit.ts | 54 ++ tests/cli/enforcement-advisory.test.ts | 102 +++ tests/cli/hook-telemetry.test.ts | 7 + tests/cli/hook-unbound-nudge.test.ts | 136 +++ tests/stages/convention-drift.test.ts | 38 +- tests/stages/lint-multi-finding.test.ts | 76 ++ tests/stages/test-run-dedup.test.ts | 44 + 31 files changed, 1248 insertions(+), 448 deletions(-) create mode 100644 spec/features/enforcement-advisory-f4e184f7.yaml create mode 100644 spec/features/lint-multi-finding-4643d99d.yaml create mode 100644 spec/features/unbound-edit-nudge-f9891175.yaml create mode 100644 src/cli/enforcement-advisory.ts create mode 100644 tests/cli/enforcement-advisory.test.ts create mode 100644 tests/cli/hook-unbound-nudge.test.ts create mode 100644 tests/stages/lint-multi-finding.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 00b81e6..dc1d19f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ All notable changes to Cladding are documented here. Format: [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/). Versioning: [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). +## [Unreleased] — Polyglot gate fidelity + feature-cycle signals + +**In one line:** the gate reads and reports non-JavaScript projects honestly, and it now nudges when the feature cycle isn't being driven. + +### Gate and toolchain fidelity + +- **The check-only formatters list every dirty file, not just the first.** `dart format` (and peers like `dotnet format`) print one changed-file line each; those aren't ESLint-shaped, so the lint stage used to collapse them to a single pathless finding — fix one, re-run, the next appears. Each dirty file now surfaces as its own finding with its path, plus a one-line `fix: run \`dart format .\`` hint. +- **Python projects run the test suite once per gate, not twice.** On pytest projects the unit stage and the coverage stage each spawned the whole suite (`pytest`, then `coverage run -m pytest`) — roughly doubling gate time. The unit stage now runs the coverage-instrumented suite once and shares it with the coverage stage, the same dedup vitest already had. The zero-executed-tests guard still applies on the shared pytest run, so the dedup can't turn a vacuous run green. +- **The header-comment convention check understands more languages.** It now recognises `#` comments and Python docstrings (`"""`, `'''`), not only `//` / `/*`. + +### Feature-cycle signals + +- **A non-blocking nudge when sustained source edits are bound to no feature.** When edits to files that no feature tracks accumulate past a small threshold, the post-edit card surfaces one advisory to start a feature — so the spec-first cycle gets triggered instead of silently skipped. Debounced and once-per-window; it never blocks. +- **`clad check` flags unenforced projects.** When a project has features not yet done but neither a git hook nor CI wires the gate, `clad check` prints one advisory that the checks run only when asked — with how to wire enforcement. Informational only; it never changes the exit status. + ## [0.9.0] — Project-scoped natural-language onboarding (2026-07-16) **In one line:** apply Cladding from ordinary conversation without a shell command, while project-local discovery, a read-only preview, an exact approval phrase, and atomic recovery keep onboarding bounded. diff --git a/README.html b/README.html index 38cf2bb..0b5e4e4 100644 --- a/README.html +++ b/README.html @@ -233,7 +233,7 @@

cladding

ironclad spec - tests + tests detectors license

@@ -548,7 +548,7 @@

Status

tests
-
2561/2561
+
2586/2586
all pass
@@ -558,8 +558,8 @@

Status

features
-
255
-
252 done · self-spec
+
258
+
255 done · self-spec
diff --git a/README.ja.md b/README.ja.md index ca22b93..9982ac7 100644 --- a/README.ja.md +++ b/README.ja.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -339,7 +339,7 @@ clad update # 3. プロジェクト接続と派生状態を更新 | Version | 準拠レベル | Tests | Gate | Features | |---|---|---|---|---| -| v0.9.0(2026-07) | L4 · [自己申告](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2561 / 2561 | 15 段階 · 41 detectors | 255(252 done) | +| v0.9.0(2026-07) | L4 · [自己申告](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2586 / 2586 | 15 段階 · 41 detectors | 258(255 done) | 236 test files · capability 6 個 · カバレッジ低下は COVERAGE_DROP detector がブロック diff --git a/README.ko.html b/README.ko.html index d2a07c1..669f7b0 100644 --- a/README.ko.html +++ b/README.ko.html @@ -275,7 +275,7 @@

cladding

ironclad spec - tests + tests detectors license

@@ -584,7 +584,7 @@

Status

tests
-
2561/2561
+
2586/2586
all pass
@@ -594,8 +594,8 @@

Status

features
-
255
-
252 done · 자기 스펙
+
258
+
255 done · 자기 스펙
diff --git a/README.ko.md b/README.ko.md index 427e761..6df6114 100644 --- a/README.ko.md +++ b/README.ko.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -338,7 +338,7 @@ clad update # 3. 프로젝트 연결과 파생 데이터를 함께 | version | 준수 등급 | tests | gate | features | |---|---|---|---|---| -| v0.9.0 · 2026-07 | L4 · [L0–L4 중 최고 · 자가 선언](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2561 / 2561 · all pass | 15 단계 · 41 detectors | 255 · 252 done · 자기 스펙 | +| v0.9.0 · 2026-07 | L4 · [L0–L4 중 최고 · 자가 선언](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2586 / 2586 · all pass | 15 단계 · 41 detectors | 258 · 255 done · 자기 스펙 | 236 test files · capability 6개 · coverage는 COVERAGE_DROP detector가 하락 차단 diff --git a/README.md b/README.md index 5a87432..f164936 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -352,7 +352,7 @@ Reconcile the drift the update flagged. | Version | Conformance | Tests | Gate | Features | |---|---|---|---|---| -| v0.9.0 (2026-07) | L4 · [self-declared](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2561 / 2561 | 15 stages · 41 detectors | 255 (252 done) | +| v0.9.0 (2026-07) | L4 · [self-declared](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2586 / 2586 | 15 stages · 41 detectors | 258 (255 done) | 236 test files · 6 capabilities · coverage drop blocked by the COVERAGE_DROP detector diff --git a/README.zh.md b/README.zh.md index 9256197..dff870e 100644 --- a/README.zh.md +++ b/README.zh.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -335,7 +335,7 @@ clad update # 3. 刷新项目连接和派生状态 | 版本 | 一致性 | Tests | Gate | Features | |---|---|---|---|---| -| v0.9.0(2026-07) | L4 · [自我声明](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2561 / 2561 | 15 阶段 · 41 检测器 | 255(252 done) | +| v0.9.0(2026-07) | L4 · [自我声明](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2586 / 2586 | 15 阶段 · 41 检测器 | 258(255 done) | 236 个测试文件 · 6 项 capability · 覆盖率下降由 COVERAGE_DROP 检测器拦下 diff --git a/plugins/claude-code/dist/clad.js b/plugins/claude-code/dist/clad.js index 64dd26b..38529e0 100755 --- a/plugins/claude-code/dist/clad.js +++ b/plugins/claude-code/dist/clad.js @@ -4,102 +4,102 @@ const require = __claddingCreateRequire(import.meta.url); // Marker for stages/*.ts: when true, the per-stage CLI-entry guard // short-circuits so the bundle doesn't fire every stage at startup. globalThis.__CLADDING_BUNDLED = true; -var Rde=Object.create;var $A=Object.defineProperty;var Ide=Object.getOwnPropertyDescriptor;var Pde=Object.getOwnPropertyNames;var Cde=Object.getPrototypeOf,Dde=Object.prototype.hasOwnProperty;var Ge=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pr=(t,e)=>{for(var r in e)$A(t,r,{get:e[r],enumerable:!0})},Nde=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Pde(e))!Dde.call(t,i)&&i!==r&&$A(t,i,{get:()=>e[i],enumerable:!(n=Ide(e,i))||n.enumerable});return t};var St=(t,e,r)=>(r=t!=null?Rde(Cde(t)):{},Nde(e||!t||!t.__esModule?$A(r,"default",{value:t,enumerable:!0}):r,t));var rf=v(EA=>{var yy=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},kA=class extends yy{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};EA.CommanderError=yy;EA.InvalidArgumentError=kA});var _y=v(TA=>{var{InvalidArgumentError:jde}=rf(),AA=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new jde(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Mde(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}TA.Argument=AA;TA.humanReadableArgName=Mde});var IA=v(RA=>{var{humanReadableArgName:Fde}=_y(),OA=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Fde(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),s.join(` -`)}displayWidth(e){return i4(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),c=2,u=(this.helpWidth??80)-r-c-2,d;return utypeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pr=(t,e)=>{for(var r in e)kA(t,r,{get:e[r],enumerable:!0})},qde=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Lde(e))!Ude.call(t,i)&&i!==r&&kA(t,i,{get:()=>e[i],enumerable:!(n=Fde(e,i))||n.enumerable});return t};var St=(t,e,r)=>(r=t!=null?Mde(zde(t)):{},qde(e||!t||!t.__esModule?kA(r,"default",{value:t,enumerable:!0}):r,t));var rf=v(AA=>{var _y=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},EA=class extends _y{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};AA.CommanderError=_y;AA.InvalidArgumentError=EA});var by=v(OA=>{var{InvalidArgumentError:Bde}=rf(),TA=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Bde(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Hde(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}OA.Argument=TA;OA.humanReadableArgName=Hde});var PA=v(IA=>{var{humanReadableArgName:Gde}=by(),RA=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Gde(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),s.join(` +`)}displayWidth(e){return l4(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),c=2,u=(this.helpWidth??80)-r-c-2,d;return u{let a=s.match(i);if(a===null){o.push("");return}let c=[a.shift()],l=this.displayWidth(c[0]);a.forEach(u=>{let d=this.displayWidth(u);if(l+d<=r){c.push(u),l+=d;return}o.push(c.join(""));let f=u.trimStart();c=[f],l=this.displayWidth(f)}),o.push(c.join(""))}),o.join(` -`)}};function i4(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}RA.Help=OA;RA.stripColor=i4});var NA=v(DA=>{var{InvalidArgumentError:Lde}=rf(),PA=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=zde(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Lde(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?o4(this.name().replace(/^no-/,"")):o4(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},CA=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function o4(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function zde(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a} +`)}};function l4(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}IA.Help=RA;IA.stripColor=l4});var jA=v(NA=>{var{InvalidArgumentError:Zde}=rf(),CA=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Vde(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Zde(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?u4(this.name().replace(/^no-/,"")):u4(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},DA=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function u4(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Vde(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a} - a short flag is a single dash and a single character - either use a single dash and a single character (for a short flag) - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a} - too many short flags`):i.test(s)?new Error(`${a} - too many long flags`):new Error(`${a} -- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}DA.Option=PA;DA.DualOptions=CA});var a4=v(s4=>{function Ude(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function qde(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=Ude(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(as.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?` +- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}NA.Option=CA;NA.DualOptions=DA});var f4=v(d4=>{function Wde(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function Kde(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=Wde(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(as.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?` (Did you mean one of ${n.join(", ")}?)`:n.length===1?` -(Did you mean ${n[0]}?)`:""}s4.suggestSimilar=qde});var d4=v(zA=>{var Bde=Ge("node:events").EventEmitter,jA=Ge("node:child_process"),uo=Ge("node:path"),by=Ge("node:fs"),qe=Ge("node:process"),{Argument:Hde,humanReadableArgName:Gde}=_y(),{CommanderError:MA}=rf(),{Help:Zde,stripColor:Vde}=IA(),{Option:c4,DualOptions:Wde}=NA(),{suggestSimilar:l4}=a4(),FA=class t extends Bde{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>qe.stdout.write(r),writeErr:r=>qe.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>qe.stdout.isTTY?qe.stdout.columns:void 0,getErrHelpWidth:()=>qe.stderr.isTTY?qe.stderr.columns:void 0,getOutHasColors:()=>LA()??(qe.stdout.isTTY&&qe.stdout.hasColors?.()),getErrHasColors:()=>LA()??(qe.stderr.isTTY&&qe.stderr.hasColors?.()),stripColor:r=>Vde(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return i&&(c.description(i),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Zde,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name -- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new Hde(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'. -Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new MA(e,r,n)),qe.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new c4(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}' -- already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,s):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof c4)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,l)=>{let u=a.exec(c);return u?u[0]:l},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){qe.versions?.electron&&(r.from="electron");let i=qe.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=qe.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":qe.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true. -- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,n){if(by.existsSync(e))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist +(Did you mean ${n[0]}?)`:""}d4.suggestSimilar=Kde});var g4=v(UA=>{var Jde=Ge("node:events").EventEmitter,MA=Ge("node:child_process"),fo=Ge("node:path"),vy=Ge("node:fs"),Be=Ge("node:process"),{Argument:Yde,humanReadableArgName:Xde}=by(),{CommanderError:FA}=rf(),{Help:Qde,stripColor:efe}=PA(),{Option:p4,DualOptions:tfe}=jA(),{suggestSimilar:m4}=f4(),LA=class t extends Jde{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>Be.stdout.write(r),writeErr:r=>Be.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>Be.stdout.isTTY?Be.stdout.columns:void 0,getErrHelpWidth:()=>Be.stderr.isTTY?Be.stderr.columns:void 0,getOutHasColors:()=>zA()??(Be.stdout.isTTY&&Be.stdout.hasColors?.()),getErrHasColors:()=>zA()??(Be.stderr.isTTY&&Be.stderr.hasColors?.()),stripColor:r=>efe(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return i&&(c.description(i),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Qde,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name +- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new Yde(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'. +Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new FA(e,r,n)),Be.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new p4(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}' +- already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,s):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof p4)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,l)=>{let u=a.exec(c);return u?u[0]:l},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){Be.versions?.electron&&(r.from="electron");let i=Be.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=Be.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":Be.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true. +- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,n){if(vy.existsSync(e))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead - if the default executable name is not suitable, use the executableFile option to supply a custom name or path - - ${i}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(u,d){let f=uo.resolve(u,d);if(by.existsSync(f))return f;if(i.includes(uo.extname(d)))return;let p=i.find(m=>by.existsSync(`${f}${m}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=by.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=uo.resolve(uo.dirname(u),a)}if(a){let u=o(a,s);if(!u&&!e._executableFile&&this._scriptPath){let d=uo.basename(this._scriptPath,uo.extname(this._scriptPath));d!==this._name&&(u=o(a,`${d}-${e._name}`))}s=u||s}n=i.includes(uo.extname(s));let c;qe.platform!=="win32"?n?(r.unshift(s),r=u4(qe.execArgv).concat(r),c=jA.spawn(qe.argv[0],r,{stdio:"inherit"})):c=jA.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,e._name),r.unshift(s),r=u4(qe.execArgv).concat(r),c=jA.spawn(qe.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{qe.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let l=this._exitCallback;c.on("close",u=>{u=u??1,l?l(new MA(u,"commander.executeSubCommandAsync","(close)")):qe.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(s,a,e._name);else if(u.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)qe.exit(1);else{let d=new MA(1,"commander.executeSubCommandAsync","(error)");d.nestedError=u,l(d)}}),this.runningCommand=c}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?ie(n,a,s),n.defaultValue))):o===void 0&&(o=[]):ir()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r;function o(u){return u.length>1&&u[0]==="-"}let s=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(d=>d.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,c=null,l=0;for(;l2&&u[0]==="-"&&u[1]!=="-"){let d=this._findOption(`-${u[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,u.slice(2)):(this.emit(`option:${d.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let d=u.indexOf("="),f=this._findOption(u.slice(0,d));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,u.slice(d+1));continue}}if(i===r&&o(u)&&!(this.commands.length===0&&s(u))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),n.push(...e.slice(l));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u,...e.slice(l));break}else if(this._defaultCommandName){n.push(u,...e.slice(l));break}}if(this._passThroughOptions){i.push(u,...e.slice(l));break}i.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;nObject.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e} + - ${i}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(u,d){let f=fo.resolve(u,d);if(vy.existsSync(f))return f;if(i.includes(fo.extname(d)))return;let p=i.find(m=>vy.existsSync(`${f}${m}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=vy.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=fo.resolve(fo.dirname(u),a)}if(a){let u=o(a,s);if(!u&&!e._executableFile&&this._scriptPath){let d=fo.basename(this._scriptPath,fo.extname(this._scriptPath));d!==this._name&&(u=o(a,`${d}-${e._name}`))}s=u||s}n=i.includes(fo.extname(s));let c;Be.platform!=="win32"?n?(r.unshift(s),r=h4(Be.execArgv).concat(r),c=MA.spawn(Be.argv[0],r,{stdio:"inherit"})):c=MA.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,e._name),r.unshift(s),r=h4(Be.execArgv).concat(r),c=MA.spawn(Be.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{Be.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let l=this._exitCallback;c.on("close",u=>{u=u??1,l?l(new FA(u,"commander.executeSubCommandAsync","(close)")):Be.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(s,a,e._name);else if(u.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)Be.exit(1);else{let d=new FA(1,"commander.executeSubCommandAsync","(error)");d.nestedError=u,l(d)}}),this.runningCommand=c}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?ie(n,a,s),n.defaultValue))):o===void 0&&(o=[]):ir()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r;function o(u){return u.length>1&&u[0]==="-"}let s=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(d=>d.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,c=null,l=0;for(;l2&&u[0]==="-"&&u[1]!=="-"){let d=this._findOption(`-${u[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,u.slice(2)):(this.emit(`option:${d.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let d=u.indexOf("="),f=this._findOption(u.slice(0,d));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,u.slice(d+1));continue}}if(i===r&&o(u)&&!(this.commands.length===0&&s(u))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),n.push(...e.slice(l));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u,...e.slice(l));break}else if(this._defaultCommandName){n.push(u,...e.slice(l));break}}if(this._passThroughOptions){i.push(u,...e.slice(l));break}i.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;nObject.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e} `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError} `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(` -`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in qe.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,qe.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Wde(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),u=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||s},i=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=l4(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=l4(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e} -`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Gde(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=uo.basename(e,uo.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(qe.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText. +`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Be.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Be.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new tfe(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),u=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||s},i=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=m4(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=m4(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e} +`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Xde(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=fo.basename(e,fo.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(Be.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s} -`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function u4(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function LA(){if(qe.env.NO_COLOR||qe.env.FORCE_COLOR==="0"||qe.env.FORCE_COLOR==="false")return!1;if(qe.env.FORCE_COLOR||qe.env.CLICOLOR_FORCE!==void 0)return!0}zA.Command=FA;zA.useColor=LA});var h4=v($n=>{var{Argument:f4}=_y(),{Command:UA}=d4(),{CommanderError:Kde,InvalidArgumentError:p4}=rf(),{Help:Jde}=IA(),{Option:m4}=NA();$n.program=new UA;$n.createCommand=t=>new UA(t);$n.createOption=(t,e)=>new m4(t,e);$n.createArgument=(t,e)=>new f4(t,e);$n.Command=UA;$n.Option=m4;$n.Argument=f4;$n.Help=Jde;$n.CommanderError=Kde;$n.InvalidArgumentError=p4;$n.InvalidOptionArgumentError=p4});var De=v(Xt=>{"use strict";var BA=Symbol.for("yaml.alias"),b4=Symbol.for("yaml.document"),vy=Symbol.for("yaml.map"),v4=Symbol.for("yaml.pair"),HA=Symbol.for("yaml.scalar"),Sy=Symbol.for("yaml.seq"),fo=Symbol.for("yaml.node.type"),rfe=t=>!!t&&typeof t=="object"&&t[fo]===BA,nfe=t=>!!t&&typeof t=="object"&&t[fo]===b4,ife=t=>!!t&&typeof t=="object"&&t[fo]===vy,ofe=t=>!!t&&typeof t=="object"&&t[fo]===v4,S4=t=>!!t&&typeof t=="object"&&t[fo]===HA,sfe=t=>!!t&&typeof t=="object"&&t[fo]===Sy;function w4(t){if(t&&typeof t=="object")switch(t[fo]){case vy:case Sy:return!0}return!1}function afe(t){if(t&&typeof t=="object")switch(t[fo]){case BA:case vy:case HA:case Sy:return!0}return!1}var cfe=t=>(S4(t)||w4(t))&&!!t.anchor;Xt.ALIAS=BA;Xt.DOC=b4;Xt.MAP=vy;Xt.NODE_TYPE=fo;Xt.PAIR=v4;Xt.SCALAR=HA;Xt.SEQ=Sy;Xt.hasAnchor=cfe;Xt.isAlias=rfe;Xt.isCollection=w4;Xt.isDocument=nfe;Xt.isMap=ife;Xt.isNode=afe;Xt.isPair=ofe;Xt.isScalar=S4;Xt.isSeq=sfe});var nf=v(GA=>{"use strict";var zt=De(),Cr=Symbol("break visit"),x4=Symbol("skip children"),ki=Symbol("remove node");function wy(t,e){let r=$4(e);zt.isDocument(t)?Jc(null,t.contents,r,Object.freeze([t]))===ki&&(t.contents=null):Jc(null,t,r,Object.freeze([]))}wy.BREAK=Cr;wy.SKIP=x4;wy.REMOVE=ki;function Jc(t,e,r,n){let i=k4(t,e,r,n);if(zt.isNode(i)||zt.isPair(i))return E4(t,n,i),Jc(t,i,r,n);if(typeof i!="symbol"){if(zt.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o{"use strict";var A4=De(),lfe=nf(),ufe={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},dfe=t=>t.replace(/[!,[\]{}]/g,e=>ufe[e]),of=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+dfe(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&A4.isNode(e.contents)){let o={};lfe.visit(e.contents,(s,a)=>{A4.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(` -`)}};of.defaultYaml={explicit:!1,version:"1.2"};of.defaultTags={"!!":"tag:yaml.org,2002:"};T4.Directives=of});var $y=v(sf=>{"use strict";var O4=De(),ffe=nf();function pfe(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function R4(t){let e=new Set;return ffe.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function I4(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function mfe(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=R4(t));let s=I4(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(O4.isScalar(s.node)||O4.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}sf.anchorIsValid=pfe;sf.anchorNames=R4;sf.createNodeAnchors=mfe;sf.findNewAnchor=I4});var VA=v(P4=>{"use strict";function af(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i{"use strict";var hfe=De();function C4(t,e,r){if(Array.isArray(t))return t.map((n,i)=>C4(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!hfe.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}D4.toJS=C4});var ky=v(j4=>{"use strict";var gfe=VA(),N4=De(),yfe=Zo(),WA=class{constructor(e){Object.defineProperty(this,N4.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!N4.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=yfe.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?gfe.applyReviver(o,{"":a},"",a):a}};j4.NodeBase=WA});var cf=v(M4=>{"use strict";var _fe=$y(),bfe=nf(),Xc=De(),vfe=ky(),Sfe=Zo(),KA=class extends vfe.NodeBase{constructor(e){super(Xc.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],bfe.visit(e,{Node:(o,s)=>{(Xc.isAlias(s)||Xc.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(Sfe.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Ey(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(_fe.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function Ey(t,e,r){if(Xc.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Xc.isCollection(e)){let n=0;for(let i of e.items){let o=Ey(t,i,r);o>n&&(n=o)}return n}else if(Xc.isPair(e)){let n=Ey(t,e.key,r),i=Ey(t,e.value,r);return Math.max(n,i)}return 1}M4.Alias=KA});var Dt=v(JA=>{"use strict";var wfe=De(),xfe=ky(),$fe=Zo(),kfe=t=>!t||typeof t!="function"&&typeof t!="object",Vo=class extends xfe.NodeBase{constructor(e){super(wfe.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:$fe.toJS(this.value,e,r)}toString(){return String(this.value)}};Vo.BLOCK_FOLDED="BLOCK_FOLDED";Vo.BLOCK_LITERAL="BLOCK_LITERAL";Vo.PLAIN="PLAIN";Vo.QUOTE_DOUBLE="QUOTE_DOUBLE";Vo.QUOTE_SINGLE="QUOTE_SINGLE";JA.Scalar=Vo;JA.isScalarValue=kfe});var lf=v(L4=>{"use strict";var Efe=cf(),da=De(),F4=Dt(),Afe="tag:yaml.org,2002:";function Tfe(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function Ofe(t,e,r){if(da.isDocument(t)&&(t=t.contents),da.isNode(t))return t;if(da.isPair(t)){let d=r.schema[da.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new Efe.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Afe+e.slice(2));let l=Tfe(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new F4.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?s[da.MAP]:Symbol.iterator in Object(t)?s[da.SEQ]:s[da.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new F4.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}L4.createNode=Ofe});var Ty=v(Ay=>{"use strict";var Rfe=lf(),Ei=De(),Ife=ky();function YA(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return Rfe.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var z4=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,XA=class extends Ife.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Ei.isNode(n)||Ei.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(z4(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(Ei.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,YA(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Ei.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&Ei.isScalar(o)?o.value:o:Ei.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ei.isPair(r))return!1;let n=r.value;return n==null||e&&Ei.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Ei.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(Ei.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,YA(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Ay.Collection=XA;Ay.collectionFromPath=YA;Ay.isEmptyPath=z4});var uf=v(Oy=>{"use strict";var Pfe=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function QA(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Cfe=(t,e,r)=>t.endsWith(` -`)?QA(r,e):r.includes(` +`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function h4(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function zA(){if(Be.env.NO_COLOR||Be.env.FORCE_COLOR==="0"||Be.env.FORCE_COLOR==="false")return!1;if(Be.env.FORCE_COLOR||Be.env.CLICOLOR_FORCE!==void 0)return!0}UA.Command=LA;UA.useColor=zA});var v4=v(kn=>{var{Argument:y4}=by(),{Command:qA}=g4(),{CommanderError:rfe,InvalidArgumentError:_4}=rf(),{Help:nfe}=PA(),{Option:b4}=jA();kn.program=new qA;kn.createCommand=t=>new qA(t);kn.createOption=(t,e)=>new b4(t,e);kn.createArgument=(t,e)=>new y4(t,e);kn.Command=qA;kn.Option=b4;kn.Argument=y4;kn.Help=nfe;kn.CommanderError=rfe;kn.InvalidArgumentError=_4;kn.InvalidOptionArgumentError=_4});var De=v(Qt=>{"use strict";var HA=Symbol.for("yaml.alias"),$4=Symbol.for("yaml.document"),Sy=Symbol.for("yaml.map"),k4=Symbol.for("yaml.pair"),GA=Symbol.for("yaml.scalar"),wy=Symbol.for("yaml.seq"),po=Symbol.for("yaml.node.type"),lfe=t=>!!t&&typeof t=="object"&&t[po]===HA,ufe=t=>!!t&&typeof t=="object"&&t[po]===$4,dfe=t=>!!t&&typeof t=="object"&&t[po]===Sy,ffe=t=>!!t&&typeof t=="object"&&t[po]===k4,E4=t=>!!t&&typeof t=="object"&&t[po]===GA,pfe=t=>!!t&&typeof t=="object"&&t[po]===wy;function A4(t){if(t&&typeof t=="object")switch(t[po]){case Sy:case wy:return!0}return!1}function mfe(t){if(t&&typeof t=="object")switch(t[po]){case HA:case Sy:case GA:case wy:return!0}return!1}var hfe=t=>(E4(t)||A4(t))&&!!t.anchor;Qt.ALIAS=HA;Qt.DOC=$4;Qt.MAP=Sy;Qt.NODE_TYPE=po;Qt.PAIR=k4;Qt.SCALAR=GA;Qt.SEQ=wy;Qt.hasAnchor=hfe;Qt.isAlias=lfe;Qt.isCollection=A4;Qt.isDocument=ufe;Qt.isMap=dfe;Qt.isNode=mfe;Qt.isPair=ffe;Qt.isScalar=E4;Qt.isSeq=pfe});var nf=v(ZA=>{"use strict";var Ut=De(),Cr=Symbol("break visit"),T4=Symbol("skip children"),Ai=Symbol("remove node");function xy(t,e){let r=O4(e);Ut.isDocument(t)?Qc(null,t.contents,r,Object.freeze([t]))===Ai&&(t.contents=null):Qc(null,t,r,Object.freeze([]))}xy.BREAK=Cr;xy.SKIP=T4;xy.REMOVE=Ai;function Qc(t,e,r,n){let i=R4(t,e,r,n);if(Ut.isNode(i)||Ut.isPair(i))return I4(t,n,i),Qc(t,i,r,n);if(typeof i!="symbol"){if(Ut.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o{"use strict";var P4=De(),gfe=nf(),yfe={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_fe=t=>t.replace(/[!,[\]{}]/g,e=>yfe[e]),of=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+_fe(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&P4.isNode(e.contents)){let o={};gfe.visit(e.contents,(s,a)=>{P4.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(` +`)}};of.defaultYaml={explicit:!1,version:"1.2"};of.defaultTags={"!!":"tag:yaml.org,2002:"};C4.Directives=of});var ky=v(sf=>{"use strict";var D4=De(),bfe=nf();function vfe(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function N4(t){let e=new Set;return bfe.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function j4(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function Sfe(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=N4(t));let s=j4(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(D4.isScalar(s.node)||D4.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}sf.anchorIsValid=vfe;sf.anchorNames=N4;sf.createNodeAnchors=Sfe;sf.findNewAnchor=j4});var WA=v(M4=>{"use strict";function af(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i{"use strict";var wfe=De();function F4(t,e,r){if(Array.isArray(t))return t.map((n,i)=>F4(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!wfe.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}L4.toJS=F4});var Ey=v(U4=>{"use strict";var xfe=WA(),z4=De(),$fe=Zo(),KA=class{constructor(e){Object.defineProperty(this,z4.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!z4.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=$fe.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?xfe.applyReviver(o,{"":a},"",a):a}};U4.NodeBase=KA});var cf=v(q4=>{"use strict";var kfe=ky(),Efe=nf(),tl=De(),Afe=Ey(),Tfe=Zo(),JA=class extends Afe.NodeBase{constructor(e){super(tl.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Efe.visit(e,{Node:(o,s)=>{(tl.isAlias(s)||tl.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(Tfe.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Ay(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(kfe.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function Ay(t,e,r){if(tl.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(tl.isCollection(e)){let n=0;for(let i of e.items){let o=Ay(t,i,r);o>n&&(n=o)}return n}else if(tl.isPair(e)){let n=Ay(t,e.key,r),i=Ay(t,e.value,r);return Math.max(n,i)}return 1}q4.Alias=JA});var Dt=v(YA=>{"use strict";var Ofe=De(),Rfe=Ey(),Ife=Zo(),Pfe=t=>!t||typeof t!="function"&&typeof t!="object",Vo=class extends Rfe.NodeBase{constructor(e){super(Ofe.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Ife.toJS(this.value,e,r)}toString(){return String(this.value)}};Vo.BLOCK_FOLDED="BLOCK_FOLDED";Vo.BLOCK_LITERAL="BLOCK_LITERAL";Vo.PLAIN="PLAIN";Vo.QUOTE_DOUBLE="QUOTE_DOUBLE";Vo.QUOTE_SINGLE="QUOTE_SINGLE";YA.Scalar=Vo;YA.isScalarValue=Pfe});var lf=v(H4=>{"use strict";var Cfe=cf(),da=De(),B4=Dt(),Dfe="tag:yaml.org,2002:";function Nfe(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function jfe(t,e,r){if(da.isDocument(t)&&(t=t.contents),da.isNode(t))return t;if(da.isPair(t)){let d=r.schema[da.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new Cfe.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Dfe+e.slice(2));let l=Nfe(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new B4.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?s[da.MAP]:Symbol.iterator in Object(t)?s[da.SEQ]:s[da.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new B4.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}H4.createNode=jfe});var Oy=v(Ty=>{"use strict";var Mfe=lf(),Ti=De(),Ffe=Ey();function XA(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return Mfe.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var G4=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,QA=class extends Ffe.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Ti.isNode(n)||Ti.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(G4(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(Ti.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,XA(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Ti.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&Ti.isScalar(o)?o.value:o:Ti.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ti.isPair(r))return!1;let n=r.value;return n==null||e&&Ti.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Ti.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(Ti.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,XA(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Ty.Collection=QA;Ty.collectionFromPath=XA;Ty.isEmptyPath=G4});var uf=v(Ry=>{"use strict";var Lfe=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function eT(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var zfe=(t,e,r)=>t.endsWith(` +`)?eT(r,e):r.includes(` `)?` -`+QA(r,e):(t.endsWith(" ")?"":" ")+r;Oy.indentComment=QA;Oy.lineComment=Cfe;Oy.stringifyComment=Pfe});var q4=v(df=>{"use strict";var Dfe="flow",eT="block",Ry="quoted";function Nfe(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,o)?l.push(0):d=i-n);let f,p,m=!1,h=-1,g=-1,b=-1;r===eT&&(h=U4(t,h,e.length),h!==-1&&(d=h+c));for(let S;S=t[h+=1];){if(r===Ry&&S==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(S===` -`)r===eT&&(h=U4(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(S===" "&&p&&p!==" "&&p!==` +`+eT(r,e):(t.endsWith(" ")?"":" ")+r;Ry.indentComment=eT;Ry.lineComment=zfe;Ry.stringifyComment=Lfe});var V4=v(df=>{"use strict";var Ufe="flow",tT="block",Iy="quoted";function qfe(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,o)?l.push(0):d=i-n);let f,p,m=!1,h=-1,g=-1,b=-1;r===tT&&(h=Z4(t,h,e.length),h!==-1&&(d=h+c));for(let S;S=t[h+=1];){if(r===Iy&&S==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(S===` +`)r===tT&&(h=Z4(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(S===" "&&p&&p!==" "&&p!==` `&&p!==" "){let x=t[h+1];x&&x!==" "&&x!==` -`&&x!==" "&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(r===Ry){for(;p===" "||p===" ";)p=S,S=t[h+=1],m=!0;let x=h>b+1?h-2:g-1;if(u[x])return t;l.push(x),u[x]=!0,d=x+c,f=void 0}else m=!0}p=S}if(m&&a&&a(),l.length===0)return t;s&&s();let _=t.slice(0,l[0]);for(let S=0;S{"use strict";var Wn=Dt(),Wo=q4(),Py=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Cy=t=>/^(%|---|\.\.\.)/m.test(t);function jfe(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;on)return!0;if(s=o+1,i-s<=n)return!1}return!0}function ff(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Cy(t)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let u=r.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length=d)if(f)l.push(f),d=f+c,f=void 0;else if(r===Iy){for(;p===" "||p===" ";)p=S,S=t[h+=1],m=!0;let x=h>b+1?h-2:g-1;if(u[x])return t;l.push(x),u[x]=!0,d=x+c,f=void 0}else m=!0}p=S}if(m&&a&&a(),l.length===0)return t;s&&s();let _=t.slice(0,l[0]);for(let S=0;S{"use strict";var Kn=Dt(),Wo=V4(),Cy=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Dy=t=>/^(%|---|\.\.\.)/m.test(t);function Bfe(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;on)return!0;if(s=o+1,i-s<=n)return!1}return!0}function ff(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Dy(t)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let u=r.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length `;let d,f;for(f=r.length;f>0;--f){let w=r[f-1];if(w!==` `&&w!==" "&&w!==" ")break}let p=r.substring(f),m=p.indexOf(` `);m===-1?d="-":r===p||m!==p.length-1?(d="+",o&&o()):d="",p&&(r=r.slice(0,-p.length),p[p.length-1]===` -`&&(p=p.slice(0,-1)),p=p.replace(rT,`$&${l}`));let h=!1,g,b=-1;for(g=0;g{O=!0});let A=Wo.foldFlowLines(`${_}${w}${p}`,l,Wo.FOLD_BLOCK,T);if(!O)return`>${x} +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),O=!1,T=Cy(n,!0);s!=="folded"&&e!==Kn.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{O=!0});let A=Wo.foldFlowLines(`${_}${w}${p}`,l,Wo.FOLD_BLOCK,T);if(!O)return`>${x} ${l}${A}`}return r=r.replace(/\n+/g,`$&${l}`),`|${x} -${l}${_}${r}${p}`}function Mfe(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(` -`)||u&&/[[\]{},]/.test(o))return Qc(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` -`)?Qc(o,e):Iy(t,e,r,n);if(!a&&!u&&i!==Wn.Scalar.PLAIN&&o.includes(` -`))return Iy(t,e,r,n);if(Cy(o)){if(c==="")return e.forceBlockIndent=!0,Iy(t,e,r,n);if(a&&c===l)return Qc(o,e)}let d=o.replace(/\n+/g,`$& -${c}`);if(s){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:m}=e.doc.schema;if(m.some(f)||p?.some(f))return Qc(o,e)}return a?d:Wo.foldFlowLines(d,c,Wo.FOLD_FLOW,Py(e,!1))}function Ffe(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Wn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Wn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Wn.Scalar.BLOCK_FOLDED:case Wn.Scalar.BLOCK_LITERAL:return i||o?Qc(s.value,e):Iy(s,e,r,n);case Wn.Scalar.QUOTE_DOUBLE:return ff(s.value,e);case Wn.Scalar.QUOTE_SINGLE:return tT(s.value,e);case Wn.Scalar.PLAIN:return Mfe(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}B4.stringifyString=Ffe});var mf=v(nT=>{"use strict";var Lfe=$y(),Ko=De(),zfe=uf(),Ufe=pf();function qfe(t,e){let r=Object.assign({blockQuote:!0,commentString:zfe.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Bfe(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(Ko.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Hfe(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(Ko.isScalar(t)||Ko.isCollection(t))&&t.anchor;o&&Lfe.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Gfe(t,e,r,n){if(Ko.isPair(t))return t.toString(e,r,n);if(Ko.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=Ko.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Bfe(e.doc.schema.tags,o));let s=Hfe(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):Ko.isScalar(o)?Ufe.stringifyString(o,e,r,n):o.toString(e,r,n);return s?Ko.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} -${e.indent}${a}`:a}nT.createStringifyContext=qfe;nT.stringify=Gfe});var V4=v(Z4=>{"use strict";var po=De(),H4=Dt(),G4=mf(),hf=uf();function Zfe({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=po.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(po.isCollection(t)||!po.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||po.isCollection(t)||(po.isScalar(t)?t.type===H4.Scalar.BLOCK_FOLDED||t.type===H4.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!o),indent:a+c});let m=!1,h=!1,g=G4.stringify(t,r,()=>m=!0,()=>h=!0);if(!p&&!r.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(o||e==null)return m&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(o&&!d||e==null&&p)return g=`? ${g}`,f&&!m?g+=hf.lineComment(g,r.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=hf.lineComment(g,r.indent,l(f))),g=`? ${g} -${a}:`):(g=`${g}:`,f&&(g+=hf.lineComment(g,r.indent,l(f))));let b,_,S;po.isNode(e)?(b=!!e.spaceBefore,_=e.commentBefore,S=e.comment):(b=!1,_=null,S=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!p&&!f&&po.isScalar(e)&&(r.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&po.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let x=!1,w=G4.stringify(e,r,()=>x=!0,()=>h=!0),O=" ";if(f||b||_){if(O=b?` +${l}${_}${r}${p}`}function Hfe(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(` +`)||u&&/[[\]{},]/.test(o))return rl(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` +`)?rl(o,e):Py(t,e,r,n);if(!a&&!u&&i!==Kn.Scalar.PLAIN&&o.includes(` +`))return Py(t,e,r,n);if(Dy(o)){if(c==="")return e.forceBlockIndent=!0,Py(t,e,r,n);if(a&&c===l)return rl(o,e)}let d=o.replace(/\n+/g,`$& +${c}`);if(s){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:m}=e.doc.schema;if(m.some(f)||p?.some(f))return rl(o,e)}return a?d:Wo.foldFlowLines(d,c,Wo.FOLD_FLOW,Cy(e,!1))}function Gfe(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Kn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Kn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Kn.Scalar.BLOCK_FOLDED:case Kn.Scalar.BLOCK_LITERAL:return i||o?rl(s.value,e):Py(s,e,r,n);case Kn.Scalar.QUOTE_DOUBLE:return ff(s.value,e);case Kn.Scalar.QUOTE_SINGLE:return rT(s.value,e);case Kn.Scalar.PLAIN:return Hfe(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}W4.stringifyString=Gfe});var mf=v(iT=>{"use strict";var Zfe=ky(),Ko=De(),Vfe=uf(),Wfe=pf();function Kfe(t,e){let r=Object.assign({blockQuote:!0,commentString:Vfe.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Jfe(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(Ko.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Yfe(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(Ko.isScalar(t)||Ko.isCollection(t))&&t.anchor;o&&Zfe.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Xfe(t,e,r,n){if(Ko.isPair(t))return t.toString(e,r,n);if(Ko.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=Ko.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Jfe(e.doc.schema.tags,o));let s=Yfe(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):Ko.isScalar(o)?Wfe.stringifyString(o,e,r,n):o.toString(e,r,n);return s?Ko.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} +${e.indent}${a}`:a}iT.createStringifyContext=Kfe;iT.stringify=Xfe});var X4=v(Y4=>{"use strict";var mo=De(),K4=Dt(),J4=mf(),hf=uf();function Qfe({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=mo.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(mo.isCollection(t)||!mo.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||mo.isCollection(t)||(mo.isScalar(t)?t.type===K4.Scalar.BLOCK_FOLDED||t.type===K4.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!o),indent:a+c});let m=!1,h=!1,g=J4.stringify(t,r,()=>m=!0,()=>h=!0);if(!p&&!r.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(o||e==null)return m&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(o&&!d||e==null&&p)return g=`? ${g}`,f&&!m?g+=hf.lineComment(g,r.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=hf.lineComment(g,r.indent,l(f))),g=`? ${g} +${a}:`):(g=`${g}:`,f&&(g+=hf.lineComment(g,r.indent,l(f))));let b,_,S;mo.isNode(e)?(b=!!e.spaceBefore,_=e.commentBefore,S=e.comment):(b=!1,_=null,S=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!p&&!f&&mo.isScalar(e)&&(r.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&mo.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let x=!1,w=J4.stringify(e,r,()=>x=!0,()=>h=!0),O=" ";if(f||b||_){if(O=b?` `:"",_){let T=l(_);O+=` ${hf.indentComment(T,r.indent)}`}w===""&&!r.inFlow?O===` `&&S&&(O=` `):O+=` -${r.indent}`}else if(!p&&po.isCollection(e)){let T=w[0],A=w.indexOf(` -`),D=A!==-1,$=r.inFlow??e.flow??e.items.length===0;if(D||!$){let re=!1;if(D&&(T==="&"||T==="!")){let K=w.indexOf(" ");T==="&"&&K!==-1&&K{"use strict";var W4=Ge("process");function Vfe(t,...e){t==="debug"&&console.log(...e)}function Wfe(t,e){(t==="debug"||t==="warn")&&(typeof W4.emitWarning=="function"?W4.emitWarning(e):console.warn(e))}iT.debug=Vfe;iT.warn=Wfe});var Fy=v(My=>{"use strict";var jy=De(),K4=Dt(),Dy="<<",Ny={identify:t=>t===Dy||typeof t=="symbol"&&t.description===Dy,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new K4.Scalar(Symbol(Dy)),{addToJSMap:J4}),stringify:()=>Dy},Kfe=(t,e)=>(Ny.identify(e)||jy.isScalar(e)&&(!e.type||e.type===K4.Scalar.PLAIN)&&Ny.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Ny.tag&&r.default);function J4(t,e,r){let n=Y4(t,r);if(jy.isSeq(n))for(let i of n.items)sT(t,e,i);else if(Array.isArray(n))for(let i of n)sT(t,e,i);else sT(t,e,n)}function sT(t,e,r){let n=Y4(t,r);if(!jy.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function Y4(t,e){return t&&jy.isAlias(e)?e.resolve(t.doc,t):e}My.addMergeToJSMap=J4;My.isMergeKey=Kfe;My.merge=Ny});var cT=v(e6=>{"use strict";var Jfe=oT(),X4=Fy(),Yfe=mf(),Q4=De(),aT=Zo();function Xfe(t,e,{key:r,value:n}){if(Q4.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(X4.isMergeKey(t,r))X4.addMergeToJSMap(t,e,n);else{let i=aT.toJS(r,"",t);if(e instanceof Map)e.set(i,aT.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=Qfe(r,i,t),s=aT.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function Qfe(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Q4.isNode(t)&&r?.doc){let n=Yfe.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),Jfe.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}e6.addPairToJSMap=Xfe});var Jo=v(lT=>{"use strict";var t6=lf(),epe=V4(),tpe=cT(),Ly=De();function rpe(t,e,r){let n=t6.createNode(t,void 0,r),i=t6.createNode(e,void 0,r);return new zy(n,i)}var zy=class t{constructor(e,r=null){Object.defineProperty(this,Ly.NODE_TYPE,{value:Ly.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Ly.isNode(r)&&(r=r.clone(e)),Ly.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return tpe.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?epe.stringifyPair(this,e,r,n):JSON.stringify(this)}};lT.Pair=zy;lT.createPair=rpe});var uT=v(n6=>{"use strict";var fa=De(),r6=mf(),Uy=uf();function npe(t,e,r){return(e.inFlow??t.flow?ope:ipe)(t,e,r)}function ipe({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(b+=Uy.lineComment(b,o,l(g))),d&&g&&(d=!1),f.push(n+b)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;m{"use strict";var Q4=Ge("process");function epe(t,...e){t==="debug"&&console.log(...e)}function tpe(t,e){(t==="debug"||t==="warn")&&(typeof Q4.emitWarning=="function"?Q4.emitWarning(e):console.warn(e))}oT.debug=epe;oT.warn=tpe});var Ly=v(Fy=>{"use strict";var My=De(),e6=Dt(),Ny="<<",jy={identify:t=>t===Ny||typeof t=="symbol"&&t.description===Ny,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new e6.Scalar(Symbol(Ny)),{addToJSMap:t6}),stringify:()=>Ny},rpe=(t,e)=>(jy.identify(e)||My.isScalar(e)&&(!e.type||e.type===e6.Scalar.PLAIN)&&jy.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===jy.tag&&r.default);function t6(t,e,r){let n=r6(t,r);if(My.isSeq(n))for(let i of n.items)aT(t,e,i);else if(Array.isArray(n))for(let i of n)aT(t,e,i);else aT(t,e,n)}function aT(t,e,r){let n=r6(t,r);if(!My.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function r6(t,e){return t&&My.isAlias(e)?e.resolve(t.doc,t):e}Fy.addMergeToJSMap=t6;Fy.isMergeKey=rpe;Fy.merge=jy});var lT=v(o6=>{"use strict";var npe=sT(),n6=Ly(),ipe=mf(),i6=De(),cT=Zo();function ope(t,e,{key:r,value:n}){if(i6.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(n6.isMergeKey(t,r))n6.addMergeToJSMap(t,e,n);else{let i=cT.toJS(r,"",t);if(e instanceof Map)e.set(i,cT.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=spe(r,i,t),s=cT.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function spe(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(i6.isNode(t)&&r?.doc){let n=ipe.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),npe.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}o6.addPairToJSMap=ope});var Jo=v(uT=>{"use strict";var s6=lf(),ape=X4(),cpe=lT(),zy=De();function lpe(t,e,r){let n=s6.createNode(t,void 0,r),i=s6.createNode(e,void 0,r);return new Uy(n,i)}var Uy=class t{constructor(e,r=null){Object.defineProperty(this,zy.NODE_TYPE,{value:zy.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return zy.isNode(r)&&(r=r.clone(e)),zy.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return cpe.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?ape.stringifyPair(this,e,r,n):JSON.stringify(this)}};uT.Pair=Uy;uT.createPair=lpe});var dT=v(c6=>{"use strict";var fa=De(),a6=mf(),qy=uf();function upe(t,e,r){return(e.inFlow??t.flow?fpe:dpe)(t,e,r)}function dpe({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(b+=qy.lineComment(b,o,l(g))),d&&g&&(d=!1),f.push(n+b)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;mg=null);l||(l=d.length>u||b.includes(` -`)),m0&&(l||(l=d.reduce((_,S)=>_+S.length+2,2)+(b.length+2)>e.options.lineWidth)),l&&(b+=",")),g&&(b+=Uy.lineComment(b,n,a(g))),d.push(b),u=d.length}let{start:f,end:p}=r;if(d.length===0)return f+p;if(!l){let m=d.reduce((h,g)=>h+g.length+2,2);l=e.options.lineWidth>0&&m>e.options.lineWidth}if(l){let m=f;for(let h of d)m+=h?` +`+qy.indentComment(l(t),c),a&&a()):d&&s&&s(),p}function fpe({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;n+=o;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let m=0;mg=null);l||(l=d.length>u||b.includes(` +`)),m0&&(l||(l=d.reduce((_,S)=>_+S.length+2,2)+(b.length+2)>e.options.lineWidth)),l&&(b+=",")),g&&(b+=qy.lineComment(b,n,a(g))),d.push(b),u=d.length}let{start:f,end:p}=r;if(d.length===0)return f+p;if(!l){let m=d.reduce((h,g)=>h+g.length+2,2);l=e.options.lineWidth>0&&m>e.options.lineWidth}if(l){let m=f;for(let h of d)m+=h?` ${o}${i}${h}`:` `;return`${m} -${i}${p}`}else return`${f}${s}${d.join(" ")}${s}${p}`}function qy({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=Uy.indentComment(e(n),t);r.push(o.trimStart())}}n6.stringifyCollection=npe});var Xo=v(fT=>{"use strict";var spe=uT(),ape=cT(),cpe=Ty(),Yo=De(),By=Jo(),lpe=Dt();function gf(t,e){let r=Yo.isScalar(e)?e.value:e;for(let n of t)if(Yo.isPair(n)&&(n.key===e||n.key===r||Yo.isScalar(n.key)&&n.key.value===r))return n}var dT=class extends cpe.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Yo.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(By.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;Yo.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new By.Pair(e,e?.value):n=new By.Pair(e.key,e.value);let i=gf(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Yo.isScalar(i.value)&&lpe.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=gf(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=gf(this.items,e)?.value;return(!r&&Yo.isScalar(i)?i.value:i)??void 0}has(e){return!!gf(this.items,e)}set(e,r){this.add(new By.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)ape.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Yo.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),spe.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};fT.YAMLMap=dT;fT.findPair=gf});var el=v(o6=>{"use strict";var upe=De(),i6=Xo(),dpe={collection:"map",default:!0,nodeClass:i6.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return upe.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>i6.YAMLMap.from(t,e,r)};o6.map=dpe});var Qo=v(s6=>{"use strict";var fpe=lf(),ppe=uT(),mpe=Ty(),Gy=De(),hpe=Dt(),gpe=Zo(),pT=class extends mpe.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Gy.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Hy(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Hy(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Gy.isScalar(i)?i.value:i}has(e){let r=Hy(e);return typeof r=="number"&&r=0?e:null}s6.YAMLSeq=pT});var tl=v(c6=>{"use strict";var ype=De(),a6=Qo(),_pe={collection:"seq",default:!0,nodeClass:a6.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return ype.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>a6.YAMLSeq.from(t,e,r)};c6.seq=_pe});var yf=v(l6=>{"use strict";var bpe=pf(),vpe={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),bpe.stringifyString(t,e,r,n)}};l6.string=vpe});var Zy=v(f6=>{"use strict";var u6=Dt(),d6={identify:t=>t==null,createNode:()=>new u6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new u6.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&d6.test.test(t)?t:e.options.nullStr};f6.nullTag=d6});var mT=v(m6=>{"use strict";var Spe=Dt(),p6={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Spe.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&p6.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};m6.boolTag=p6});var rl=v(h6=>{"use strict";function wpe({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}h6.stringifyNumber=wpe});var gT=v(Vy=>{"use strict";var xpe=Dt(),hT=rl(),$pe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:hT.stringifyNumber},kpe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():hT.stringifyNumber(t)}},Epe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new xpe.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:hT.stringifyNumber};Vy.float=Epe;Vy.floatExp=kpe;Vy.floatNaN=$pe});var _T=v(Ky=>{"use strict";var g6=rl(),Wy=t=>typeof t=="bigint"||Number.isInteger(t),yT=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function y6(t,e,r){let{value:n}=t;return Wy(n)&&n>=0?r+n.toString(e):g6.stringifyNumber(t)}var Ape={identify:t=>Wy(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>yT(t,2,8,r),stringify:t=>y6(t,8,"0o")},Tpe={identify:Wy,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>yT(t,0,10,r),stringify:g6.stringifyNumber},Ope={identify:t=>Wy(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>yT(t,2,16,r),stringify:t=>y6(t,16,"0x")};Ky.int=Tpe;Ky.intHex=Ope;Ky.intOct=Ape});var b6=v(_6=>{"use strict";var Rpe=el(),Ipe=Zy(),Ppe=tl(),Cpe=yf(),Dpe=mT(),bT=gT(),vT=_T(),Npe=[Rpe.map,Ppe.seq,Cpe.string,Ipe.nullTag,Dpe.boolTag,vT.intOct,vT.int,vT.intHex,bT.floatNaN,bT.floatExp,bT.float];_6.schema=Npe});var w6=v(S6=>{"use strict";var jpe=Dt(),Mpe=el(),Fpe=tl();function v6(t){return typeof t=="bigint"||Number.isInteger(t)}var Jy=({value:t})=>JSON.stringify(t),Lpe=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Jy},{identify:t=>t==null,createNode:()=>new jpe.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Jy},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Jy},{identify:v6,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>v6(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Jy}],zpe={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Upe=[Mpe.map,Fpe.seq].concat(Lpe,zpe);S6.schema=Upe});var wT=v(x6=>{"use strict";var _f=Ge("buffer"),ST=Dt(),qpe=pf(),Bpe={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof _f.Buffer=="function")return _f.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i{"use strict";var Yy=De(),xT=Jo(),Hpe=Dt(),Gpe=Qo();function $6(t,e){if(Yy.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new xT.Pair(new Hpe.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore} +${i}${p}`}else return`${f}${s}${d.join(" ")}${s}${p}`}function By({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=qy.indentComment(e(n),t);r.push(o.trimStart())}}c6.stringifyCollection=upe});var Xo=v(pT=>{"use strict";var ppe=dT(),mpe=lT(),hpe=Oy(),Yo=De(),Hy=Jo(),gpe=Dt();function gf(t,e){let r=Yo.isScalar(e)?e.value:e;for(let n of t)if(Yo.isPair(n)&&(n.key===e||n.key===r||Yo.isScalar(n.key)&&n.key.value===r))return n}var fT=class extends hpe.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Yo.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(Hy.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;Yo.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Hy.Pair(e,e?.value):n=new Hy.Pair(e.key,e.value);let i=gf(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Yo.isScalar(i.value)&&gpe.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=gf(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=gf(this.items,e)?.value;return(!r&&Yo.isScalar(i)?i.value:i)??void 0}has(e){return!!gf(this.items,e)}set(e,r){this.add(new Hy.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)mpe.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Yo.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ppe.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};pT.YAMLMap=fT;pT.findPair=gf});var nl=v(u6=>{"use strict";var ype=De(),l6=Xo(),_pe={collection:"map",default:!0,nodeClass:l6.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return ype.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>l6.YAMLMap.from(t,e,r)};u6.map=_pe});var Qo=v(d6=>{"use strict";var bpe=lf(),vpe=dT(),Spe=Oy(),Zy=De(),wpe=Dt(),xpe=Zo(),mT=class extends Spe.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Zy.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Gy(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Gy(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Zy.isScalar(i)?i.value:i}has(e){let r=Gy(e);return typeof r=="number"&&r=0?e:null}d6.YAMLSeq=mT});var il=v(p6=>{"use strict";var $pe=De(),f6=Qo(),kpe={collection:"seq",default:!0,nodeClass:f6.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return $pe.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>f6.YAMLSeq.from(t,e,r)};p6.seq=kpe});var yf=v(m6=>{"use strict";var Epe=pf(),Ape={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),Epe.stringifyString(t,e,r,n)}};m6.string=Ape});var Vy=v(y6=>{"use strict";var h6=Dt(),g6={identify:t=>t==null,createNode:()=>new h6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new h6.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&g6.test.test(t)?t:e.options.nullStr};y6.nullTag=g6});var hT=v(b6=>{"use strict";var Tpe=Dt(),_6={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Tpe.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&_6.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};b6.boolTag=_6});var ol=v(v6=>{"use strict";function Ope({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}v6.stringifyNumber=Ope});var yT=v(Wy=>{"use strict";var Rpe=Dt(),gT=ol(),Ipe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:gT.stringifyNumber},Ppe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():gT.stringifyNumber(t)}},Cpe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Rpe.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:gT.stringifyNumber};Wy.float=Cpe;Wy.floatExp=Ppe;Wy.floatNaN=Ipe});var bT=v(Jy=>{"use strict";var S6=ol(),Ky=t=>typeof t=="bigint"||Number.isInteger(t),_T=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function w6(t,e,r){let{value:n}=t;return Ky(n)&&n>=0?r+n.toString(e):S6.stringifyNumber(t)}var Dpe={identify:t=>Ky(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>_T(t,2,8,r),stringify:t=>w6(t,8,"0o")},Npe={identify:Ky,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>_T(t,0,10,r),stringify:S6.stringifyNumber},jpe={identify:t=>Ky(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>_T(t,2,16,r),stringify:t=>w6(t,16,"0x")};Jy.int=Npe;Jy.intHex=jpe;Jy.intOct=Dpe});var $6=v(x6=>{"use strict";var Mpe=nl(),Fpe=Vy(),Lpe=il(),zpe=yf(),Upe=hT(),vT=yT(),ST=bT(),qpe=[Mpe.map,Lpe.seq,zpe.string,Fpe.nullTag,Upe.boolTag,ST.intOct,ST.int,ST.intHex,vT.floatNaN,vT.floatExp,vT.float];x6.schema=qpe});var A6=v(E6=>{"use strict";var Bpe=Dt(),Hpe=nl(),Gpe=il();function k6(t){return typeof t=="bigint"||Number.isInteger(t)}var Yy=({value:t})=>JSON.stringify(t),Zpe=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Yy},{identify:t=>t==null,createNode:()=>new Bpe.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Yy},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Yy},{identify:k6,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>k6(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Yy}],Vpe={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Wpe=[Hpe.map,Gpe.seq].concat(Zpe,Vpe);E6.schema=Wpe});var xT=v(T6=>{"use strict";var _f=Ge("buffer"),wT=Dt(),Kpe=pf(),Jpe={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof _f.Buffer=="function")return _f.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i{"use strict";var Xy=De(),$T=Jo(),Ype=Dt(),Xpe=Qo();function O6(t,e){if(Xy.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new $T.Pair(new Ype.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore} ${i.key.commentBefore}`:n.commentBefore),n.comment){let o=i.value??i.key;o.comment=o.comment?`${n.comment} -${o.comment}`:n.comment}n=i}t.items[r]=Yy.isPair(n)?n:new xT.Pair(n)}}else e("Expected a sequence for this tag");return t}function k6(t,e,r){let{replacer:n}=r,i=new Gpe.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(xT.createPair(a,c,r))}return i}var Zpe={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:$6,createNode:k6};Xy.createPairs=k6;Xy.pairs=Zpe;Xy.resolvePairs=$6});var ET=v(kT=>{"use strict";var E6=De(),$T=Zo(),bf=Xo(),Vpe=Qo(),A6=Qy(),pa=class t extends Vpe.YAMLSeq{constructor(){super(),this.add=bf.YAMLMap.prototype.add.bind(this),this.delete=bf.YAMLMap.prototype.delete.bind(this),this.get=bf.YAMLMap.prototype.get.bind(this),this.has=bf.YAMLMap.prototype.has.bind(this),this.set=bf.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(E6.isPair(i)?(o=$T.toJS(i.key,"",r),s=$T.toJS(i.value,o,r)):o=$T.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=A6.createPairs(e,r,n),o=new this;return o.items=i.items,o}};pa.tag="tag:yaml.org,2002:omap";var Wpe={collection:"seq",identify:t=>t instanceof Map,nodeClass:pa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=A6.resolvePairs(t,e),n=[];for(let{key:i}of r.items)E6.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new pa,r)},createNode:(t,e,r)=>pa.from(t,e,r)};kT.YAMLOMap=pa;kT.omap=Wpe});var P6=v(AT=>{"use strict";var T6=Dt();function O6({value:t,source:e},r){return e&&(t?R6:I6).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var R6={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new T6.Scalar(!0),stringify:O6},I6={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new T6.Scalar(!1),stringify:O6};AT.falseTag=I6;AT.trueTag=R6});var C6=v(e_=>{"use strict";var Kpe=Dt(),TT=rl(),Jpe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:TT.stringifyNumber},Ype={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():TT.stringifyNumber(t)}},Xpe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Kpe.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:TT.stringifyNumber};e_.float=Xpe;e_.floatExp=Ype;e_.floatNaN=Jpe});var N6=v(Sf=>{"use strict";var D6=rl(),vf=t=>typeof t=="bigint"||Number.isInteger(t);function t_(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function OT(t,e,r){let{value:n}=t;if(vf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return D6.stringifyNumber(t)}var Qpe={identify:vf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>t_(t,2,2,r),stringify:t=>OT(t,2,"0b")},eme={identify:vf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>t_(t,1,8,r),stringify:t=>OT(t,8,"0")},tme={identify:vf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>t_(t,0,10,r),stringify:D6.stringifyNumber},rme={identify:vf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>t_(t,2,16,r),stringify:t=>OT(t,16,"0x")};Sf.int=tme;Sf.intBin=Qpe;Sf.intHex=rme;Sf.intOct=eme});var IT=v(RT=>{"use strict";var i_=De(),r_=Jo(),n_=Xo(),ma=class t extends n_.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;i_.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new r_.Pair(e.key,null):r=new r_.Pair(e,null),n_.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=n_.findPair(this.items,e);return!r&&i_.isPair(n)?i_.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=n_.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new r_.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(r_.createPair(s,null,n));return o}};ma.tag="tag:yaml.org,2002:set";var nme={collection:"map",identify:t=>t instanceof Set,nodeClass:ma,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ma.from(t,e,r),resolve(t,e){if(i_.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ma,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};RT.YAMLSet=ma;RT.set=nme});var CT=v(o_=>{"use strict";var ime=rl();function PT(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function j6(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return ime.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var ome={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>PT(t,r),stringify:j6},sme={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>PT(t,!1),stringify:j6},M6={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(M6.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=PT(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};o_.floatTime=sme;o_.intTime=ome;o_.timestamp=M6});var z6=v(L6=>{"use strict";var ame=el(),cme=Zy(),lme=tl(),ume=yf(),dme=wT(),F6=P6(),DT=C6(),s_=N6(),fme=Fy(),pme=ET(),mme=Qy(),hme=IT(),NT=CT(),gme=[ame.map,lme.seq,ume.string,cme.nullTag,F6.trueTag,F6.falseTag,s_.intBin,s_.intOct,s_.int,s_.intHex,DT.floatNaN,DT.floatExp,DT.float,dme.binary,fme.merge,pme.omap,mme.pairs,hme.set,NT.intTime,NT.floatTime,NT.timestamp];L6.schema=gme});var J6=v(FT=>{"use strict";var H6=el(),yme=Zy(),G6=tl(),_me=yf(),bme=mT(),jT=gT(),MT=_T(),vme=b6(),Sme=w6(),Z6=wT(),wf=Fy(),V6=ET(),W6=Qy(),U6=z6(),K6=IT(),a_=CT(),q6=new Map([["core",vme.schema],["failsafe",[H6.map,G6.seq,_me.string]],["json",Sme.schema],["yaml11",U6.schema],["yaml-1.1",U6.schema]]),B6={binary:Z6.binary,bool:bme.boolTag,float:jT.float,floatExp:jT.floatExp,floatNaN:jT.floatNaN,floatTime:a_.floatTime,int:MT.int,intHex:MT.intHex,intOct:MT.intOct,intTime:a_.intTime,map:H6.map,merge:wf.merge,null:yme.nullTag,omap:V6.omap,pairs:W6.pairs,seq:G6.seq,set:K6.set,timestamp:a_.timestamp},wme={"tag:yaml.org,2002:binary":Z6.binary,"tag:yaml.org,2002:merge":wf.merge,"tag:yaml.org,2002:omap":V6.omap,"tag:yaml.org,2002:pairs":W6.pairs,"tag:yaml.org,2002:set":K6.set,"tag:yaml.org,2002:timestamp":a_.timestamp};function xme(t,e,r){let n=q6.get(e);if(n&&!t)return r&&!n.includes(wf.merge)?n.concat(wf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(q6.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(wf.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?B6[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(B6).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}FT.coreKnownTags=wme;FT.getTags=xme});var UT=v(Y6=>{"use strict";var LT=De(),$me=el(),kme=tl(),Eme=yf(),c_=J6(),Ame=(t,e)=>t.keye.key?1:0,zT=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?c_.getTags(e,"compat"):e?c_.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?c_.coreKnownTags:{},this.tags=c_.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,LT.MAP,{value:$me.map}),Object.defineProperty(this,LT.SCALAR,{value:Eme.string}),Object.defineProperty(this,LT.SEQ,{value:kme.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Ame:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Y6.Schema=zT});var Q6=v(X6=>{"use strict";var Tme=De(),qT=mf(),xf=uf();function Ome(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=qT.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(xf.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(Tme.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(xf.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=qT.stringify(t.contents,i,()=>a=null,c);a&&(l+=xf.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(qT.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(` +${o.comment}`:n.comment}n=i}t.items[r]=Xy.isPair(n)?n:new $T.Pair(n)}}else e("Expected a sequence for this tag");return t}function R6(t,e,r){let{replacer:n}=r,i=new Xpe.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push($T.createPair(a,c,r))}return i}var Qpe={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:O6,createNode:R6};Qy.createPairs=R6;Qy.pairs=Qpe;Qy.resolvePairs=O6});var AT=v(ET=>{"use strict";var I6=De(),kT=Zo(),bf=Xo(),eme=Qo(),P6=e_(),pa=class t extends eme.YAMLSeq{constructor(){super(),this.add=bf.YAMLMap.prototype.add.bind(this),this.delete=bf.YAMLMap.prototype.delete.bind(this),this.get=bf.YAMLMap.prototype.get.bind(this),this.has=bf.YAMLMap.prototype.has.bind(this),this.set=bf.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(I6.isPair(i)?(o=kT.toJS(i.key,"",r),s=kT.toJS(i.value,o,r)):o=kT.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=P6.createPairs(e,r,n),o=new this;return o.items=i.items,o}};pa.tag="tag:yaml.org,2002:omap";var tme={collection:"seq",identify:t=>t instanceof Map,nodeClass:pa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=P6.resolvePairs(t,e),n=[];for(let{key:i}of r.items)I6.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new pa,r)},createNode:(t,e,r)=>pa.from(t,e,r)};ET.YAMLOMap=pa;ET.omap=tme});var M6=v(TT=>{"use strict";var C6=Dt();function D6({value:t,source:e},r){return e&&(t?N6:j6).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var N6={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new C6.Scalar(!0),stringify:D6},j6={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new C6.Scalar(!1),stringify:D6};TT.falseTag=j6;TT.trueTag=N6});var F6=v(t_=>{"use strict";var rme=Dt(),OT=ol(),nme={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:OT.stringifyNumber},ime={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():OT.stringifyNumber(t)}},ome={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new rme.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:OT.stringifyNumber};t_.float=ome;t_.floatExp=ime;t_.floatNaN=nme});var z6=v(Sf=>{"use strict";var L6=ol(),vf=t=>typeof t=="bigint"||Number.isInteger(t);function r_(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function RT(t,e,r){let{value:n}=t;if(vf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return L6.stringifyNumber(t)}var sme={identify:vf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>r_(t,2,2,r),stringify:t=>RT(t,2,"0b")},ame={identify:vf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>r_(t,1,8,r),stringify:t=>RT(t,8,"0")},cme={identify:vf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>r_(t,0,10,r),stringify:L6.stringifyNumber},lme={identify:vf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>r_(t,2,16,r),stringify:t=>RT(t,16,"0x")};Sf.int=cme;Sf.intBin=sme;Sf.intHex=lme;Sf.intOct=ame});var PT=v(IT=>{"use strict";var o_=De(),n_=Jo(),i_=Xo(),ma=class t extends i_.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;o_.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new n_.Pair(e.key,null):r=new n_.Pair(e,null),i_.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=i_.findPair(this.items,e);return!r&&o_.isPair(n)?o_.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=i_.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new n_.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(n_.createPair(s,null,n));return o}};ma.tag="tag:yaml.org,2002:set";var ume={collection:"map",identify:t=>t instanceof Set,nodeClass:ma,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ma.from(t,e,r),resolve(t,e){if(o_.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ma,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};IT.YAMLSet=ma;IT.set=ume});var DT=v(s_=>{"use strict";var dme=ol();function CT(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function U6(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return dme.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var fme={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>CT(t,r),stringify:U6},pme={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>CT(t,!1),stringify:U6},q6={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(q6.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=CT(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};s_.floatTime=pme;s_.intTime=fme;s_.timestamp=q6});var G6=v(H6=>{"use strict";var mme=nl(),hme=Vy(),gme=il(),yme=yf(),_me=xT(),B6=M6(),NT=F6(),a_=z6(),bme=Ly(),vme=AT(),Sme=e_(),wme=PT(),jT=DT(),xme=[mme.map,gme.seq,yme.string,hme.nullTag,B6.trueTag,B6.falseTag,a_.intBin,a_.intOct,a_.int,a_.intHex,NT.floatNaN,NT.floatExp,NT.float,_me.binary,bme.merge,vme.omap,Sme.pairs,wme.set,jT.intTime,jT.floatTime,jT.timestamp];H6.schema=xme});var tB=v(LT=>{"use strict";var K6=nl(),$me=Vy(),J6=il(),kme=yf(),Eme=hT(),MT=yT(),FT=bT(),Ame=$6(),Tme=A6(),Y6=xT(),wf=Ly(),X6=AT(),Q6=e_(),Z6=G6(),eB=PT(),c_=DT(),V6=new Map([["core",Ame.schema],["failsafe",[K6.map,J6.seq,kme.string]],["json",Tme.schema],["yaml11",Z6.schema],["yaml-1.1",Z6.schema]]),W6={binary:Y6.binary,bool:Eme.boolTag,float:MT.float,floatExp:MT.floatExp,floatNaN:MT.floatNaN,floatTime:c_.floatTime,int:FT.int,intHex:FT.intHex,intOct:FT.intOct,intTime:c_.intTime,map:K6.map,merge:wf.merge,null:$me.nullTag,omap:X6.omap,pairs:Q6.pairs,seq:J6.seq,set:eB.set,timestamp:c_.timestamp},Ome={"tag:yaml.org,2002:binary":Y6.binary,"tag:yaml.org,2002:merge":wf.merge,"tag:yaml.org,2002:omap":X6.omap,"tag:yaml.org,2002:pairs":Q6.pairs,"tag:yaml.org,2002:set":eB.set,"tag:yaml.org,2002:timestamp":c_.timestamp};function Rme(t,e,r){let n=V6.get(e);if(n&&!t)return r&&!n.includes(wf.merge)?n.concat(wf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(V6.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(wf.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?W6[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(W6).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}LT.coreKnownTags=Ome;LT.getTags=Rme});var qT=v(rB=>{"use strict";var zT=De(),Ime=nl(),Pme=il(),Cme=yf(),l_=tB(),Dme=(t,e)=>t.keye.key?1:0,UT=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?l_.getTags(e,"compat"):e?l_.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?l_.coreKnownTags:{},this.tags=l_.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,zT.MAP,{value:Ime.map}),Object.defineProperty(this,zT.SCALAR,{value:Cme.string}),Object.defineProperty(this,zT.SEQ,{value:Pme.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Dme:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};rB.Schema=UT});var iB=v(nB=>{"use strict";var Nme=De(),BT=mf(),xf=uf();function jme(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=BT.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(xf.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(Nme.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(xf.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=BT.stringify(t.contents,i,()=>a=null,c);a&&(l+=xf.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(BT.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(` `)?(r.push("..."),r.push(xf.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&r[r.length-1]!==""&&r.push(""),r.push(xf.indentComment(o(c),"")))}return r.join(` `)+` -`}X6.stringifyDocument=Ome});var $f=v(eB=>{"use strict";var Rme=cf(),nl=Ty(),kn=De(),Ime=Jo(),Pme=Zo(),Cme=UT(),Dme=Q6(),BT=$y(),Nme=VA(),jme=lf(),HT=ZA(),GT=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,kn.NODE_TYPE,{value:kn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new HT.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[kn.NODE_TYPE]:{value:kn.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=kn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){il(this.contents)&&this.contents.add(e)}addIn(e,r){il(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=BT.anchorNames(this);e.anchor=!r||n.has(r)?BT.findNewAnchor(r||"a",n):r}return new Rme.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let g=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,b=r.filter(g).map(String);b.length>0&&(r=r.concat(b)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=BT.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=jme.createNode(e,u,m);return a&&kn.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new Ime.Pair(i,o)}delete(e){return il(this.contents)?this.contents.delete(e):!1}deleteIn(e){return nl.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):il(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return kn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return nl.isEmptyPath(e)?!r&&kn.isScalar(this.contents)?this.contents.value:this.contents:kn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return kn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return nl.isEmptyPath(e)?this.contents!==void 0:kn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=nl.collectionFromPath(this.schema,[e],r):il(this.contents)&&this.contents.set(e,r)}setIn(e,r){nl.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=nl.collectionFromPath(this.schema,Array.from(e),r):il(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new HT.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new HT.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new Cme.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Pme.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?Nme.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Dme.stringifyDocument(this,e)}};function il(t){if(kn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}eB.Document=GT});var Af=v(Ef=>{"use strict";var kf=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},ZT=class extends kf{constructor(e,r,n){super("YAMLParseError",e,r,n)}},VT=class extends kf{constructor(e,r,n){super("YAMLWarning",e,r,n)}},Mme=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 +`}nB.stringifyDocument=jme});var $f=v(oB=>{"use strict";var Mme=cf(),sl=Oy(),En=De(),Fme=Jo(),Lme=Zo(),zme=qT(),Ume=iB(),HT=ky(),qme=WA(),Bme=lf(),GT=VA(),ZT=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,En.NODE_TYPE,{value:En.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new GT.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[En.NODE_TYPE]:{value:En.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=En.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){al(this.contents)&&this.contents.add(e)}addIn(e,r){al(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=HT.anchorNames(this);e.anchor=!r||n.has(r)?HT.findNewAnchor(r||"a",n):r}return new Mme.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let g=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,b=r.filter(g).map(String);b.length>0&&(r=r.concat(b)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=HT.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=Bme.createNode(e,u,m);return a&&En.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new Fme.Pair(i,o)}delete(e){return al(this.contents)?this.contents.delete(e):!1}deleteIn(e){return sl.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):al(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return En.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return sl.isEmptyPath(e)?!r&&En.isScalar(this.contents)?this.contents.value:this.contents:En.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return En.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return sl.isEmptyPath(e)?this.contents!==void 0:En.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=sl.collectionFromPath(this.schema,[e],r):al(this.contents)&&this.contents.set(e,r)}setIn(e,r){sl.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=sl.collectionFromPath(this.schema,Array.from(e),r):al(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new GT.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new GT.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new zme.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Lme.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?qme.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Ume.stringifyDocument(this,e)}};function al(t){if(En.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}oB.Document=ZT});var Af=v(Ef=>{"use strict";var kf=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},VT=class extends kf{constructor(e,r,n){super("YAMLParseError",e,r,n)}},WT=class extends kf{constructor(e,r,n){super("YAMLWarning",e,r,n)}},Hme=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 `),s=a+s}if(/[^ ]/.test(s)){let a=1,c=r.linePos[1];c?.line===n&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-o)));let l=" ".repeat(o)+"^".repeat(a);r.message+=`: ${s} ${l} -`}};Ef.YAMLError=kf;Ef.YAMLParseError=ZT;Ef.YAMLWarning=VT;Ef.prettifyError=Mme});var Tf=v(tB=>{"use strict";function Fme(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,m=!1,h=null,g=null,b=null,_=null,S=null,x=null,w=null;for(let A of t)switch(m&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&o(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(l&&A.type!=="comment"&&A.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),A.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&A.source.includes(" ")&&(h=A),u=!0;break;case"comment":{u||o(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=A.source.substring(1)||" ";d?d+=f+D:d=D,f="",l=!1;break}case"newline":l?d?d+=A.source:(!x||r!=="seq-item-ind")&&(c=!0):f+=A.source,l=!0,p=!0,(g||b)&&(_=A),u=!0;break;case"anchor":g&&o(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&o(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=A,w??(w=A.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(A,"MULTIPLE_TAGS","A node can have at most one tag"),b=A,w??(w=A.offset),l=!1,u=!1,m=!0;break}case r:(g||b)&&o(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),x&&o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e??"collection"}`),x=A,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){S&&o(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=A,l=!1,u=!1;break}default:o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),l=!1,u=!1}let O=t[t.length-1],T=O?O.offset+O.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:x,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:b,newlineAfterProp:_,end:T,start:w??T}}tB.resolveProps=Fme});var l_=v(rB=>{"use strict";function WT(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` -`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(WT(e.key)||WT(e.value))return!0}return!1;default:return!0}}rB.containsNewline=WT});var KT=v(nB=>{"use strict";var Lme=l_();function zme(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Lme.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}nB.flowIndentCheck=zme});var JT=v(oB=>{"use strict";var iB=De();function Ume(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||iB.isScalar(o)&&iB.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}oB.mapIncludes=Ume});var dB=v(uB=>{"use strict";var sB=Jo(),qme=Xo(),aB=Tf(),Bme=l_(),cB=KT(),Hme=JT(),lB="All mapping items must start at the same column";function Gme({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??qme.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:m}=u,h=aB.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",lB)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=` -`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||Bme.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",lB);r.atKey=!0;let b=h.end,_=f?t(r,f,h,i):e(r,b,d,null,h,i);r.schema.compat&&cB.flowIndentCheck(n.indent,f,i),r.atKey=!1,Hme.mapIncludes(r,a.items,_)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let S=aB.resolveProps(p??[],{indicator:"map-value-ind",next:m,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=S.end,S.found){g&&(m?.type==="block-map"&&!S.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start{"use strict";var Zme=Qo(),Vme=Tf(),Wme=KT();function Kme({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Zme.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=Vme.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&Wme.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}fB.resolveBlockSeq=Kme});var ol=v(mB=>{"use strict";function Jme(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}mB.resolveEnd=Jme});var _B=v(yB=>{"use strict";var Yme=De(),Xme=Jo(),hB=Xo(),Qme=Qo(),ehe=ol(),gB=Tf(),the=l_(),rhe=JT(),YT="Block collections are not allowed within flow collections",XT=t=>t&&(t.type==="block-map"||t.type==="block-seq");function nhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?hB.YAMLMap:Qme.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g0){let g=ehe.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` -`+g.comment:l.comment=g.comment),l.range=[n.offset,h,g.offset]}else l.range=[n.offset,h,h];return l}yB.resolveFlowCollection=nhe});var vB=v(bB=>{"use strict";var ihe=De(),ohe=Dt(),she=Xo(),ahe=Qo(),che=dB(),lhe=pB(),uhe=_B();function QT(t,e,r,n,i,o){let s=r.type==="block-map"?che.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?lhe.resolveBlockSeq(t,e,r,n,o):uhe.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function dhe(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,m=f&&o?f.offset>o.offset?f:o:f??o;m&&(!p||p.offsetf.tag===s&&f.collection===a);if(!c){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),QT(t,e,r,i,s)}let l=QT(t,e,r,i,s,c),u=c.resolve?.(l,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??l,d=ihe.isNode(u)?u:new ohe.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}bB.composeCollection=dhe});var tO=v(SB=>{"use strict";var eO=Dt();function fhe(t,e,r){let n=e.offset,i=phe(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?eO.Scalar.BLOCK_FOLDED:eO.Scalar.BLOCK_LITERAL,s=e.source?mhe(e.source):[],a=s.length;for(let h=s.length-1;h>=0;--h){let g=s[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&s.length>0?` +`}};Ef.YAMLError=kf;Ef.YAMLParseError=VT;Ef.YAMLWarning=WT;Ef.prettifyError=Hme});var Tf=v(sB=>{"use strict";function Gme(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,m=!1,h=null,g=null,b=null,_=null,S=null,x=null,w=null;for(let A of t)switch(m&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&o(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(l&&A.type!=="comment"&&A.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),A.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&A.source.includes(" ")&&(h=A),u=!0;break;case"comment":{u||o(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=A.source.substring(1)||" ";d?d+=f+D:d=D,f="",l=!1;break}case"newline":l?d?d+=A.source:(!x||r!=="seq-item-ind")&&(c=!0):f+=A.source,l=!0,p=!0,(g||b)&&(_=A),u=!0;break;case"anchor":g&&o(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&o(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=A,w??(w=A.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(A,"MULTIPLE_TAGS","A node can have at most one tag"),b=A,w??(w=A.offset),l=!1,u=!1,m=!0;break}case r:(g||b)&&o(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),x&&o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e??"collection"}`),x=A,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){S&&o(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=A,l=!1,u=!1;break}default:o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),l=!1,u=!1}let O=t[t.length-1],T=O?O.offset+O.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:x,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:b,newlineAfterProp:_,end:T,start:w??T}}sB.resolveProps=Gme});var u_=v(aB=>{"use strict";function KT(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(KT(e.key)||KT(e.value))return!0}return!1;default:return!0}}aB.containsNewline=KT});var JT=v(cB=>{"use strict";var Zme=u_();function Vme(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Zme.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}cB.flowIndentCheck=Vme});var YT=v(uB=>{"use strict";var lB=De();function Wme(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||lB.isScalar(o)&&lB.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}uB.mapIncludes=Wme});var gB=v(hB=>{"use strict";var dB=Jo(),Kme=Xo(),fB=Tf(),Jme=u_(),pB=JT(),Yme=YT(),mB="All mapping items must start at the same column";function Xme({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Kme.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:m}=u,h=fB.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",mB)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=` +`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||Jme.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",mB);r.atKey=!0;let b=h.end,_=f?t(r,f,h,i):e(r,b,d,null,h,i);r.schema.compat&&pB.flowIndentCheck(n.indent,f,i),r.atKey=!1,Yme.mapIncludes(r,a.items,_)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let S=fB.resolveProps(p??[],{indicator:"map-value-ind",next:m,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=S.end,S.found){g&&(m?.type==="block-map"&&!S.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start{"use strict";var Qme=Qo(),ehe=Tf(),the=JT();function rhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Qme.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=ehe.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&the.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}yB.resolveBlockSeq=rhe});var cl=v(bB=>{"use strict";function nhe(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}bB.resolveEnd=nhe});var xB=v(wB=>{"use strict";var ihe=De(),ohe=Jo(),vB=Xo(),she=Qo(),ahe=cl(),SB=Tf(),che=u_(),lhe=YT(),XT="Block collections are not allowed within flow collections",QT=t=>t&&(t.type==="block-map"||t.type==="block-seq");function uhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?vB.YAMLMap:she.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g0){let g=ahe.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` +`+g.comment:l.comment=g.comment),l.range=[n.offset,h,g.offset]}else l.range=[n.offset,h,h];return l}wB.resolveFlowCollection=uhe});var kB=v($B=>{"use strict";var dhe=De(),fhe=Dt(),phe=Xo(),mhe=Qo(),hhe=gB(),ghe=_B(),yhe=xB();function eO(t,e,r,n,i,o){let s=r.type==="block-map"?hhe.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?ghe.resolveBlockSeq(t,e,r,n,o):yhe.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function _he(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,m=f&&o?f.offset>o.offset?f:o:f??o;m&&(!p||p.offsetf.tag===s&&f.collection===a);if(!c){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),eO(t,e,r,i,s)}let l=eO(t,e,r,i,s,c),u=c.resolve?.(l,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??l,d=dhe.isNode(u)?u:new fhe.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}$B.composeCollection=_he});var rO=v(EB=>{"use strict";var tO=Dt();function bhe(t,e,r){let n=e.offset,i=vhe(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?tO.Scalar.BLOCK_FOLDED:tO.Scalar.BLOCK_LITERAL,s=e.source?She(e.source):[],a=s.length;for(let h=s.length-1;h>=0;--h){let g=s[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&s.length>0?` `.repeat(Math.max(1,s.length-1)):"",g=n+i.length;return e.source&&(g+=e.source.length),{value:h,type:o,comment:i.comment,range:[n,g,g]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let h=0;hc&&(c=g.length);else{g.length=a;--h)s[h][0].length>c&&(a=h+1);let d="",f="",p=!1;for(let h=0;hc||b[0]===" "?(f===" "?f=` `:!p&&f===` `&&(f=` @@ -112,91 +112,91 @@ ${l} `+s[h][0].slice(c);d[d.length-1]!==` `&&(d+=` `);break;default:d+=` -`}let m=n+i.length+e.source.length;return{value:d,type:o,comment:i.comment,range:[n,m,m]}}function phe({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",c=-1;for(let f=1;f{"use strict";var rO=Dt(),hhe=ol();function ghe(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(f,p,m)=>r(n+f,p,m);switch(i){case"scalar":a=rO.Scalar.PLAIN,c=yhe(o,l);break;case"single-quoted-scalar":a=rO.Scalar.QUOTE_SINGLE,c=_he(o,l);break;case"double-quoted-scalar":a=rO.Scalar.QUOTE_DOUBLE,c=bhe(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,d=hhe.resolveEnd(s,u,e,r);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function yhe(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),wB(t)}function _he(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),wB(t.slice(1,-1)).replace(/''/g,"'")}function wB(t){let e,r;try{e=new RegExp(`(.*?)(?{"use strict";var nO=Dt(),whe=cl();function xhe(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(f,p,m)=>r(n+f,p,m);switch(i){case"scalar":a=nO.Scalar.PLAIN,c=$he(o,l);break;case"single-quoted-scalar":a=nO.Scalar.QUOTE_SINGLE,c=khe(o,l);break;case"double-quoted-scalar":a=nO.Scalar.QUOTE_DOUBLE,c=Ehe(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,d=whe.resolveEnd(s,u,e,r);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function $he(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),AB(t)}function khe(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),AB(t.slice(1,-1)).replace(/''/g,"'")}function AB(t){let e,r;try{e=new RegExp(`(.*?)(?o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function vhe(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` +`)&&(r+=n>o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function Ahe(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` `||n==="\r")&&!(n==="\r"&&t[e+2]!==` `);)n===` `&&(r+=` -`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var She={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function whe(t,e,r,n){let i=t.substr(e,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}xB.resolveFlowScalar=ghe});var EB=v(kB=>{"use strict";var ha=De(),$B=Dt(),xhe=tO(),$he=nO();function khe(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?xhe.resolveBlockScalar(t,e,n):$he.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[ha.SCALAR]:c?l=Ehe(t.schema,i,c,r,n):e.type==="scalar"?l=Ahe(t,i,e,n):l=t.schema[ha.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=ha.isScalar(d)?d:new $B.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new $B.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function Ehe(t,e,r,n,i){if(r==="!")return t[ha.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[ha.SCALAR])}function Ahe({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[ha.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[ha.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}kB.composeScalar=khe});var TB=v(AB=>{"use strict";function The(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}AB.emptyScalarPosition=The});var IB=v(oO=>{"use strict";var Ohe=cf(),Rhe=De(),Ihe=vB(),OB=EB(),Phe=ol(),Che=TB(),Dhe={composeNode:RB,composeEmptyNode:iO};function RB(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=Nhe(t,e,n),(a||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=OB.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Ihe.composeCollection(Dhe,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(d){let f=d instanceof Error?d.message:String(d);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=iO(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Rhe.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function iO(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:Che.emptyScalarPosition(e,r,n),indent:-1,source:""},d=OB.composeScalar(t,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function Nhe({options:t},{offset:e,source:r,end:n},i){let o=new Ohe.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=Phe.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}oO.composeEmptyNode=iO;oO.composeNode=RB});var DB=v(CB=>{"use strict";var jhe=$f(),PB=IB(),Mhe=ol(),Fhe=Tf();function Lhe(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new jhe.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Fhe.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?PB.composeNode(l,i,u,s):PB.composeEmptyNode(l,u.end,n,null,u,s);let d=c.contents.range[2],f=Mhe.resolveEnd(o,d,!1,s);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}CB.composeDoc=Lhe});var aO=v(MB=>{"use strict";var zhe=Ge("process"),Uhe=ZA(),qhe=$f(),Of=Af(),NB=De(),Bhe=DB(),Hhe=ol();function Rf(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function jB(t){let e="",r=!1,n=!1;for(let i=0;i{"use strict";var ha=De(),OB=Dt(),Rhe=rO(),Ihe=iO();function Phe(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?Rhe.resolveBlockScalar(t,e,n):Ihe.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[ha.SCALAR]:c?l=Che(t.schema,i,c,r,n):e.type==="scalar"?l=Dhe(t,i,e,n):l=t.schema[ha.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=ha.isScalar(d)?d:new OB.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new OB.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function Che(t,e,r,n,i){if(r==="!")return t[ha.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[ha.SCALAR])}function Dhe({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[ha.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[ha.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}RB.composeScalar=Phe});var CB=v(PB=>{"use strict";function Nhe(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}PB.emptyScalarPosition=Nhe});var jB=v(sO=>{"use strict";var jhe=cf(),Mhe=De(),Fhe=kB(),DB=IB(),Lhe=cl(),zhe=CB(),Uhe={composeNode:NB,composeEmptyNode:oO};function NB(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=qhe(t,e,n),(a||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=DB.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Fhe.composeCollection(Uhe,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(d){let f=d instanceof Error?d.message:String(d);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=oO(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Mhe.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function oO(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:zhe.emptyScalarPosition(e,r,n),indent:-1,source:""},d=DB.composeScalar(t,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function qhe({options:t},{offset:e,source:r,end:n},i){let o=new jhe.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=Lhe.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}sO.composeEmptyNode=oO;sO.composeNode=NB});var LB=v(FB=>{"use strict";var Bhe=$f(),MB=jB(),Hhe=cl(),Ghe=Tf();function Zhe(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new Bhe.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Ghe.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?MB.composeNode(l,i,u,s):MB.composeEmptyNode(l,u.end,n,null,u,s);let d=c.contents.range[2],f=Hhe.resolveEnd(o,d,!1,s);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}FB.composeDoc=Zhe});var cO=v(qB=>{"use strict";var Vhe=Ge("process"),Whe=VA(),Khe=$f(),Of=Af(),zB=De(),Jhe=LB(),Yhe=cl();function Rf(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function UB(t){let e="",r=!1,n=!1;for(let i=0;i{let s=Rf(r);o?this.warnings.push(new Of.YAMLWarning(s,n,i)):this.errors.push(new Of.YAMLParseError(s,n,i))},this.directives=new Uhe.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=jB(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment} -${n}`:n;else if(i||e.directives.docStart||!o)e.commentBefore=n;else if(NB.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];NB.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${n} +`)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var aO=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,o)=>{let s=Rf(r);o?this.warnings.push(new Of.YAMLWarning(s,n,i)):this.errors.push(new Of.YAMLParseError(s,n,i))},this.directives=new Whe.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=UB(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment} +${n}`:n;else if(i||e.directives.docStart||!o)e.commentBefore=n;else if(zB.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];zB.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${n} ${a}`:n}else{let s=o.commentBefore;o.commentBefore=s?`${n} -${s}`:n}}if(r){for(let o=0;o{let o=Rf(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Bhe.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Of.YAMLParseError(Rf(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Of.YAMLParseError(Rf(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Hhe.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} -${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Of.YAMLParseError(Rf(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new qhe.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};MB.Composer=sO});var zB=v(u_=>{"use strict";var Ghe=tO(),Zhe=nO(),Vhe=Af(),FB=pf();function Whe(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new Vhe.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Zhe.resolveFlowScalar(t,e,n);case"block-scalar":return Ghe.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function Khe(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=FB.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:` +${s}`:n}}if(r){for(let o=0;o{let o=Rf(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Jhe.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Of.YAMLParseError(Rf(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Of.YAMLParseError(Rf(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Yhe.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} +${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Of.YAMLParseError(Rf(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Khe.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};qB.Composer=aO});var GB=v(d_=>{"use strict";var Xhe=rO(),Qhe=iO(),ege=Af(),BB=pf();function tge(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new ege.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Qhe.resolveFlowScalar(t,e,n);case"block-scalar":return Xhe.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function rge(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=BB.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:` `}];switch(a[0]){case"|":case">":{let l=a.indexOf(` `),u=a.substring(0,l),d=a.substring(l+1)+` -`,f=[{type:"block-scalar-header",offset:o,indent:n,source:u}];return LB(f,c)||f.push({type:"newline",offset:-1,indent:n,source:` -`}),{type:"block-scalar",offset:o,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function Jhe(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=FB.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Yhe(t,c);break;case'"':cO(t,c,"double-quoted-scalar");break;case"'":cO(t,c,"single-quoted-scalar");break;default:cO(t,c,"scalar")}}function Yhe(t,e){let r=e.indexOf(` +`,f=[{type:"block-scalar-header",offset:o,indent:n,source:u}];return HB(f,c)||f.push({type:"newline",offset:-1,indent:n,source:` +`}),{type:"block-scalar",offset:o,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function nge(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=BB.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":ige(t,c);break;case'"':lO(t,c,"double-quoted-scalar");break;case"'":lO(t,c,"single-quoted-scalar");break;default:lO(t,c,"scalar")}}function ige(t,e){let r=e.indexOf(` `),n=e.substring(0,r),i=e.substring(r+1)+` -`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=n,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];LB(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` -`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function LB(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function cO(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of n)o.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` -`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}u_.createScalarToken=Khe;u_.resolveAsScalar=Whe;u_.setScalarValue=Jhe});var qB=v(UB=>{"use strict";var Xhe=t=>"type"in t?f_(t):d_(t);function f_(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=f_(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=d_(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=d_(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=d_(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function d_({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=f_(e)),r)for(let o of r)i+=o.source;return n&&(i+=f_(n)),i}UB.stringify=Xhe});var ZB=v(GB=>{"use strict";var lO=Symbol("break visit"),Qhe=Symbol("skip children"),BB=Symbol("remove item");function ga(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),HB(Object.freeze([]),t,e)}ga.BREAK=lO;ga.SKIP=Qhe;ga.REMOVE=BB;ga.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};ga.parentCollection=(t,e)=>{let r=ga.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function HB(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s{"use strict";var uO=zB(),ege=qB(),tge=ZB(),dO="\uFEFF",fO="",pO="",mO="",rge=t=>!!t&&"items"in t,nge=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function ige(t){switch(t){case dO:return"";case fO:return"";case pO:return"";case mO:return"";default:return JSON.stringify(t)}}function oge(t){switch(t){case dO:return"byte-order-mark";case fO:return"doc-mode";case pO:return"flow-error-end";case mO:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=n,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];HB(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` +`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function HB(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function lO(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of n)o.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` +`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}d_.createScalarToken=rge;d_.resolveAsScalar=tge;d_.setScalarValue=nge});var VB=v(ZB=>{"use strict";var oge=t=>"type"in t?p_(t):f_(t);function p_(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=p_(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=f_(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=f_(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=f_(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function f_({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=p_(e)),r)for(let o of r)i+=o.source;return n&&(i+=p_(n)),i}ZB.stringify=oge});var YB=v(JB=>{"use strict";var uO=Symbol("break visit"),sge=Symbol("skip children"),WB=Symbol("remove item");function ga(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),KB(Object.freeze([]),t,e)}ga.BREAK=uO;ga.SKIP=sge;ga.REMOVE=WB;ga.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};ga.parentCollection=(t,e)=>{let r=ga.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function KB(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s{"use strict";var dO=GB(),age=VB(),cge=YB(),fO="\uFEFF",pO="",mO="",hO="",lge=t=>!!t&&"items"in t,uge=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function dge(t){switch(t){case fO:return"";case pO:return"";case mO:return"";case hO:return"";default:return JSON.stringify(t)}}function fge(t){switch(t){case fO:return"byte-order-mark";case pO:return"doc-mode";case mO:return"flow-error-end";case hO:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Dr.createScalarToken=uO.createScalarToken;Dr.resolveAsScalar=uO.resolveAsScalar;Dr.setScalarValue=uO.setScalarValue;Dr.stringify=ege.stringify;Dr.visit=tge.visit;Dr.BOM=dO;Dr.DOCUMENT=fO;Dr.FLOW_END=pO;Dr.SCALAR=mO;Dr.isCollection=rge;Dr.isScalar=nge;Dr.prettyToken=ige;Dr.tokenType=oge});var yO=v(WB=>{"use strict";var If=p_();function Kn(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}var VB=new Set("0123456789ABCDEFabcdef"),sge=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),m_=new Set(",[]{}"),age=new Set(` ,[]{} -\r `),hO=t=>!t||age.has(t),gO=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Dr.createScalarToken=dO.createScalarToken;Dr.resolveAsScalar=dO.resolveAsScalar;Dr.setScalarValue=dO.setScalarValue;Dr.stringify=age.stringify;Dr.visit=cge.visit;Dr.BOM=fO;Dr.DOCUMENT=pO;Dr.FLOW_END=mO;Dr.SCALAR=hO;Dr.isCollection=lge;Dr.isScalar=uge;Dr.prettyToken=dge;Dr.tokenType=fge});var _O=v(QB=>{"use strict";var If=m_();function Jn(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}var XB=new Set("0123456789ABCDEFabcdef"),pge=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),h_=new Set(",[]{}"),mge=new Set(` ,[]{} +\r `),gO=t=>!t||mge.has(t),yO=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` `?!0:r==="\r"?this.buffer[e+1]===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===` `||!i&&!this.atEnd)return e+n+1}return r===` -`||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Kn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Kn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Kn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(hO),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Jn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Jn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Jn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(gO),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Kn(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let o=this.pos;n=this.buffer[o];++o)switch(n){case" ":r+=1;break;case` +`,o)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Jn(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let o=this.pos;n=this.buffer[o];++o)switch(n){case" ":r+=1;break;case` `:e=o,r=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===` `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(` `,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===` `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let o=e-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===` -`&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield If.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(Kn(o)||e&&m_.has(o))break;r=n}else if(Kn(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===` +`&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield If.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(Jn(o)||e&&h_.has(o))break;r=n}else if(Jn(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===` `?(n+=1,i=` -`,o=this.buffer[n+1]):r=n),o==="#"||e&&m_.has(o))break;if(i===` -`){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&m_.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield If.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(hO),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Kn(n)||r&&m_.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Kn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(sge.has(r))r=this.buffer[++e];else if(r==="%"&&VB.has(this.buffer[e+1])&&VB.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` +`,o=this.buffer[n+1]):r=n),o==="#"||e&&h_.has(o))break;if(i===` +`){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&h_.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield If.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(gO),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Jn(n)||r&&h_.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Jn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(pge.has(r))r=this.buffer[++e];else if(r==="%"&&XB.has(this.buffer[e+1])&&XB.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};WB.Lexer=gO});var bO=v(KB=>{"use strict";var _O=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[o]{"use strict";var cge=Ge("process"),JB=p_(),lge=yO();function es(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function g_(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&XB(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&YB(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};QB.Lexer=yO});var vO=v(eH=>{"use strict";var bO=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[o]{"use strict";var hge=Ge("process"),tH=m_(),gge=_O();function es(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function y_(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&nH(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&rH(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;ae.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(es(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(QB(r.key)&&!es(r.sep,"newline")){let s=sl(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(es(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=sl(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):es(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!es(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){g_(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||es(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=h_(n),o=sl(i);XB(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` +`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){y_(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;ae.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(es(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(iH(r.key)&&!es(r.sep,"newline")){let s=ll(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(es(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=ll(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):es(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!es(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){y_(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||es(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=g_(n),o=ll(i);nH(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(` -`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=h_(e),n=sl(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=h_(e),n=sl(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};eH.Parser=vO});var oH=v(Cf=>{"use strict";var tH=aO(),uge=$f(),Pf=Af(),dge=oT(),fge=De(),pge=bO(),rH=SO();function nH(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new pge.LineCounter||null,prettyErrors:e}}function mge(t,e={}){let{lineCounter:r,prettyErrors:n}=nH(e),i=new rH.Parser(r?.addNewLine),o=new tH.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(Pf.prettifyError(t,r)),a.warnings.forEach(Pf.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function iH(t,e={}){let{lineCounter:r,prettyErrors:n}=nH(e),i=new rH.Parser(r?.addNewLine),o=new tH.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Pf.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(Pf.prettifyError(t,r)),s.warnings.forEach(Pf.prettifyError(t,r))),s}function hge(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=iH(t,r);if(!i)return null;if(i.warnings.forEach(o=>dge.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function gge(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return fge.isDocument(t)&&!n?t.toString(r):new uge.Document(t,n,r).toString(r)}Cf.parse=hge;Cf.parseAllDocuments=mge;Cf.parseDocument=iH;Cf.stringify=gge});var Qt=v(Ze=>{"use strict";var yge=aO(),_ge=$f(),bge=UT(),wO=Af(),vge=cf(),ts=De(),Sge=Jo(),wge=Dt(),xge=Xo(),$ge=Qo(),kge=p_(),Ege=yO(),Age=bO(),Tge=SO(),y_=oH(),sH=nf();Ze.Composer=yge.Composer;Ze.Document=_ge.Document;Ze.Schema=bge.Schema;Ze.YAMLError=wO.YAMLError;Ze.YAMLParseError=wO.YAMLParseError;Ze.YAMLWarning=wO.YAMLWarning;Ze.Alias=vge.Alias;Ze.isAlias=ts.isAlias;Ze.isCollection=ts.isCollection;Ze.isDocument=ts.isDocument;Ze.isMap=ts.isMap;Ze.isNode=ts.isNode;Ze.isPair=ts.isPair;Ze.isScalar=ts.isScalar;Ze.isSeq=ts.isSeq;Ze.Pair=Sge.Pair;Ze.Scalar=wge.Scalar;Ze.YAMLMap=xge.YAMLMap;Ze.YAMLSeq=$ge.YAMLSeq;Ze.CST=kge;Ze.Lexer=Ege.Lexer;Ze.LineCounter=Age.LineCounter;Ze.Parser=Tge.Parser;Ze.parse=y_.parse;Ze.parseAllDocuments=y_.parseAllDocuments;Ze.parseDocument=y_.parseDocument;Ze.stringify=y_.stringify;Ze.visit=sH.visit;Ze.visitAsync=sH.visitAsync});import{execFileSync as aH}from"node:child_process";import{existsSync as __}from"node:fs";import{join as b_,resolve as Oge}from"node:path";function Rge(t){try{let e=aH("git",["rev-parse","--git-dir"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return e?Oge(t,e):null}catch{return null}}function xO(t){let e=Rge(t);if(!e)return null;try{if(__(b_(e,"MERGE_HEAD")))return"merge";if(__(b_(e,"CHERRY_PICK_HEAD")))return"cherry-pick";if(__(b_(e,"rebase-merge"))||__(b_(e,"rebase-apply")))return"rebase"}catch{return null}return null}function ya(t){return xO(t)!==null}function $O(t,e){try{let r=aH("git",["rev-parse","--verify","--quiet",`${e}^{commit}`],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return r.length>0?r:null}catch{return null}}function v_(t,e){return $O(t,e)!==null}var _a=y(()=>{"use strict"});import{execFileSync as Ige}from"node:child_process";import{existsSync as Pge,readFileSync as Cge}from"node:fs";import{join as uH}from"node:path";function Df(t,e){return Ige("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}function rs(t){try{let e=Df(t,["describe","--tags","--abbrev=0"]).trim();if(e.length>0)return e}catch{}throw new Error("changelog: no git tag found to anchor the default range \u2014 pass --since explicitly (e.g. clad changelog --since v1.0.0)")}function ns(t,e){Dge(t,e);let r=Df(t,["rev-parse","HEAD"]).trim(),n=Nge(t,e);return{groups:jge(t,n),head:r,inventory:{after:lH(w_(t,"spec.yaml")),before:lH(kO(t,e,"spec.yaml"))},since:e,unsharded_commits:zge(t,e)}}function EO(t){if(t.text&&t.text.trim().length>0)return t.text.trim();let e=t.action?.trim();if(!e)return null;let r=t.condition?.trim(),n=t.response?.trim(),i=r?`${r.charAt(0).toUpperCase()}${r.slice(1)}, the system shall ${e}`:`The system shall ${e}`;return n?`${i} \u2014 ${n}.`:`${i}.`}function Dge(t,e){let r=(e??"").trim();if(r.length===0)throw new Error("changelog: empty since ref \u2014 pass --since ");if(!v_(t,r))throw new Error(`changelog: '${r}' does not resolve to a commit in this repository \u2014 pass --since that exists. An unknown ref is an error, never a silently empty changelog.`)}function Nge(t,e){let r=Df(t,["diff","--name-status",`${e}..HEAD`,"--","spec/"]),n=[];for(let i of r.split(` -`)){if(i.trim().length===0)continue;let o=i.split(" "),s=o[0]??"",a=o[1]??"",c=o.length>2?o[2]:a;if(!(!cH(c)&&!cH(a)))if(s.startsWith("A")){let l=S_(w_(t,c));if(!l)continue;l.status==="done"?n.push(al(l,"added-as-done")):l.status==="archived"&&n.push(al(l,"archived"))}else if(s.startsWith("D")){let l=S_(kO(t,e,a));l&&n.push(al(l,"archived"))}else{let l=S_(w_(t,c));if(!l)continue;let d=S_(kO(t,e,a))?.status;l.status==="done"&&d!=="done"?n.push(al(l,"flipped-to-done")):l.status==="done"&&d==="done"?n.push(al(l,"modified-while-done")):l.status==="archived"&&d!=="archived"&&n.push(al(l,"archived"))}}return n.sort((i,o)=>i.id.localeCompare(o.id)),n}function cH(t){return t.startsWith("spec/features/")&&(t.endsWith(".yaml")||t.endsWith(".yml"))}function al(t,e){return{acceptance:(t.acceptance_criteria??[]).map(n=>EO(n)).filter(n=>n!==null),change:e,id:t.id,...t.slug?{slug:t.slug}:{},title:t.title}}function S_(t){if(t===null)return null;let e;try{e=(0,x_.parse)(t)}catch{return null}let r=e;return!r||typeof r.id!="string"||typeof r.status!="string"?null:{id:r.id,slug:typeof r.slug=="string"?r.slug:void 0,title:typeof r.title=="string"?r.title:r.id,status:r.status,acceptance_criteria:r.acceptance_criteria}}function w_(t,e){let r=uH(t,e);if(!Pge(r))return null;try{return Cge(r,"utf8")}catch{return null}}function kO(t,e,r){try{return Df(t,["show",`${e}:${r}`])}catch{return null}}function jge(t,e){let r=Mge(t).filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=[],i=new Set;for(let s of r){let a=new Set(s.features??[]),c=e.filter(l=>a.has(l.id)&&!i.has(l.id));if(c.length!==0){for(let l of c)i.add(l.id);n.push({capability:s.id,features:c,title:s.title??s.id})}}let o=e.filter(s=>!i.has(s.id));return o.length>0&&n.push({capability:"uncategorized",features:o,title:"Uncategorized"}),n}function Mge(t){let e=w_(t,uH("spec","capabilities.yaml"));if(e===null)return[];try{let r=(0,x_.parse)(e);return Array.isArray(r?.capabilities)?r.capabilities:[]}catch{return[]}}function lH(t){let e={};if(t!==null)try{let n=(0,x_.parse)(t);n&&typeof n.inventory=="object"&&n.inventory!==null&&(e=n.inventory)}catch{}let r=n=>typeof e[n]=="number"?e[n]:0;return{capabilities:r("capabilities"),features:r("features"),scenarios:r("scenarios"),test_files:r("test_files")}}function zge(t,e){let r=Df(t,["log",`${e}..HEAD`,"--format=%h%x09%s","--","src/"]),n=[];for(let i of r.split(` -`)){if(i.trim().length===0)continue;let o=i.indexOf(" ");if(o<0)continue;let s=i.slice(0,o),a=i.slice(o+1);Fge.test(a)&&(Lge.test(a)||n.push({hash:s,subject:a}))}return n}var x_,Fge,Lge,cl=y(()=>{"use strict";x_=St(Qt(),1);_a();Fge=/^(feat|fix)(\([^)]*\))?!?:/,Lge=/\bF-(\d{3,}|[a-f0-9]{6,})\b/});import{execFileSync as dH}from"node:child_process";import{appendFileSync as Uge,existsSync as AO,mkdirSync as qge,readFileSync as Bge,renameSync as Hge,statSync as Gge}from"node:fs";import{userInfo as Zge}from"node:os";import{dirname as Vge,join as OO}from"node:path";function RO(t){return OO(t,fH,Wge)}function Xr(t,e){let r=RO(t),n=Vge(r);AO(n)||qge(n,{recursive:!0});try{AO(r)&&Gge(r).size>Kge&&Hge(r,OO(n,pH))}catch{}Uge(r,`${JSON.stringify(e)} -`,"utf8")}function TO(t){if(!AO(t))return[];let e=Bge(t,"utf8").trim();return e.length===0?[]:e.split(` -`).filter(r=>r.length>0).map(r=>JSON.parse(r))}function ba(t){return TO(RO(t))}function $_(t){return[...TO(OO(t,fH,pH)),...TO(RO(t))]}function Qr(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function Jge(t){let e;try{e=dH("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=Zge().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function Yge(t){try{return dH("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function Nf(t,e){try{let r=ba(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function er(t,e,r){try{let n=Yge(t),i=Jge(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=Nf(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Xr(t,Qr(e,o))}catch{}}var fH,Wge,pH,Kge,Nr=y(()=>{"use strict";fH=".cladding",Wge="events.log.jsonl",pH="events.log.1.jsonl",Kge=5*1024*1024});import{execFileSync as Xge}from"node:child_process";import{existsSync as mH,readdirSync as Qge,readFileSync as eye,statSync as hH}from"node:fs";import{createHash as tye}from"node:crypto";import{join as IO}from"node:path";function va(t){try{return Xge("git",["rev-parse","HEAD"],{cwd:t,stdio:["ignore","pipe","ignore"]}).toString("utf8").trim()||null}catch{return null}}function PO(t){let e=[],r=IO(t,"spec.yaml");mH(r)&&hH(r).isFile()&&e.push(r);for(let i of["features","scenarios"]){let o=IO(t,"spec",i);if(!(!mH(o)||!hH(o).isDirectory()))for(let s of Qge(o))s.endsWith(".yaml")&&e.push(IO(o,s))}e.sort();let n=tye("sha256");for(let i of e){let o=i.slice(t.length+1);n.update(`${o}\0`),n.update(eye(i)),n.update("\0")}return n.digest("hex")}function k_(t,e){let r={featureId:e,gitHead:va(t),specDigest:PO(t),timestamp:new Date().toISOString()};return Xr(t,Qr("feature_checkpoint",{feature:e,git_head:r.gitHead,spec_digest:r.specDigest})),r}function E_(t,e){let r=ba(t);for(let n=r.length-1;n>=0;n--){let i=r[n];if(i.type==="feature_checkpoint"&&i.payload.feature===e)return{featureId:e,gitHead:i.payload.git_head??null,specDigest:String(i.payload.spec_digest??""),timestamp:i.timestamp}}return null}function A_(t,e,r,n){let i=Qr("feature_rolled_back",{feature:e,to_git_head:r.gitHead,to_spec_digest:r.specDigest,to_checkpoint_at:r.timestamp,reason:n??null});return Xr(t,i),i}var jf=y(()=>{"use strict";Nr()});import{readFileSync as rye,statSync as nye}from"node:fs";import{extname as iye,resolve as CO,sep as oye}from"node:path";function en(t){return Math.ceil(t.length/4)}function cye(t,e){let r=CO(e),n=CO(r,t);return n===r||n.startsWith(r+oye)}function yH(t,e,r,n){if(!cye(t,e))return{path:t,omitted:"unsafe-path"};if(!sye.has(iye(t).toLowerCase()))return{path:t,omitted:"unsupported"};let i,o;if(n){let l=n(t);if(l==null)return{path:t,omitted:"missing"};if(i=l,o=Buffer.byteLength(l,"utf8"),o>gH)return{path:t,omitted:"too-large",bytes:o}}else{let l=CO(e,t);try{o=nye(l).size}catch{return{path:t,omitted:"missing"}}if(o>gH)return{path:t,omitted:"too-large",bytes:o};try{i=rye(l,"utf8")}catch{return{path:t,omitted:"missing",bytes:o}}}if(i.includes(aye))return{path:t,omitted:"binary",bytes:o};let s=Math.max(0,Math.floor(r));if(i.length<=s)return{path:t,text:i,bytes:o};let a=` +`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=g_(e),n=ll(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=g_(e),n=ll(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};oH.Parser=SO});var uH=v(Cf=>{"use strict";var sH=cO(),yge=$f(),Pf=Af(),_ge=sT(),bge=De(),vge=vO(),aH=wO();function cH(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new vge.LineCounter||null,prettyErrors:e}}function Sge(t,e={}){let{lineCounter:r,prettyErrors:n}=cH(e),i=new aH.Parser(r?.addNewLine),o=new sH.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(Pf.prettifyError(t,r)),a.warnings.forEach(Pf.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function lH(t,e={}){let{lineCounter:r,prettyErrors:n}=cH(e),i=new aH.Parser(r?.addNewLine),o=new sH.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Pf.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(Pf.prettifyError(t,r)),s.warnings.forEach(Pf.prettifyError(t,r))),s}function wge(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=lH(t,r);if(!i)return null;if(i.warnings.forEach(o=>_ge.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function xge(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return bge.isDocument(t)&&!n?t.toString(r):new yge.Document(t,n,r).toString(r)}Cf.parse=wge;Cf.parseAllDocuments=Sge;Cf.parseDocument=lH;Cf.stringify=xge});var er=v(Ze=>{"use strict";var $ge=cO(),kge=$f(),Ege=qT(),xO=Af(),Age=cf(),ts=De(),Tge=Jo(),Oge=Dt(),Rge=Xo(),Ige=Qo(),Pge=m_(),Cge=_O(),Dge=vO(),Nge=wO(),__=uH(),dH=nf();Ze.Composer=$ge.Composer;Ze.Document=kge.Document;Ze.Schema=Ege.Schema;Ze.YAMLError=xO.YAMLError;Ze.YAMLParseError=xO.YAMLParseError;Ze.YAMLWarning=xO.YAMLWarning;Ze.Alias=Age.Alias;Ze.isAlias=ts.isAlias;Ze.isCollection=ts.isCollection;Ze.isDocument=ts.isDocument;Ze.isMap=ts.isMap;Ze.isNode=ts.isNode;Ze.isPair=ts.isPair;Ze.isScalar=ts.isScalar;Ze.isSeq=ts.isSeq;Ze.Pair=Tge.Pair;Ze.Scalar=Oge.Scalar;Ze.YAMLMap=Rge.YAMLMap;Ze.YAMLSeq=Ige.YAMLSeq;Ze.CST=Pge;Ze.Lexer=Cge.Lexer;Ze.LineCounter=Dge.LineCounter;Ze.Parser=Nge.Parser;Ze.parse=__.parse;Ze.parseAllDocuments=__.parseAllDocuments;Ze.parseDocument=__.parseDocument;Ze.stringify=__.stringify;Ze.visit=dH.visit;Ze.visitAsync=dH.visitAsync});import{execFileSync as fH}from"node:child_process";import{existsSync as b_}from"node:fs";import{join as v_,resolve as jge}from"node:path";function Mge(t){try{let e=fH("git",["rev-parse","--git-dir"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return e?jge(t,e):null}catch{return null}}function $O(t){let e=Mge(t);if(!e)return null;try{if(b_(v_(e,"MERGE_HEAD")))return"merge";if(b_(v_(e,"CHERRY_PICK_HEAD")))return"cherry-pick";if(b_(v_(e,"rebase-merge"))||b_(v_(e,"rebase-apply")))return"rebase"}catch{return null}return null}function ya(t){return $O(t)!==null}function kO(t,e){try{let r=fH("git",["rev-parse","--verify","--quiet",`${e}^{commit}`],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return r.length>0?r:null}catch{return null}}function S_(t,e){return kO(t,e)!==null}var _a=y(()=>{"use strict"});import{execFileSync as Fge}from"node:child_process";import{existsSync as Lge,readFileSync as zge}from"node:fs";import{join as hH}from"node:path";function Df(t,e){return Fge("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}function rs(t){try{let e=Df(t,["describe","--tags","--abbrev=0"]).trim();if(e.length>0)return e}catch{}throw new Error("changelog: no git tag found to anchor the default range \u2014 pass --since explicitly (e.g. clad changelog --since v1.0.0)")}function ns(t,e){Uge(t,e);let r=Df(t,["rev-parse","HEAD"]).trim(),n=qge(t,e);return{groups:Bge(t,n),head:r,inventory:{after:mH(x_(t,"spec.yaml")),before:mH(EO(t,e,"spec.yaml"))},since:e,unsharded_commits:Vge(t,e)}}function AO(t){if(t.text&&t.text.trim().length>0)return t.text.trim();let e=t.action?.trim();if(!e)return null;let r=t.condition?.trim(),n=t.response?.trim(),i=r?`${r.charAt(0).toUpperCase()}${r.slice(1)}, the system shall ${e}`:`The system shall ${e}`;return n?`${i} \u2014 ${n}.`:`${i}.`}function Uge(t,e){let r=(e??"").trim();if(r.length===0)throw new Error("changelog: empty since ref \u2014 pass --since ");if(!S_(t,r))throw new Error(`changelog: '${r}' does not resolve to a commit in this repository \u2014 pass --since that exists. An unknown ref is an error, never a silently empty changelog.`)}function qge(t,e){let r=Df(t,["diff","--name-status",`${e}..HEAD`,"--","spec/"]),n=[];for(let i of r.split(` +`)){if(i.trim().length===0)continue;let o=i.split(" "),s=o[0]??"",a=o[1]??"",c=o.length>2?o[2]:a;if(!(!pH(c)&&!pH(a)))if(s.startsWith("A")){let l=w_(x_(t,c));if(!l)continue;l.status==="done"?n.push(ul(l,"added-as-done")):l.status==="archived"&&n.push(ul(l,"archived"))}else if(s.startsWith("D")){let l=w_(EO(t,e,a));l&&n.push(ul(l,"archived"))}else{let l=w_(x_(t,c));if(!l)continue;let d=w_(EO(t,e,a))?.status;l.status==="done"&&d!=="done"?n.push(ul(l,"flipped-to-done")):l.status==="done"&&d==="done"?n.push(ul(l,"modified-while-done")):l.status==="archived"&&d!=="archived"&&n.push(ul(l,"archived"))}}return n.sort((i,o)=>i.id.localeCompare(o.id)),n}function pH(t){return t.startsWith("spec/features/")&&(t.endsWith(".yaml")||t.endsWith(".yml"))}function ul(t,e){return{acceptance:(t.acceptance_criteria??[]).map(n=>AO(n)).filter(n=>n!==null),change:e,id:t.id,...t.slug?{slug:t.slug}:{},title:t.title}}function w_(t){if(t===null)return null;let e;try{e=(0,$_.parse)(t)}catch{return null}let r=e;return!r||typeof r.id!="string"||typeof r.status!="string"?null:{id:r.id,slug:typeof r.slug=="string"?r.slug:void 0,title:typeof r.title=="string"?r.title:r.id,status:r.status,acceptance_criteria:r.acceptance_criteria}}function x_(t,e){let r=hH(t,e);if(!Lge(r))return null;try{return zge(r,"utf8")}catch{return null}}function EO(t,e,r){try{return Df(t,["show",`${e}:${r}`])}catch{return null}}function Bge(t,e){let r=Hge(t).filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=[],i=new Set;for(let s of r){let a=new Set(s.features??[]),c=e.filter(l=>a.has(l.id)&&!i.has(l.id));if(c.length!==0){for(let l of c)i.add(l.id);n.push({capability:s.id,features:c,title:s.title??s.id})}}let o=e.filter(s=>!i.has(s.id));return o.length>0&&n.push({capability:"uncategorized",features:o,title:"Uncategorized"}),n}function Hge(t){let e=x_(t,hH("spec","capabilities.yaml"));if(e===null)return[];try{let r=(0,$_.parse)(e);return Array.isArray(r?.capabilities)?r.capabilities:[]}catch{return[]}}function mH(t){let e={};if(t!==null)try{let n=(0,$_.parse)(t);n&&typeof n.inventory=="object"&&n.inventory!==null&&(e=n.inventory)}catch{}let r=n=>typeof e[n]=="number"?e[n]:0;return{capabilities:r("capabilities"),features:r("features"),scenarios:r("scenarios"),test_files:r("test_files")}}function Vge(t,e){let r=Df(t,["log",`${e}..HEAD`,"--format=%h%x09%s","--","src/"]),n=[];for(let i of r.split(` +`)){if(i.trim().length===0)continue;let o=i.indexOf(" ");if(o<0)continue;let s=i.slice(0,o),a=i.slice(o+1);Gge.test(a)&&(Zge.test(a)||n.push({hash:s,subject:a}))}return n}var $_,Gge,Zge,dl=y(()=>{"use strict";$_=St(er(),1);_a();Gge=/^(feat|fix)(\([^)]*\))?!?:/,Zge=/\bF-(\d{3,}|[a-f0-9]{6,})\b/});import{execFileSync as gH}from"node:child_process";import{appendFileSync as Wge,existsSync as TO,mkdirSync as Kge,readFileSync as Jge,renameSync as Yge,statSync as Xge}from"node:fs";import{userInfo as Qge}from"node:os";import{dirname as eye,join as RO}from"node:path";function IO(t){return RO(t,yH,tye)}function Qr(t,e){let r=IO(t),n=eye(r);TO(n)||Kge(n,{recursive:!0});try{TO(r)&&Xge(r).size>rye&&Yge(r,RO(n,_H))}catch{}Wge(r,`${JSON.stringify(e)} +`,"utf8")}function OO(t){if(!TO(t))return[];let e=Jge(t,"utf8").trim();return e.length===0?[]:e.split(` +`).filter(r=>r.length>0).map(r=>JSON.parse(r))}function ba(t){return OO(IO(t))}function k_(t){return[...OO(RO(t,yH,_H)),...OO(IO(t))]}function en(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function nye(t){let e;try{e=gH("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=Qge().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function iye(t){try{return gH("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function Nf(t,e){try{let r=ba(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function tr(t,e,r){try{let n=iye(t),i=nye(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=Nf(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Qr(t,en(e,o))}catch{}}var yH,tye,_H,rye,Nr=y(()=>{"use strict";yH=".cladding",tye="events.log.jsonl",_H="events.log.1.jsonl",rye=5*1024*1024});import{execFileSync as oye}from"node:child_process";import{existsSync as bH,readdirSync as sye,readFileSync as aye,statSync as vH}from"node:fs";import{createHash as cye}from"node:crypto";import{join as PO}from"node:path";function va(t){try{return oye("git",["rev-parse","HEAD"],{cwd:t,stdio:["ignore","pipe","ignore"]}).toString("utf8").trim()||null}catch{return null}}function CO(t){let e=[],r=PO(t,"spec.yaml");bH(r)&&vH(r).isFile()&&e.push(r);for(let i of["features","scenarios"]){let o=PO(t,"spec",i);if(!(!bH(o)||!vH(o).isDirectory()))for(let s of sye(o))s.endsWith(".yaml")&&e.push(PO(o,s))}e.sort();let n=cye("sha256");for(let i of e){let o=i.slice(t.length+1);n.update(`${o}\0`),n.update(aye(i)),n.update("\0")}return n.digest("hex")}function E_(t,e){let r={featureId:e,gitHead:va(t),specDigest:CO(t),timestamp:new Date().toISOString()};return Qr(t,en("feature_checkpoint",{feature:e,git_head:r.gitHead,spec_digest:r.specDigest})),r}function A_(t,e){let r=ba(t);for(let n=r.length-1;n>=0;n--){let i=r[n];if(i.type==="feature_checkpoint"&&i.payload.feature===e)return{featureId:e,gitHead:i.payload.git_head??null,specDigest:String(i.payload.spec_digest??""),timestamp:i.timestamp}}return null}function T_(t,e,r,n){let i=en("feature_rolled_back",{feature:e,to_git_head:r.gitHead,to_spec_digest:r.specDigest,to_checkpoint_at:r.timestamp,reason:n??null});return Qr(t,i),i}var jf=y(()=>{"use strict";Nr()});import{readFileSync as lye,statSync as uye}from"node:fs";import{extname as dye,resolve as DO,sep as fye}from"node:path";function tn(t){return Math.ceil(t.length/4)}function hye(t,e){let r=DO(e),n=DO(r,t);return n===r||n.startsWith(r+fye)}function wH(t,e,r,n){if(!hye(t,e))return{path:t,omitted:"unsafe-path"};if(!pye.has(dye(t).toLowerCase()))return{path:t,omitted:"unsupported"};let i,o;if(n){let l=n(t);if(l==null)return{path:t,omitted:"missing"};if(i=l,o=Buffer.byteLength(l,"utf8"),o>SH)return{path:t,omitted:"too-large",bytes:o}}else{let l=DO(e,t);try{o=uye(l).size}catch{return{path:t,omitted:"missing"}}if(o>SH)return{path:t,omitted:"too-large",bytes:o};try{i=lye(l,"utf8")}catch{return{path:t,omitted:"missing",bytes:o}}}if(i.includes(mye))return{path:t,omitted:"binary",bytes:o};let s=Math.max(0,Math.floor(r));if(i.length<=s)return{path:t,text:i,bytes:o};let a=` /* ... clipped (${o} bytes total) ... */ -`,c=Math.max(0,s-a.length);return{path:t,text:i.slice(0,c)+a,truncated:!0,bytes:o}}var sye,gH,aye,T_=y(()=>{"use strict";sye=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".rs",".go",".java",".kt",".kts",".cs",".rb",".php",".swift",".c",".h",".cpp",".hpp",".css",".scss",".sql",".sh",".yaml",".yml",".json",".md",".toml"]),gH=2e6,aye="\0"});function uye(t){for(let i of lye)if(t.startsWith(i))return null;let e=t.indexOf("#"),n=(e>=0?t.slice(0,e):t).trim();return n.length>0?n:null}function DO(t,e,r){let n=t.get(e);n||(n=new Set,t.set(e,n)),n.add(r)}function dye(t){let e=new Map,r=new Map,n=new Map;for(let i of t.features??[]){let o=i.id;for(let s of i.depends_on??[])DO(e,s,o);for(let s of i.modules??[])DO(r,s,o);for(let s of i.acceptance_criteria??[])for(let a of s.test_refs??[]){let c=uye(a);c&&DO(n,c,o)}}return{dependents:e,moduleOwners:r,testRefCitations:n}}function En(t){let e=_H.get(t);return e||(e=dye(t),_H.set(t,e)),e}var lye,_H,Sa=y(()=>{"use strict";lye=["derived:","fixture:","script:","self-dogfood:"];_H=new WeakMap});function NO(t,e,r=1/0){let n=new Set,i=new Set(t),o=[...i],s=0;for(;o.length>0&&sn.id===e)??r.find(n=>n.slug===e)??null}function br(t,e,r={}){let n=r.depth??1/0,i=En(t),o=new Map((t.features??[]).map(_=>[_.id,_])),s=[],a,c=fye(t,e);if(c)s=[c];else{let _=i.moduleOwners.get(e);_&&_.size>0&&(a=e,s=[..._].map(S=>o.get(S)).filter(S=>!!S))}if(s.length===0)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/spec/load.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (run clad sync if missing); module paths live in each shard\u2019s modules:; if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let l=s.map(_=>_.id),u=NO(l,i.dependents,n),d=[...u].map(_=>o.get(_)).filter(_=>!!_).map(_=>({id:_.id,title:_.title,status:_.status})).sort((_,S)=>_.id.localeCompare(S.id)),f=new Set([...l,...u]),p=[...f].map(_=>o.get(_)).filter(_=>!!_),m=[...new Set(p.flatMap(_=>_.modules??[]))].sort(),h=(t.scenarios??[]).filter(_=>(_.features??[]).some(S=>f.has(S))).map(_=>({id:_.id,title:_.title})).sort((_,S)=>_.id.localeCompare(S.id)),g=[...new Set(p.flatMap(_=>(_.acceptance_criteria??[]).flatMap(S=>S.test_refs??[])))].sort();return{focus:a?{module:a,owners:[...l].sort()}:{id:s[0].id,title:s[0].title,status:s[0].status},impacted:d,impacted_modules:m,scenarios:h,test_refs:g,ledger:jO(i)}}var wa=y(()=>{"use strict";Sa()});function bH(t){return t.impacted.length}function R_(t,e,r={}){let n=r.initialDepth??O_.initialDepth,i=r.maxDepth??O_.maxDepth,o=r.coverageThreshold??O_.coverageThreshold,s=r.marginYieldThreshold??O_.marginYieldThreshold,a=En(t),c=new Map((t.features??[]).map(b=>[b.id,b])),l=[],u=(t.features??[]).find(b=>b.id===e||b.slug===e);if(u)l=[u.id];else{let b=a.moduleOwners.get(e);b&&b.size>0&&(l=[...b].filter(_=>c.has(_)))}if(l.length===0){let b=br(t,e,{depth:1});return"not_found"in b,b}let d=NO(l,a.dependents,1/0).size;if(d===0){let b=br(t,e,{depth:n});return"not_found"in b?b:{slice:b,depthUsed:n,stoppedBy:"no-known-dependents",analysis:{frontierExhausted:!0,coverage:null,marginalYields:[0],totalKnownDependents:0}}}let f=[],p=0,m=null;for(let b=n;b<=i;b++){let _=br(t,e,{depth:b});if("not_found"in _)return _;m=_;let S=bH(_),x=S-p,w=S>0?x/S:0;f.push(w);let O=d>0?S/d:1,T=x===0&&b>n,A={frontierExhausted:T,coverage:O,marginalYields:[...f],totalKnownDependents:d};if(T)return{slice:_,depthUsed:b,stoppedBy:"exhaustion",analysis:A};if(O>=o)return{slice:_,depthUsed:b,stoppedBy:"coverage",analysis:A};if(f.length>=2&&f[f.length-1]0?g/d:1,marginalYields:[...f],totalKnownDependents:d}}}var O_,MO=y(()=>{"use strict";wa();Sa();O_={initialDepth:1,maxDepth:10,coverageThreshold:.9,marginYieldThreshold:.05}});function pye(t,e){let r=new Set,n=[t];for(;n.length>0;){let i=n.pop();if(!i||r.has(i))continue;r.add(i);let o=e.get(i);for(let s of o?.depends_on??[])n.push(s)}return r}function vH(t,e){let r=new Map(t.features.map(a=>[a.id,a]));if(!r.has(e))return t;let n=pye(e,r),i=t.features.filter(a=>n.has(a.id)),o=(t.scenarios??[]).filter(a=>(a.features??[]).some(c=>n.has(c)));return{...t,features:i,scenarios:o}}var SH=y(()=>{"use strict"});function mye(t,e){let r=t.features??[];return r.find(n=>n.id===e)??r.find(n=>n.slug===e)??r.find(n=>(n.modules??[]).includes(e))??null}function ll(t,e){let r=mye(t,e);if(!r)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/auth/login.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (id, slug, status; run clad sync if missing); if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let n=vH(t,r.id),i=(n.features??[]).filter(c=>c.id!==r.id).map(c=>({id:c.id,title:c.title,status:c.status})).sort((c,l)=>c.id.localeCompare(l.id)),o=(n.scenarios??[]).map(c=>({id:c.id,title:c.title})).sort((c,l)=>c.id.localeCompare(l.id)),s=(t.project?.ai_hints?.preferred_patterns??[]).map(c=>({when:c.when,prefer:c.prefer,...c.over!==void 0?{over:c.over}:{}})),a=[...new Set((r.acceptance_criteria??[]).flatMap(c=>c.test_refs??[]))].sort();return{focus:r,ancestors:i,scenarios:o,preferred_patterns:s,test_refs:a}}var I_=y(()=>{"use strict";SH()});import{existsSync as xH,readdirSync as hye,readFileSync as gye}from"node:fs";import{join as LO}from"node:path";function zO(t,e=_ye){let r=t.trim().replace(/\s+/g," ");return r.length<=e?r:`${r.slice(0,e-1)}\u2026`}function bye(t){let e=t.payload??{};if(t.type==="drift_detected"){let n=typeof e.gate=="string"&&e.gate?e.gate:"drift";return{detector:n,message:zO(`drift detected at gate ${n}`)}}let r=typeof e.worst=="number"?` (worst ${e.worst})`:"";return{detector:"done_attempted",message:zO(`done reverted \u2014 pre-push strict gate red${r}`)}}function wH(t){let e=Date.parse(t.timestamp);return Number.isFinite(e)?e:0}function vye(t){let e=[];t.lastFailedGate&&e.push(`failed ${t.lastFailedGate}`),typeof t.retryCount=="number"&&e.push(`${t.retryCount} retries`);let r=e.length?` (${e.join(", ")})`:"",n=t.recovery?`recover: ${t.recovery}${r}`:`rolled back${r}`;return zO(n)}function Sye(t,e,r,n={}){let i=t.filter(m=>m&&m.payload&&m.payload.feature===r),o=e.filter(m=>m&&m.featureId===r).slice().sort((m,h)=>wH(m)-wH(h)),s=i.filter(m=>m.type==="drift_detected"||m.type==="done_attempted"&&m.payload.kept===!1),a=i.filter(m=>m.type==="feature_rolled_back");if(s.length===0&&a.length===0&&o.length===0)return;let c=o.length?o[o.length-1]:void 0,l;for(let m=s.length-1;m>=0;m--){let h=s[m].payload.gate;if(s[m].type==="drift_detected"&&typeof h=="string"&&h){l=h;break}}!l&&c?.lastFailedGate&&(l=c.lastFailedGate);let u=s.slice(-yye).map(bye),d;for(let m=a.length-1;m>=0;m--){let h=a[m].payload.to_git_head;if(typeof h=="string"&&h){d=h;break}}let f=typeof c?.retryCount=="number"?c.retryCount:void 0,p=c?vye(c):void 0;return{attempts:s.length,...l?{last_failed_gate:l}:{},...f!==void 0?{retry_count:f}:{},...u.length?{drift_history:u}:{},...d?{rolled_back_at:d}:{},...p?{recovery_hint:p}:{},...n.truncated?{truncated_history:!0}:{}}}function FO(t,e){let r=t.match(e);return r&&r[1]?r[1].trim():void 0}function wye(t){let e=t.indexOf("## Recommended recovery");if(e<0)return;let r=t.slice(e).match(/```[^\n]*\n([\s\S]*?)```/);return r&&r[1].split(` -`).map(i=>i.trim()).find(i=>i.length>0)||void 0}function xye(t,e,r){let n=FO(t,/_Rolled back at_\s*`([^`]+)`/),i=FO(t,/Last failed gate:\s*`([^`]+)`/),o=FO(t,/Retry attempts:\s*(\d+)/),s=wye(t);return{featureId:e,timestamp:n??r,...i?{lastFailedGate:i}:{},...o?{retryCount:Number(o)}:{},...s?{recovery:s}:{}}}function $ye(t,e){let r=LO(t,".cladding","post-mortems");if(!xH(r))return[];let n=`post-mortem-${e}-`,i=[];for(let o of hye(r))if(!(!o.startsWith(n)||!o.endsWith(".md")))try{i.push(xye(gye(LO(r,o),"utf8"),e,o))}catch{}return i}function $H(t,e){try{let r=$_(t),n=$ye(t,e),i=xH(LO(t,".cladding","events.log.1.jsonl"));return Sye(r,n,e,{truncated:i})}catch{return}}var yye,_ye,kH=y(()=>{"use strict";Nr();yye=5,_ye=120});function P_(t,e,r){return en(JSON.stringify({...t,needs:e,must_edit:{...t.must_edit,code:r}}))}function xa(t,e,r={}){let n=r.cwd??".",i=r.maxTokens&&r.maxTokens>0?r.maxTokens:kye,o=e,s,a=En(t).moduleOwners.get(e);if(a&&a.size>0){let se=[...a].sort();o=se[0],se.length>1&&(s=se)}let c=ll(t,o);if("not_found"in c)return c;let l=c.focus,u=$H(n,l.id),d=a&&a.size>0?e:l.id,f=R_(t,d),p="not_found"in f?null:f.slice,m=p?p.impacted:[],h=p?p.test_refs:[],g="not_found"in f?null:{depth:f.depthUsed,stopped_by:f.stoppedBy,coverage:f.analysis.coverage===null?null:Math.round(f.analysis.coverage*100)/100,total_known_dependents:f.analysis.totalKnownDependents},b=l.acceptance_criteria??[],_=b.filter(se=>se.ears==="unwanted"||se.ears==="state").map(se=>({id:se.id,ears:String(se.ears)})),S=[...new Set(b.flatMap(se=>se.oracle_refs??[]))].sort(),x=[],w={must_edit:{id:l.id,title:l.title,status:l.status,modules:l.modules??[],acceptance_criteria:b,code:[],...s?{co_owners:s}:{}},needs:c.ancestors,breaks_if_changed:{impacted:m,regression_tests:h,...g?{radius:g}:{}},verify:{scenarios:c.scenarios,test_refs:c.test_refs,oracle_refs:S,high_risk_acs:_},guidance:{preferred_patterns:c.preferred_patterns},budget:{max_tokens:i,used_tokens:0,truncated:x}},O=[...c.ancestors];for(;O.length>Eye&&P_(w,O,[])>i;)O.pop();O.lengthi){x.push(`code: omitted ${se} (budget)`);continue}A.push(Kt),Kt.truncated&&x.push(`code: clipped ${se}`)}T>i&&x.push("must-edit exceeds budget \u2014 retained in full (focus is never dropped)");let D=(se,Ce)=>({impacted:se,regression_tests:Ce,...g?{radius:g}:{},...p?.ledger?{ledger:p.ledger}:{}}),$=(se,Ce,Kt,dr)=>{let Yt=Kt+dr>0?[`breaks: omitted ${Kt} feature(s) / ${dr} test(s)`]:[],co={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:D(se,Ce),budget:{...w.budget,truncated:[...x,...Yt]}};return en(JSON.stringify(co))>i},re=m,K=h;if($(re,K,0,0)){let se=br(t,d,{depth:1}),Ce=new Set("not_found"in se?[]:se.impacted.map(de=>de.id)),Kt=new Set("not_found"in se?[]:se.test_refs),Yt=[...m.filter(de=>Ce.has(de.id)),...m.filter(de=>!Ce.has(de.id))],co=0;for(;Yt.length>Ce.size&&$(Yt,K,co,0);)Yt=Yt.slice(0,-1),co++;let wi=[...h],Yr=0;for(;$(Yt,wi,co,Yr);){let de=-1;for(let lo=wi.length-1;lo>=0;lo--)if(!Kt.has(wi[lo])){de=lo;break}if(de<0)break;wi.splice(de,1),Yr++}re=Yt,K=wi,co+Yr>0&&x.push(`breaks: omitted ${co} feature(s) / ${Yr} test(s)`),$(re,K,0,0)&&x.push("breaks: direct set retained in full \u2014 exceeds budget")}let xe=D(re,K),C={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:xe},P=C;if(u){let se={...C,prior_attempts:u};en(JSON.stringify(se))<=i?P=se:x.push("prior_attempts: omitted (budget)")}let Ir=en(JSON.stringify(P));return{...P,budget:{max_tokens:i,used_tokens:Ir,truncated:x}}}var kye,Eye,C_=y(()=>{"use strict";T_();I_();MO();kH();wa();Sa();kye=3e3,Eye=3});function Jn(t){if(t.length===0)return 0;let e=[...t].sort((n,i)=>n-i),r=Math.floor(e.length/2);return e.length%2?e[r]:(e[r-1]+e[r])/2}function Aye(t,e){if(t.length===0)return 0;let r=[...t].sort((n,i)=>n-i);return r[Math.min(r.length-1,Math.floor(e/100*r.length))]}function EH(t,e,r="."){let n=En(t),i=t.features??[],o=[];for(let f of i){let p=xa(t,f.id,{cwd:r,read:e});if("not_found"in p)continue;let m=xa(t,f.id,{cwd:r,read:e,maxTokens:Number.MAX_SAFE_INTEGER}),h=R_(t,f.id),g=!("not_found"in h),b=en(JSON.stringify(p)),_="not_found"in m?b:en(JSON.stringify(m)),S=en(JSON.stringify(f));for(let O of f.modules??[]){let T=e(O);T&&(S+=en(T))}let x=(f.depends_on??[]).length,w=n.dependents.get(f.id)?.size??0;o.push({id:f.id,sliceTokens:b,structuralTokens:_,naiveTokens:S,contextRatio:S>0?b/S:1,budgetSaturated:p.budget.truncated.length>0,searchDepth:g?h.depthUsed:1,edgesResolved:x+w,stoppedBy:g?h.stoppedBy:"n/a",coverage:g?h.analysis.coverage:1,regressionTests:p.breaks_if_changed.regression_tests.length})}o.sort((f,p)=>f.id.localeCompare(p.id));let s=o.map(f=>f.contextRatio),a=f=>f.filter(p=>p.sliceTokens>0).map(p=>p.naiveTokens/p.sliceTokens),c=o.filter(f=>!f.budgetSaturated),l=o.filter(f=>f.budgetSaturated),u=o.filter(f=>f.naiveTokens>0).map(f=>f.structuralTokens/f.naiveTokens),d={};for(let f of o)d[f.stoppedBy]=(d[f.stoppedBy]??0)+1;return{featureCount:i.length,measured:o.length,context:{medianContextRatio:Math.round(Jn(s)*1e3)/1e3,medianShrinkFactor:Math.round(Jn(a(o))*10)/10,fitsCount:c.length,truncatedCount:l.length,medianShrinkFit:Math.round(Jn(a(c))*10)/10,medianShrinkTruncated:Math.round(Jn(a(l))*10)/10,medianStructuralRatio:Math.round(Jn(u)*100)/100,medianSliceTokens:Math.round(Jn(o.map(f=>f.sliceTokens))),medianNaiveTokens:Math.round(Jn(o.map(f=>f.naiveTokens)))},search:{medianDepth:Jn(o.map(f=>f.searchDepth)),p95Depth:Aye(o.map(f=>f.searchDepth),95),medianEdges:Jn(o.map(f=>f.edgesResolved)),maxEdges:o.reduce((f,p)=>Math.max(f,p.edgesResolved),0)},stability:{byStopReason:d,medianCoverage:Math.round(Jn(o.map(f=>f.coverage).filter(f=>f!==null))*100)/100,medianRegressionTests:Jn(o.map(f=>f.regressionTests))},features:o}}var ul,D_=y(()=>{"use strict";T_();MO();C_();Sa();ul="(deterministic upper bound vs the shard+all-modules baseline \u2014 not an agent-adoption measurement)"});import{appendFileSync as Tye,existsSync as UO,mkdirSync as Oye,readFileSync as AH}from"node:fs";import{dirname as Rye,join as Iye}from"node:path";function qO(t){return Iye(t,Pye,Cye)}function Dye(t,e){return{timestamp:new Date().toISOString(),head:va(t),spec_digest:PO(t),featureCount:e.featureCount,measured:e.measured,context:e.context,search:e.search,stability:e.stability}}function TH(t,e){try{let r=Dye(t,e);if(r.head===null)return{appended:!1,reason:"no_head"};let n=BO(t),i=n[n.length-1];if(i&&i.head===r.head&&i.spec_digest===r.spec_digest)return{appended:!1,reason:"deduped"};let o=qO(t),s=Rye(o);return UO(s)||Oye(s,{recursive:!0}),Tye(o,`${JSON.stringify(r)} -`,"utf8"),{appended:!0,reason:"appended"}}catch{return{appended:!1,reason:"error"}}}function OH(t){let e=[];for(let r of t.split(` -`)){let n=r.trim();if(n.length!==0)try{let i=JSON.parse(n);i&&typeof i=="object"&&i.context&&i.search&&i.stability&&e.push(i)}catch{}}return e}function BO(t,e){let r=qO(t);if(!UO(r))return[];let n;try{n=AH(r,"utf8")}catch{return[]}let i=OH(n);return typeof e=="number"&&e>=0?i.slice(-e):i}function RH(t){let e=qO(t);if(!UO(e))return{snapshots:[],unreadable:!1};let r;try{r=AH(e,"utf8")}catch{return{snapshots:[],unreadable:!0}}let n=OH(r),i=r.trim().length>0;return{snapshots:n,unreadable:i&&n.length===0}}function Mf(t,e=0){let r=e>0?Math.round(t*10**e)/10**e:Math.round(t),n=r.toFixed(e);return r>0?`+${n}`:n}function IH(t,e=5){let r=Math.max(0,t.length-e),i=[`measure trend \xB7 last ${t.slice(r).length} of ${t.length} snapshot(s)`];for(let o=r;o0?t[o-1]:null,c=(d,f=0)=>a?` (${Mf(d(s)-d(a),f)})`:"",l=s.timestamp.slice(0,19),u=s.head?s.head.slice(0,7):"nogit";i.push(` ${l} ${u} \xB7 ${s.featureCount} feat \xB7 slice ${s.context.medianSliceTokens}${c(d=>d.context.medianSliceTokens)} \xB7 struct ${s.context.medianStructuralRatio.toFixed(2)}${c(d=>d.context.medianStructuralRatio,2)} \xB7 cov ${s.stability.medianCoverage.toFixed(2)}${c(d=>d.stability.medianCoverage,2)} \xB7 p95depth ${s.search.p95Depth}${c(d=>d.search.p95Depth)} \xB7 trunc ${s.context.truncatedCount}${c(d=>d.context.truncatedCount)}`)}return i.push(` ${ul}`),i.join(` -`)}var Pye,Cye,Ff=y(()=>{"use strict";jf();D_();Pye=".cladding",Cye="measure.jsonl"});import{existsSync as Nye}from"node:fs";import{join as jye}from"node:path";function dl(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${Mye[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` -`)}function CH(t){let e=t.snapshot,r=["## Measured (this release)",""];if(!e||!e.head)return r.push("not measured at this commit \u2014 run clad measure before tagging"),r.join(` -`);let n=e.context,i=e.stability;r.push(`- features measured: ${e.measured} of ${e.featureCount}`),r.push(`- median slice tokens: ${n.medianSliceTokens} vs ${n.medianNaiveTokens} naive`),r.push(`- median structural ratio: ${n.medianStructuralRatio.toFixed(2)}`),r.push(`- median coverage: ${i.medianCoverage.toFixed(2)}`),r.push(`- regression tests surfaced: ${i.medianRegressionTests}`);let o=t.sinceSnapshot;if(o){let s=t.sinceRef??(o.head?o.head.slice(0,7):"previous");r.push(`- since ${s}: slice ${Mf(n.medianSliceTokens-o.context.medianSliceTokens)} \xB7 struct ${Mf(n.medianStructuralRatio-o.context.medianStructuralRatio,2)} \xB7 cov ${Mf(i.medianCoverage-o.stability.medianCoverage,2)}`)}return r.push("",`head ${e.head.slice(0,7)} \xB7 spec_digest ${e.spec_digest}`,`reproduce: git checkout ${e.head} && clad measure`,"",ul),r.join(` -`)}function fl(t,e,r){let n=[`# Audit \u2014 shipped changes since ${t.since}`,"","| feature | AC | EARS | verification refs |","|---|---|---|---|"],i=new Map(e.features.map(o=>[o.id,o]));for(let o of t.groups)for(let s of o.features){let a=i.get(s.id);if(!a){n.push(`| ${s.id} | \u2014 | \u2014 | (removed from spec \u2014 see git history at ${t.since}) |`);continue}let c=a.acceptance_criteria??[];if(c.length===0){n.push(`| ${a.id} | \u2014 | \u2014 | (no acceptance criteria) |`);continue}for(let l of c)n.push(`| ${a.id} | ${l.id} | ${l.ears??"\u2014"} | ${Lye(l,r)} |`)}return n.join(` -`)}function Lye(t,e){let r=[...t.test_refs??[],...t.oracle_refs??[],...t.evidence_refs??[]];return r.length===0?"(none)":r.map(n=>{for(let[o,s]of Fye)if(n.startsWith(o))return`${n} (${s})`;let i=n.split("#",1)[0]??n;return`${Nye(jye(e,i))?"\u2713":"\u2717"} ${n}`}).join("
")}function pl(t){let e=[`# ${t.project.name} \u2014 capability catalog`,""],r=[...t.capabilities??[]].filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=new Map(t.features.map(s=>[s.id,s])),i=new Set;for(let s of r){e.push(`## ${s.title??s.id}`,""),s.summary&&e.push(s.summary,"");for(let a of s.features??[]){let c=n.get(a);!c||c.status==="archived"||(i.add(a),PH(e,c))}}let o=t.features.filter(s=>!i.has(s.id)&&s.status!=="archived").sort((s,a)=>s.id.localeCompare(a.id));if(o.length>0){e.push("## Uncategorized","");for(let s of o)PH(e,s)}for(;e[e.length-1]==="";)e.pop();return e.join(` -`)}function PH(t,e){t.push(`### ${e.title}`,"");for(let r of e.acceptance_criteria??[]){let n=EO(r);n&&t.push(`- ${n}`)}t.push("")}var Mye,Fye,N_=y(()=>{"use strict";Ff();D_();cl();Mye={"added-as-done":"new","flipped-to-done":"completed","modified-while-done":"updated",archived:"retired"};Fye=[["derived:","machine-suggested \u2014 not author-confirmed"],["self-dogfood:","verified by cladding running on itself"],["fixture:","conformance fixture"],["script:","npm script"]]});import{readFileSync as zye}from"node:fs";function Ai(t="./spec.yaml"){let e=zye(t,"utf8");return(0,DH.parse)(e)}var DH,j_=y(()=>{"use strict";DH=St(Qt(),1)});var is=v((jr,VO)=>{"use strict";var HO=jr.ValidationError=function(e,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+jH(l)},"instance")):i!==void 0&&(this.property=i),e&&(this.message=e),n){var a=n.$id||n.id;this.schema=a||n}r!==void 0&&(this.instance=r),this.name=o,this.argument=s,this.stack=this.toString()};HO.prototype.toString=function(){return this.property+" "+this.message};var M_=jr.ValidatorResult=function(e,r,n,i){this.instance=e,this.schema=r,this.options=n,this.path=i.path,this.propertyPath=i.propertyPath,this.errors=[],this.throwError=n&&n.throwError,this.throwFirst=n&&n.throwFirst,this.throwAll=n&&n.throwAll,this.disableFormat=n&&n.disableFormat===!0};M_.prototype.addError=function(e){var r;if(typeof e=="string")r=new HO(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");r=new HO(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new $a(this);if(this.throwError)throw r;return r};M_.prototype.importErrors=function(e){typeof e=="string"||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))};function Uye(t,e){return e+": "+t.toString()+` -`}M_.prototype.toString=function(e){return this.errors.map(Uye).join("")};Object.defineProperty(M_.prototype,"valid",{get:function(){return!this.errors.length}});VO.exports.ValidatorResultError=$a;function $a(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$a),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}$a.prototype=new Error;$a.prototype.constructor=$a;$a.prototype.name="Validation Error";var NH=jr.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};NH.prototype=Object.create(Error.prototype,{constructor:{value:NH,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var GO=jr.SchemaContext=function(e,r,n,i,o){this.schema=e,this.options=r,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce(function(s,a){return s+jH(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};GO.prototype.resolve=function(e){return MH(this.base,e)};GO.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=MH(this.base,i||"");var s=new GO(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var Yn=jr.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(t){return typeof t=="string"&&parseFloat(t)===parseInt(t,10)&&!isNaN(t)},regex:function(t){var e=!0;try{new RegExp(t)}catch{e=!1}return e},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};Yn.regexp=Yn.regex;Yn.pattern=Yn.regex;Yn.ipv4=Yn["ip-address"];jr.isFormat=function(e,r,n){if(typeof e=="string"&&Yn[r]!==void 0){if(Yn[r]instanceof RegExp)return Yn[r].test(e);if(typeof Yn[r]=="function")return Yn[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var jH=jr.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};jr.deepCompareStrict=function t(e,r){if(typeof e!=typeof r)return!1;if(Array.isArray(e))return!Array.isArray(r)||e.length!==r.length?!1:e.every(function(o,s){return t(e[s],r[s])});if(typeof e=="object"){if(!e||!r)return e===r;var n=Object.keys(e),i=Object.keys(r);return n.length!==i.length?!1:n.every(function(o){return t(e[o],r[o])})}return e===r};function qye(t,e,r,n){typeof r=="object"?e[n]=ZO(t[n],r):t.indexOf(r)===-1&&e.push(r)}function Bye(t,e,r){e[r]=t[r]}function Hye(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=ZO(t[n],e[n]):r[n]=e[n]}function ZO(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(qye.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(Bye.bind(null,t,n)),Object.keys(e).forEach(Hye.bind(null,t,e,n))),n}VO.exports.deepMerge=ZO;jr.objectGetPath=function(e,r){for(var n=r.split("/").slice(1),i;typeof(i=n.shift())=="string";){var o=decodeURIComponent(i.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in e))return;e=e[o]}return e};function Gye(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}jr.encodePath=function(e){return e.map(Gye).join("")};jr.getDecimalPlaces=function(e){var r=0;if(isNaN(e))return r;typeof e!="number"&&(e=Number(e));var n=e.toString().split("e");if(n.length===2){if(n[1][0]!=="-")return r;r=Number(n[1].slice(1))}var i=n[0].split(".");return i.length===2&&(r+=i[1].length),r};jr.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var MH=jr.resolveUrl=function(e,r){let n=new URL(r,new URL(e,"resolve://"));if(n.protocol==="resolve:"){let{pathname:i,search:o,hash:s}=n;return i+o+s}return n.toString()}});var UH=v((VXe,zH)=>{"use strict";var tn=is(),Le=tn.ValidatorResult,os=tn.SchemaError,WO={};WO.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var ze=WO.validators={};ze.type=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=Array.isArray(r.type)?r.type:[r.type];if(!s.some(this.testType.bind(this,e,r,n,i))){var a=s.map(function(c){if(c){var l=c.$id||c.id;return l?"<"+l+">":c+""}});o.addError({name:"type",argument:a,message:"is not of a type(s) "+a})}return o};function KO(t,e,r,n,i){var o=e.throwError,s=e.throwAll;e.throwError=!1,e.throwAll=!1;var a=this.validateSchema(t,i,e,r);return e.throwError=o,e.throwAll=s,!a.valid&&n instanceof Function&&n(a),a.valid}ze.anyOf=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=new Le(e,r,n,i);if(!Array.isArray(r.anyOf))throw new os("anyOf must be an array");if(!r.anyOf.some(KO.bind(this,e,n,i,function(c){s.importErrors(c)}))){var a=r.anyOf.map(function(c,l){var u=c.$id||c.id;return u?"<"+u+">":c.title&&JSON.stringify(c.title)||c.$ref&&"<"+c.$ref+">"||"[subschema "+l+"]"});n.nestedErrors&&o.importErrors(s),o.addError({name:"anyOf",argument:a,message:"is not any of "+a.join(",")})}return o};ze.allOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.allOf))throw new os("allOf must be an array");var o=new Le(e,r,n,i),s=this;return r.allOf.forEach(function(a,c){var l=s.validateSchema(e,a,n,i);if(!l.valid){var u=a.$id||a.id,d=u||a.title&&JSON.stringify(a.title)||a.$ref&&"<"+a.$ref+">"||"[subschema "+c+"]";o.addError({name:"allOf",argument:{id:d,length:l.errors.length,valid:l},message:"does not match allOf schema "+d+" with "+l.errors.length+" error[s]:"}),o.importErrors(l)}}),o};ze.oneOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.oneOf))throw new os("oneOf must be an array");var o=new Le(e,r,n,i),s=new Le(e,r,n,i),a=r.oneOf.filter(KO.bind(this,e,n,i,function(l){s.importErrors(l)})).length,c=r.oneOf.map(function(l,u){var d=l.$id||l.id;return d||l.title&&JSON.stringify(l.title)||l.$ref&&"<"+l.$ref+">"||"[subschema "+u+"]"});return a!==1&&(n.nestedErrors&&o.importErrors(s),o.addError({name:"oneOf",argument:c,message:"is not exactly one from "+c.join(",")})),o};ze.if=function(e,r,n,i){if(e===void 0)return null;if(!tn.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=KO.call(this,e,n,i,null,r.if),s=new Le(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!tn.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(e,r.then,n,i.makeChild(r.then)),s.importErrors(a)}else{if(r.else===void 0)return;if(!tn.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(e,r.else,n,i.makeChild(r.else)),s.importErrors(a)}return s};function JO(t,e){if(Object.hasOwnProperty.call(t,e))return t[e];if(e in t){for(;t=Object.getPrototypeOf(t);)if(Object.propertyIsEnumerable.call(t,e))return t[e]}}ze.propertyNames=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!tn.isSchema(s))throw new os('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(JO(e,a)!==void 0){var c=this.validateSchema(a,s,n,i.makeChild(s));o.importErrors(c)}return o}};ze.properties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.properties||{};for(var a in s){var c=s[a];if(c!==void 0){if(c===null)throw new os('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=JO(e,a),u=this.validateSchema(l,c,n,i.makeChild(c,a));u.instance!==o.instance[a]&&(o.instance[a]=u.instance),o.importErrors(u)}}return o}};function FH(t,e,r,n,i,o){if(this.types.object(t)&&!(e.properties&&e.properties[i]!==void 0))if(e.additionalProperties===!1)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var s=e.additionalProperties||{};typeof r.preValidateProperty=="function"&&r.preValidateProperty(t,i,s,r,n);var a=this.validateSchema(t[i],s,r,n.makeChild(s,i));a.instance!==o.instance[i]&&(o.instance[i]=a.instance),o.importErrors(a)}}ze.patternProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.patternProperties||{};for(var a in e){var c=!0;for(var l in s){var u=s[l];if(u!==void 0){if(u===null)throw new os('Unexpected null, expected schema in "patternProperties"');try{var d=new RegExp(l,"u")}catch{d=new RegExp(l)}if(d.test(a)){c=!1,typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,u,n,i);var f=this.validateSchema(e[a],u,n,i.makeChild(u,a));f.instance!==o.instance[a]&&(o.instance[a]=f.instance),o.importErrors(f)}}}c&&FH.call(this,e,r,n,i,a,o)}return o}};ze.additionalProperties=function(e,r,n,i){if(this.types.object(e)){if(r.patternProperties)return null;var o=new Le(e,r,n,i);for(var s in e)FH.call(this,e,r,n,i,s,o);return o}};ze.minProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=Object.keys(e);return s.length>=r.minProperties||o.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),o}};ze.maxProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=Object.keys(e);return s.length<=r.maxProperties||o.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),o}};ze.items=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.items!==void 0){var s=new Le(e,r,n,i);return e.every(function(a,c){if(Array.isArray(r.items))var l=r.items[c]===void 0?r.additionalItems:r.items[c];else var l=r.items;if(l===void 0)return!0;if(l===!1)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=o.validateSchema(a,l,n,i.makeChild(l,c));return u.instance!==s.instance[c]&&(s.instance[c]=u.instance),s.importErrors(u),!0}),s}};ze.contains=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.contains!==void 0){if(!tn.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new Le(e,r,n,i),a=e.some(function(c,l){var u=o.validateSchema(c,r.contains,n,i.makeChild(r.contains,l));return u.errors.length===0});return a===!1&&s.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),s}};ze.minimum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(e,r,n,i);return r.exclusiveMinimum&&r.exclusiveMinimum===!0?e>r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):e>=r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),o}};ze.maximum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(e,r,n,i);return r.exclusiveMaximum&&r.exclusiveMaximum===!0?er.exclusiveMinimum;return s||o.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),o}};ze.exclusiveMaximum=function(e,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(e)){var o=new Le(e,r,n,i),s=e=r.minLength||o.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),o}};ze.maxLength=function(e,r,n,i){if(this.types.string(e)){var o=new Le(e,r,n,i),s=e.match(/[\uDC00-\uDFFF]/g),a=e.length-(s?s.length:0);return a<=r.maxLength||o.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),o}};ze.minItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(e,r,n,i);return e.length>=r.minItems||o.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),o}};ze.maxItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(e,r,n,i);return e.length<=r.maxItems||o.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),o}};function Zye(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var YO=is();XO.exports.SchemaScanResult=qH;function qH(t,e){this.id=t,this.ref=e}XO.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=YO.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=YO.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!YO.deepCompareStrict(s[f],l))throw new Error("Schema <"+f+"> already exists with different definition");return s[f]}s[f]=l,f[f.length-1]=="#"&&(s[f.substring(0,f.length-1)]=l)}i(f+"/items",Array.isArray(l.items)?l.items:[l.items]),i(f+"/extends",Array.isArray(l.extends)?l.extends:[l.extends]),n(f+"/additionalItems",l.additionalItems),o(f+"/properties",l.properties),n(f+"/additionalProperties",l.additionalProperties),o(f+"/definitions",l.definitions),o(f+"/patternProperties",l.patternProperties),o(f+"/dependencies",l.dependencies),i(f+"/disallow",l.disallow),i(f+"/allOf",l.allOf),i(f+"/anyOf",l.anyOf),i(f+"/oneOf",l.oneOf),n(f+"/not",l.not)}function i(c,l){if(Array.isArray(l))for(var u=0;u{"use strict";var BH=UH(),ss=is(),HH=F_().scan,GH=ss.ValidatorResult,Vye=ss.ValidatorResultError,Lf=ss.SchemaError,ZH=ss.SchemaContext,Wye="/",Jt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(Ti),this.attributes=Object.create(BH.validators)};Jt.prototype.customFormats={};Jt.prototype.schemas=null;Jt.prototype.types=null;Jt.prototype.attributes=null;Jt.prototype.unresolvedRefs=null;Jt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=HH(r||Wye,e),o=r||e.$id||e.id;for(var s in i.id)this.schemas[s]=i.id[s];for(var s in i.ref)this.unresolvedRefs.push(s);return this.unresolvedRefs=this.unresolvedRefs.filter(function(a){return typeof n.schemas[a]>"u"}),this.schemas[o]};Jt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=ss.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new Lf("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Jt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new Lf('Unexpected null in "type" keyword');if(typeof this.types[o]=="function")return this.types[o].call(this,e);if(o&&typeof o=="object"){var s=this.validateSchema(e,o,n,i);return s===void 0||!(s&&s.errors.length)}return!0}};var Ti=Jt.prototype.types={};Ti.string=function(e){return typeof e=="string"};Ti.number=function(e){return typeof e=="number"&&isFinite(e)};Ti.integer=function(e){return typeof e=="number"&&e%1===0};Ti.boolean=function(e){return typeof e=="boolean"};Ti.array=function(e){return Array.isArray(e)};Ti.null=function(e){return e===null};Ti.date=function(e){return e instanceof Date};Ti.any=function(e){return!0};Ti.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};WH.exports=Jt});var JH=v((JXe,mo)=>{"use strict";var Kye=mo.exports.Validator=KH();mo.exports.ValidatorResult=is().ValidatorResult;mo.exports.ValidatorResultError=is().ValidatorResultError;mo.exports.ValidationError=is().ValidationError;mo.exports.SchemaError=is().SchemaError;mo.exports.SchemaScanResult=F_().SchemaScanResult;mo.exports.scan=F_().scan;mo.exports.validate=function(t,e,r){var n=new Kye;return n.validate(t,e,r)}});import{readFileSync as Jye}from"node:fs";import{dirname as Yye,join as Xye}from"node:path";import{fileURLToPath as Qye}from"node:url";function i_e(t){let e=n_e.validate(t,r_e);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function XH(t){let e=i_e(t);if(!e.valid)throw new Error(`spec.yaml invalid: +`,c=Math.max(0,s-a.length);return{path:t,text:i.slice(0,c)+a,truncated:!0,bytes:o}}var pye,SH,mye,O_=y(()=>{"use strict";pye=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".rs",".go",".java",".kt",".kts",".cs",".rb",".php",".swift",".c",".h",".cpp",".hpp",".css",".scss",".sql",".sh",".yaml",".yml",".json",".md",".toml"]),SH=2e6,mye="\0"});function yye(t){for(let i of gye)if(t.startsWith(i))return null;let e=t.indexOf("#"),n=(e>=0?t.slice(0,e):t).trim();return n.length>0?n:null}function NO(t,e,r){let n=t.get(e);n||(n=new Set,t.set(e,n)),n.add(r)}function _ye(t){let e=new Map,r=new Map,n=new Map;for(let i of t.features??[]){let o=i.id;for(let s of i.depends_on??[])NO(e,s,o);for(let s of i.modules??[])NO(r,s,o);for(let s of i.acceptance_criteria??[])for(let a of s.test_refs??[]){let c=yye(a);c&&NO(n,c,o)}}return{dependents:e,moduleOwners:r,testRefCitations:n}}function An(t){let e=xH.get(t);return e||(e=_ye(t),xH.set(t,e)),e}var gye,xH,Sa=y(()=>{"use strict";gye=["derived:","fixture:","script:","self-dogfood:"];xH=new WeakMap});function jO(t,e,r=1/0){let n=new Set,i=new Set(t),o=[...i],s=0;for(;o.length>0&&sn.id===e)??r.find(n=>n.slug===e)??null}function vr(t,e,r={}){let n=r.depth??1/0,i=An(t),o=new Map((t.features??[]).map(_=>[_.id,_])),s=[],a,c=bye(t,e);if(c)s=[c];else{let _=i.moduleOwners.get(e);_&&_.size>0&&(a=e,s=[..._].map(S=>o.get(S)).filter(S=>!!S))}if(s.length===0)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/spec/load.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (run clad sync if missing); module paths live in each shard\u2019s modules:; if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let l=s.map(_=>_.id),u=jO(l,i.dependents,n),d=[...u].map(_=>o.get(_)).filter(_=>!!_).map(_=>({id:_.id,title:_.title,status:_.status})).sort((_,S)=>_.id.localeCompare(S.id)),f=new Set([...l,...u]),p=[...f].map(_=>o.get(_)).filter(_=>!!_),m=[...new Set(p.flatMap(_=>_.modules??[]))].sort(),h=(t.scenarios??[]).filter(_=>(_.features??[]).some(S=>f.has(S))).map(_=>({id:_.id,title:_.title})).sort((_,S)=>_.id.localeCompare(S.id)),g=[...new Set(p.flatMap(_=>(_.acceptance_criteria??[]).flatMap(S=>S.test_refs??[])))].sort();return{focus:a?{module:a,owners:[...l].sort()}:{id:s[0].id,title:s[0].title,status:s[0].status},impacted:d,impacted_modules:m,scenarios:h,test_refs:g,ledger:MO(i)}}var wa=y(()=>{"use strict";Sa()});function $H(t){return t.impacted.length}function I_(t,e,r={}){let n=r.initialDepth??R_.initialDepth,i=r.maxDepth??R_.maxDepth,o=r.coverageThreshold??R_.coverageThreshold,s=r.marginYieldThreshold??R_.marginYieldThreshold,a=An(t),c=new Map((t.features??[]).map(b=>[b.id,b])),l=[],u=(t.features??[]).find(b=>b.id===e||b.slug===e);if(u)l=[u.id];else{let b=a.moduleOwners.get(e);b&&b.size>0&&(l=[...b].filter(_=>c.has(_)))}if(l.length===0){let b=vr(t,e,{depth:1});return"not_found"in b,b}let d=jO(l,a.dependents,1/0).size;if(d===0){let b=vr(t,e,{depth:n});return"not_found"in b?b:{slice:b,depthUsed:n,stoppedBy:"no-known-dependents",analysis:{frontierExhausted:!0,coverage:null,marginalYields:[0],totalKnownDependents:0}}}let f=[],p=0,m=null;for(let b=n;b<=i;b++){let _=vr(t,e,{depth:b});if("not_found"in _)return _;m=_;let S=$H(_),x=S-p,w=S>0?x/S:0;f.push(w);let O=d>0?S/d:1,T=x===0&&b>n,A={frontierExhausted:T,coverage:O,marginalYields:[...f],totalKnownDependents:d};if(T)return{slice:_,depthUsed:b,stoppedBy:"exhaustion",analysis:A};if(O>=o)return{slice:_,depthUsed:b,stoppedBy:"coverage",analysis:A};if(f.length>=2&&f[f.length-1]0?g/d:1,marginalYields:[...f],totalKnownDependents:d}}}var R_,FO=y(()=>{"use strict";wa();Sa();R_={initialDepth:1,maxDepth:10,coverageThreshold:.9,marginYieldThreshold:.05}});function vye(t,e){let r=new Set,n=[t];for(;n.length>0;){let i=n.pop();if(!i||r.has(i))continue;r.add(i);let o=e.get(i);for(let s of o?.depends_on??[])n.push(s)}return r}function kH(t,e){let r=new Map(t.features.map(a=>[a.id,a]));if(!r.has(e))return t;let n=vye(e,r),i=t.features.filter(a=>n.has(a.id)),o=(t.scenarios??[]).filter(a=>(a.features??[]).some(c=>n.has(c)));return{...t,features:i,scenarios:o}}var EH=y(()=>{"use strict"});function Sye(t,e){let r=t.features??[];return r.find(n=>n.id===e)??r.find(n=>n.slug===e)??r.find(n=>(n.modules??[]).includes(e))??null}function fl(t,e){let r=Sye(t,e);if(!r)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/auth/login.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (id, slug, status; run clad sync if missing); if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let n=kH(t,r.id),i=(n.features??[]).filter(c=>c.id!==r.id).map(c=>({id:c.id,title:c.title,status:c.status})).sort((c,l)=>c.id.localeCompare(l.id)),o=(n.scenarios??[]).map(c=>({id:c.id,title:c.title})).sort((c,l)=>c.id.localeCompare(l.id)),s=(t.project?.ai_hints?.preferred_patterns??[]).map(c=>({when:c.when,prefer:c.prefer,...c.over!==void 0?{over:c.over}:{}})),a=[...new Set((r.acceptance_criteria??[]).flatMap(c=>c.test_refs??[]))].sort();return{focus:r,ancestors:i,scenarios:o,preferred_patterns:s,test_refs:a}}var P_=y(()=>{"use strict";EH()});import{existsSync as TH,readdirSync as wye,readFileSync as xye}from"node:fs";import{join as zO}from"node:path";function UO(t,e=kye){let r=t.trim().replace(/\s+/g," ");return r.length<=e?r:`${r.slice(0,e-1)}\u2026`}function Eye(t){let e=t.payload??{};if(t.type==="drift_detected"){let n=typeof e.gate=="string"&&e.gate?e.gate:"drift";return{detector:n,message:UO(`drift detected at gate ${n}`)}}let r=typeof e.worst=="number"?` (worst ${e.worst})`:"";return{detector:"done_attempted",message:UO(`done reverted \u2014 pre-push strict gate red${r}`)}}function AH(t){let e=Date.parse(t.timestamp);return Number.isFinite(e)?e:0}function Aye(t){let e=[];t.lastFailedGate&&e.push(`failed ${t.lastFailedGate}`),typeof t.retryCount=="number"&&e.push(`${t.retryCount} retries`);let r=e.length?` (${e.join(", ")})`:"",n=t.recovery?`recover: ${t.recovery}${r}`:`rolled back${r}`;return UO(n)}function Tye(t,e,r,n={}){let i=t.filter(m=>m&&m.payload&&m.payload.feature===r),o=e.filter(m=>m&&m.featureId===r).slice().sort((m,h)=>AH(m)-AH(h)),s=i.filter(m=>m.type==="drift_detected"||m.type==="done_attempted"&&m.payload.kept===!1),a=i.filter(m=>m.type==="feature_rolled_back");if(s.length===0&&a.length===0&&o.length===0)return;let c=o.length?o[o.length-1]:void 0,l;for(let m=s.length-1;m>=0;m--){let h=s[m].payload.gate;if(s[m].type==="drift_detected"&&typeof h=="string"&&h){l=h;break}}!l&&c?.lastFailedGate&&(l=c.lastFailedGate);let u=s.slice(-$ye).map(Eye),d;for(let m=a.length-1;m>=0;m--){let h=a[m].payload.to_git_head;if(typeof h=="string"&&h){d=h;break}}let f=typeof c?.retryCount=="number"?c.retryCount:void 0,p=c?Aye(c):void 0;return{attempts:s.length,...l?{last_failed_gate:l}:{},...f!==void 0?{retry_count:f}:{},...u.length?{drift_history:u}:{},...d?{rolled_back_at:d}:{},...p?{recovery_hint:p}:{},...n.truncated?{truncated_history:!0}:{}}}function LO(t,e){let r=t.match(e);return r&&r[1]?r[1].trim():void 0}function Oye(t){let e=t.indexOf("## Recommended recovery");if(e<0)return;let r=t.slice(e).match(/```[^\n]*\n([\s\S]*?)```/);return r&&r[1].split(` +`).map(i=>i.trim()).find(i=>i.length>0)||void 0}function Rye(t,e,r){let n=LO(t,/_Rolled back at_\s*`([^`]+)`/),i=LO(t,/Last failed gate:\s*`([^`]+)`/),o=LO(t,/Retry attempts:\s*(\d+)/),s=Oye(t);return{featureId:e,timestamp:n??r,...i?{lastFailedGate:i}:{},...o?{retryCount:Number(o)}:{},...s?{recovery:s}:{}}}function Iye(t,e){let r=zO(t,".cladding","post-mortems");if(!TH(r))return[];let n=`post-mortem-${e}-`,i=[];for(let o of wye(r))if(!(!o.startsWith(n)||!o.endsWith(".md")))try{i.push(Rye(xye(zO(r,o),"utf8"),e,o))}catch{}return i}function OH(t,e){try{let r=k_(t),n=Iye(t,e),i=TH(zO(t,".cladding","events.log.1.jsonl"));return Tye(r,n,e,{truncated:i})}catch{return}}var $ye,kye,RH=y(()=>{"use strict";Nr();$ye=5,kye=120});function C_(t,e,r){return tn(JSON.stringify({...t,needs:e,must_edit:{...t.must_edit,code:r}}))}function xa(t,e,r={}){let n=r.cwd??".",i=r.maxTokens&&r.maxTokens>0?r.maxTokens:Pye,o=e,s,a=An(t).moduleOwners.get(e);if(a&&a.size>0){let se=[...a].sort();o=se[0],se.length>1&&(s=se)}let c=fl(t,o);if("not_found"in c)return c;let l=c.focus,u=OH(n,l.id),d=a&&a.size>0?e:l.id,f=I_(t,d),p="not_found"in f?null:f.slice,m=p?p.impacted:[],h=p?p.test_refs:[],g="not_found"in f?null:{depth:f.depthUsed,stopped_by:f.stoppedBy,coverage:f.analysis.coverage===null?null:Math.round(f.analysis.coverage*100)/100,total_known_dependents:f.analysis.totalKnownDependents},b=l.acceptance_criteria??[],_=b.filter(se=>se.ears==="unwanted"||se.ears==="state").map(se=>({id:se.id,ears:String(se.ears)})),S=[...new Set(b.flatMap(se=>se.oracle_refs??[]))].sort(),x=[],w={must_edit:{id:l.id,title:l.title,status:l.status,modules:l.modules??[],acceptance_criteria:b,code:[],...s?{co_owners:s}:{}},needs:c.ancestors,breaks_if_changed:{impacted:m,regression_tests:h,...g?{radius:g}:{}},verify:{scenarios:c.scenarios,test_refs:c.test_refs,oracle_refs:S,high_risk_acs:_},guidance:{preferred_patterns:c.preferred_patterns},budget:{max_tokens:i,used_tokens:0,truncated:x}},O=[...c.ancestors];for(;O.length>Cye&&C_(w,O,[])>i;)O.pop();O.lengthi){x.push(`code: omitted ${se} (budget)`);continue}A.push(Kt),Kt.truncated&&x.push(`code: clipped ${se}`)}T>i&&x.push("must-edit exceeds budget \u2014 retained in full (focus is never dropped)");let D=(se,Ce)=>({impacted:se,regression_tests:Ce,...g?{radius:g}:{},...p?.ledger?{ledger:p.ledger}:{}}),$=(se,Ce,Kt,dr)=>{let Xt=Kt+dr>0?[`breaks: omitted ${Kt} feature(s) / ${dr} test(s)`]:[],lo={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:D(se,Ce),budget:{...w.budget,truncated:[...x,...Xt]}};return tn(JSON.stringify(lo))>i},ie=m,K=h;if($(ie,K,0,0)){let se=vr(t,d,{depth:1}),Ce=new Set("not_found"in se?[]:se.impacted.map(de=>de.id)),Kt=new Set("not_found"in se?[]:se.test_refs),Xt=[...m.filter(de=>Ce.has(de.id)),...m.filter(de=>!Ce.has(de.id))],lo=0;for(;Xt.length>Ce.size&&$(Xt,K,lo,0);)Xt=Xt.slice(0,-1),lo++;let $i=[...h],Xr=0;for(;$(Xt,$i,lo,Xr);){let de=-1;for(let uo=$i.length-1;uo>=0;uo--)if(!Kt.has($i[uo])){de=uo;break}if(de<0)break;$i.splice(de,1),Xr++}ie=Xt,K=$i,lo+Xr>0&&x.push(`breaks: omitted ${lo} feature(s) / ${Xr} test(s)`),$(ie,K,0,0)&&x.push("breaks: direct set retained in full \u2014 exceeds budget")}let xe=D(ie,K),C={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:xe},P=C;if(u){let se={...C,prior_attempts:u};tn(JSON.stringify(se))<=i?P=se:x.push("prior_attempts: omitted (budget)")}let Ir=tn(JSON.stringify(P));return{...P,budget:{max_tokens:i,used_tokens:Ir,truncated:x}}}var Pye,Cye,D_=y(()=>{"use strict";O_();P_();FO();RH();wa();Sa();Pye=3e3,Cye=3});function Yn(t){if(t.length===0)return 0;let e=[...t].sort((n,i)=>n-i),r=Math.floor(e.length/2);return e.length%2?e[r]:(e[r-1]+e[r])/2}function Dye(t,e){if(t.length===0)return 0;let r=[...t].sort((n,i)=>n-i);return r[Math.min(r.length-1,Math.floor(e/100*r.length))]}function IH(t,e,r="."){let n=An(t),i=t.features??[],o=[];for(let f of i){let p=xa(t,f.id,{cwd:r,read:e});if("not_found"in p)continue;let m=xa(t,f.id,{cwd:r,read:e,maxTokens:Number.MAX_SAFE_INTEGER}),h=I_(t,f.id),g=!("not_found"in h),b=tn(JSON.stringify(p)),_="not_found"in m?b:tn(JSON.stringify(m)),S=tn(JSON.stringify(f));for(let O of f.modules??[]){let T=e(O);T&&(S+=tn(T))}let x=(f.depends_on??[]).length,w=n.dependents.get(f.id)?.size??0;o.push({id:f.id,sliceTokens:b,structuralTokens:_,naiveTokens:S,contextRatio:S>0?b/S:1,budgetSaturated:p.budget.truncated.length>0,searchDepth:g?h.depthUsed:1,edgesResolved:x+w,stoppedBy:g?h.stoppedBy:"n/a",coverage:g?h.analysis.coverage:1,regressionTests:p.breaks_if_changed.regression_tests.length})}o.sort((f,p)=>f.id.localeCompare(p.id));let s=o.map(f=>f.contextRatio),a=f=>f.filter(p=>p.sliceTokens>0).map(p=>p.naiveTokens/p.sliceTokens),c=o.filter(f=>!f.budgetSaturated),l=o.filter(f=>f.budgetSaturated),u=o.filter(f=>f.naiveTokens>0).map(f=>f.structuralTokens/f.naiveTokens),d={};for(let f of o)d[f.stoppedBy]=(d[f.stoppedBy]??0)+1;return{featureCount:i.length,measured:o.length,context:{medianContextRatio:Math.round(Yn(s)*1e3)/1e3,medianShrinkFactor:Math.round(Yn(a(o))*10)/10,fitsCount:c.length,truncatedCount:l.length,medianShrinkFit:Math.round(Yn(a(c))*10)/10,medianShrinkTruncated:Math.round(Yn(a(l))*10)/10,medianStructuralRatio:Math.round(Yn(u)*100)/100,medianSliceTokens:Math.round(Yn(o.map(f=>f.sliceTokens))),medianNaiveTokens:Math.round(Yn(o.map(f=>f.naiveTokens)))},search:{medianDepth:Yn(o.map(f=>f.searchDepth)),p95Depth:Dye(o.map(f=>f.searchDepth),95),medianEdges:Yn(o.map(f=>f.edgesResolved)),maxEdges:o.reduce((f,p)=>Math.max(f,p.edgesResolved),0)},stability:{byStopReason:d,medianCoverage:Math.round(Yn(o.map(f=>f.coverage).filter(f=>f!==null))*100)/100,medianRegressionTests:Yn(o.map(f=>f.regressionTests))},features:o}}var pl,N_=y(()=>{"use strict";O_();FO();D_();Sa();pl="(deterministic upper bound vs the shard+all-modules baseline \u2014 not an agent-adoption measurement)"});import{appendFileSync as Nye,existsSync as qO,mkdirSync as jye,readFileSync as PH}from"node:fs";import{dirname as Mye,join as Fye}from"node:path";function BO(t){return Fye(t,Lye,zye)}function Uye(t,e){return{timestamp:new Date().toISOString(),head:va(t),spec_digest:CO(t),featureCount:e.featureCount,measured:e.measured,context:e.context,search:e.search,stability:e.stability}}function CH(t,e){try{let r=Uye(t,e);if(r.head===null)return{appended:!1,reason:"no_head"};let n=HO(t),i=n[n.length-1];if(i&&i.head===r.head&&i.spec_digest===r.spec_digest)return{appended:!1,reason:"deduped"};let o=BO(t),s=Mye(o);return qO(s)||jye(s,{recursive:!0}),Nye(o,`${JSON.stringify(r)} +`,"utf8"),{appended:!0,reason:"appended"}}catch{return{appended:!1,reason:"error"}}}function DH(t){let e=[];for(let r of t.split(` +`)){let n=r.trim();if(n.length!==0)try{let i=JSON.parse(n);i&&typeof i=="object"&&i.context&&i.search&&i.stability&&e.push(i)}catch{}}return e}function HO(t,e){let r=BO(t);if(!qO(r))return[];let n;try{n=PH(r,"utf8")}catch{return[]}let i=DH(n);return typeof e=="number"&&e>=0?i.slice(-e):i}function NH(t){let e=BO(t);if(!qO(e))return{snapshots:[],unreadable:!1};let r;try{r=PH(e,"utf8")}catch{return{snapshots:[],unreadable:!0}}let n=DH(r),i=r.trim().length>0;return{snapshots:n,unreadable:i&&n.length===0}}function Mf(t,e=0){let r=e>0?Math.round(t*10**e)/10**e:Math.round(t),n=r.toFixed(e);return r>0?`+${n}`:n}function jH(t,e=5){let r=Math.max(0,t.length-e),i=[`measure trend \xB7 last ${t.slice(r).length} of ${t.length} snapshot(s)`];for(let o=r;o0?t[o-1]:null,c=(d,f=0)=>a?` (${Mf(d(s)-d(a),f)})`:"",l=s.timestamp.slice(0,19),u=s.head?s.head.slice(0,7):"nogit";i.push(` ${l} ${u} \xB7 ${s.featureCount} feat \xB7 slice ${s.context.medianSliceTokens}${c(d=>d.context.medianSliceTokens)} \xB7 struct ${s.context.medianStructuralRatio.toFixed(2)}${c(d=>d.context.medianStructuralRatio,2)} \xB7 cov ${s.stability.medianCoverage.toFixed(2)}${c(d=>d.stability.medianCoverage,2)} \xB7 p95depth ${s.search.p95Depth}${c(d=>d.search.p95Depth)} \xB7 trunc ${s.context.truncatedCount}${c(d=>d.context.truncatedCount)}`)}return i.push(` ${pl}`),i.join(` +`)}var Lye,zye,Ff=y(()=>{"use strict";jf();N_();Lye=".cladding",zye="measure.jsonl"});import{existsSync as qye}from"node:fs";import{join as Bye}from"node:path";function ml(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${Hye[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` +`)}function FH(t){let e=t.snapshot,r=["## Measured (this release)",""];if(!e||!e.head)return r.push("not measured at this commit \u2014 run clad measure before tagging"),r.join(` +`);let n=e.context,i=e.stability;r.push(`- features measured: ${e.measured} of ${e.featureCount}`),r.push(`- median slice tokens: ${n.medianSliceTokens} vs ${n.medianNaiveTokens} naive`),r.push(`- median structural ratio: ${n.medianStructuralRatio.toFixed(2)}`),r.push(`- median coverage: ${i.medianCoverage.toFixed(2)}`),r.push(`- regression tests surfaced: ${i.medianRegressionTests}`);let o=t.sinceSnapshot;if(o){let s=t.sinceRef??(o.head?o.head.slice(0,7):"previous");r.push(`- since ${s}: slice ${Mf(n.medianSliceTokens-o.context.medianSliceTokens)} \xB7 struct ${Mf(n.medianStructuralRatio-o.context.medianStructuralRatio,2)} \xB7 cov ${Mf(i.medianCoverage-o.stability.medianCoverage,2)}`)}return r.push("",`head ${e.head.slice(0,7)} \xB7 spec_digest ${e.spec_digest}`,`reproduce: git checkout ${e.head} && clad measure`,"",pl),r.join(` +`)}function hl(t,e,r){let n=[`# Audit \u2014 shipped changes since ${t.since}`,"","| feature | AC | EARS | verification refs |","|---|---|---|---|"],i=new Map(e.features.map(o=>[o.id,o]));for(let o of t.groups)for(let s of o.features){let a=i.get(s.id);if(!a){n.push(`| ${s.id} | \u2014 | \u2014 | (removed from spec \u2014 see git history at ${t.since}) |`);continue}let c=a.acceptance_criteria??[];if(c.length===0){n.push(`| ${a.id} | \u2014 | \u2014 | (no acceptance criteria) |`);continue}for(let l of c)n.push(`| ${a.id} | ${l.id} | ${l.ears??"\u2014"} | ${Zye(l,r)} |`)}return n.join(` +`)}function Zye(t,e){let r=[...t.test_refs??[],...t.oracle_refs??[],...t.evidence_refs??[]];return r.length===0?"(none)":r.map(n=>{for(let[o,s]of Gye)if(n.startsWith(o))return`${n} (${s})`;let i=n.split("#",1)[0]??n;return`${qye(Bye(e,i))?"\u2713":"\u2717"} ${n}`}).join("
")}function gl(t){let e=[`# ${t.project.name} \u2014 capability catalog`,""],r=[...t.capabilities??[]].filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=new Map(t.features.map(s=>[s.id,s])),i=new Set;for(let s of r){e.push(`## ${s.title??s.id}`,""),s.summary&&e.push(s.summary,"");for(let a of s.features??[]){let c=n.get(a);!c||c.status==="archived"||(i.add(a),MH(e,c))}}let o=t.features.filter(s=>!i.has(s.id)&&s.status!=="archived").sort((s,a)=>s.id.localeCompare(a.id));if(o.length>0){e.push("## Uncategorized","");for(let s of o)MH(e,s)}for(;e[e.length-1]==="";)e.pop();return e.join(` +`)}function MH(t,e){t.push(`### ${e.title}`,"");for(let r of e.acceptance_criteria??[]){let n=AO(r);n&&t.push(`- ${n}`)}t.push("")}var Hye,Gye,j_=y(()=>{"use strict";Ff();N_();dl();Hye={"added-as-done":"new","flipped-to-done":"completed","modified-while-done":"updated",archived:"retired"};Gye=[["derived:","machine-suggested \u2014 not author-confirmed"],["self-dogfood:","verified by cladding running on itself"],["fixture:","conformance fixture"],["script:","npm script"]]});import{readFileSync as Vye}from"node:fs";function Oi(t="./spec.yaml"){let e=Vye(t,"utf8");return(0,LH.parse)(e)}var LH,M_=y(()=>{"use strict";LH=St(er(),1)});var is=v((jr,WO)=>{"use strict";var GO=jr.ValidationError=function(e,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+UH(l)},"instance")):i!==void 0&&(this.property=i),e&&(this.message=e),n){var a=n.$id||n.id;this.schema=a||n}r!==void 0&&(this.instance=r),this.name=o,this.argument=s,this.stack=this.toString()};GO.prototype.toString=function(){return this.property+" "+this.message};var F_=jr.ValidatorResult=function(e,r,n,i){this.instance=e,this.schema=r,this.options=n,this.path=i.path,this.propertyPath=i.propertyPath,this.errors=[],this.throwError=n&&n.throwError,this.throwFirst=n&&n.throwFirst,this.throwAll=n&&n.throwAll,this.disableFormat=n&&n.disableFormat===!0};F_.prototype.addError=function(e){var r;if(typeof e=="string")r=new GO(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");r=new GO(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new $a(this);if(this.throwError)throw r;return r};F_.prototype.importErrors=function(e){typeof e=="string"||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))};function Wye(t,e){return e+": "+t.toString()+` +`}F_.prototype.toString=function(e){return this.errors.map(Wye).join("")};Object.defineProperty(F_.prototype,"valid",{get:function(){return!this.errors.length}});WO.exports.ValidatorResultError=$a;function $a(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$a),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}$a.prototype=new Error;$a.prototype.constructor=$a;$a.prototype.name="Validation Error";var zH=jr.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};zH.prototype=Object.create(Error.prototype,{constructor:{value:zH,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var ZO=jr.SchemaContext=function(e,r,n,i,o){this.schema=e,this.options=r,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce(function(s,a){return s+UH(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};ZO.prototype.resolve=function(e){return qH(this.base,e)};ZO.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=qH(this.base,i||"");var s=new ZO(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var Xn=jr.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(t){return typeof t=="string"&&parseFloat(t)===parseInt(t,10)&&!isNaN(t)},regex:function(t){var e=!0;try{new RegExp(t)}catch{e=!1}return e},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};Xn.regexp=Xn.regex;Xn.pattern=Xn.regex;Xn.ipv4=Xn["ip-address"];jr.isFormat=function(e,r,n){if(typeof e=="string"&&Xn[r]!==void 0){if(Xn[r]instanceof RegExp)return Xn[r].test(e);if(typeof Xn[r]=="function")return Xn[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var UH=jr.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};jr.deepCompareStrict=function t(e,r){if(typeof e!=typeof r)return!1;if(Array.isArray(e))return!Array.isArray(r)||e.length!==r.length?!1:e.every(function(o,s){return t(e[s],r[s])});if(typeof e=="object"){if(!e||!r)return e===r;var n=Object.keys(e),i=Object.keys(r);return n.length!==i.length?!1:n.every(function(o){return t(e[o],r[o])})}return e===r};function Kye(t,e,r,n){typeof r=="object"?e[n]=VO(t[n],r):t.indexOf(r)===-1&&e.push(r)}function Jye(t,e,r){e[r]=t[r]}function Yye(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=VO(t[n],e[n]):r[n]=e[n]}function VO(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(Kye.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(Jye.bind(null,t,n)),Object.keys(e).forEach(Yye.bind(null,t,e,n))),n}WO.exports.deepMerge=VO;jr.objectGetPath=function(e,r){for(var n=r.split("/").slice(1),i;typeof(i=n.shift())=="string";){var o=decodeURIComponent(i.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in e))return;e=e[o]}return e};function Xye(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}jr.encodePath=function(e){return e.map(Xye).join("")};jr.getDecimalPlaces=function(e){var r=0;if(isNaN(e))return r;typeof e!="number"&&(e=Number(e));var n=e.toString().split("e");if(n.length===2){if(n[1][0]!=="-")return r;r=Number(n[1].slice(1))}var i=n[0].split(".");return i.length===2&&(r+=i[1].length),r};jr.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var qH=jr.resolveUrl=function(e,r){let n=new URL(r,new URL(e,"resolve://"));if(n.protocol==="resolve:"){let{pathname:i,search:o,hash:s}=n;return i+o+s}return n.toString()}});var ZH=v((d7e,GH)=>{"use strict";var rn=is(),Le=rn.ValidatorResult,os=rn.SchemaError,KO={};KO.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var ze=KO.validators={};ze.type=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=Array.isArray(r.type)?r.type:[r.type];if(!s.some(this.testType.bind(this,e,r,n,i))){var a=s.map(function(c){if(c){var l=c.$id||c.id;return l?"<"+l+">":c+""}});o.addError({name:"type",argument:a,message:"is not of a type(s) "+a})}return o};function JO(t,e,r,n,i){var o=e.throwError,s=e.throwAll;e.throwError=!1,e.throwAll=!1;var a=this.validateSchema(t,i,e,r);return e.throwError=o,e.throwAll=s,!a.valid&&n instanceof Function&&n(a),a.valid}ze.anyOf=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=new Le(e,r,n,i);if(!Array.isArray(r.anyOf))throw new os("anyOf must be an array");if(!r.anyOf.some(JO.bind(this,e,n,i,function(c){s.importErrors(c)}))){var a=r.anyOf.map(function(c,l){var u=c.$id||c.id;return u?"<"+u+">":c.title&&JSON.stringify(c.title)||c.$ref&&"<"+c.$ref+">"||"[subschema "+l+"]"});n.nestedErrors&&o.importErrors(s),o.addError({name:"anyOf",argument:a,message:"is not any of "+a.join(",")})}return o};ze.allOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.allOf))throw new os("allOf must be an array");var o=new Le(e,r,n,i),s=this;return r.allOf.forEach(function(a,c){var l=s.validateSchema(e,a,n,i);if(!l.valid){var u=a.$id||a.id,d=u||a.title&&JSON.stringify(a.title)||a.$ref&&"<"+a.$ref+">"||"[subschema "+c+"]";o.addError({name:"allOf",argument:{id:d,length:l.errors.length,valid:l},message:"does not match allOf schema "+d+" with "+l.errors.length+" error[s]:"}),o.importErrors(l)}}),o};ze.oneOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.oneOf))throw new os("oneOf must be an array");var o=new Le(e,r,n,i),s=new Le(e,r,n,i),a=r.oneOf.filter(JO.bind(this,e,n,i,function(l){s.importErrors(l)})).length,c=r.oneOf.map(function(l,u){var d=l.$id||l.id;return d||l.title&&JSON.stringify(l.title)||l.$ref&&"<"+l.$ref+">"||"[subschema "+u+"]"});return a!==1&&(n.nestedErrors&&o.importErrors(s),o.addError({name:"oneOf",argument:c,message:"is not exactly one from "+c.join(",")})),o};ze.if=function(e,r,n,i){if(e===void 0)return null;if(!rn.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=JO.call(this,e,n,i,null,r.if),s=new Le(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!rn.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(e,r.then,n,i.makeChild(r.then)),s.importErrors(a)}else{if(r.else===void 0)return;if(!rn.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(e,r.else,n,i.makeChild(r.else)),s.importErrors(a)}return s};function YO(t,e){if(Object.hasOwnProperty.call(t,e))return t[e];if(e in t){for(;t=Object.getPrototypeOf(t);)if(Object.propertyIsEnumerable.call(t,e))return t[e]}}ze.propertyNames=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!rn.isSchema(s))throw new os('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(YO(e,a)!==void 0){var c=this.validateSchema(a,s,n,i.makeChild(s));o.importErrors(c)}return o}};ze.properties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.properties||{};for(var a in s){var c=s[a];if(c!==void 0){if(c===null)throw new os('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=YO(e,a),u=this.validateSchema(l,c,n,i.makeChild(c,a));u.instance!==o.instance[a]&&(o.instance[a]=u.instance),o.importErrors(u)}}return o}};function BH(t,e,r,n,i,o){if(this.types.object(t)&&!(e.properties&&e.properties[i]!==void 0))if(e.additionalProperties===!1)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var s=e.additionalProperties||{};typeof r.preValidateProperty=="function"&&r.preValidateProperty(t,i,s,r,n);var a=this.validateSchema(t[i],s,r,n.makeChild(s,i));a.instance!==o.instance[i]&&(o.instance[i]=a.instance),o.importErrors(a)}}ze.patternProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.patternProperties||{};for(var a in e){var c=!0;for(var l in s){var u=s[l];if(u!==void 0){if(u===null)throw new os('Unexpected null, expected schema in "patternProperties"');try{var d=new RegExp(l,"u")}catch{d=new RegExp(l)}if(d.test(a)){c=!1,typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,u,n,i);var f=this.validateSchema(e[a],u,n,i.makeChild(u,a));f.instance!==o.instance[a]&&(o.instance[a]=f.instance),o.importErrors(f)}}}c&&BH.call(this,e,r,n,i,a,o)}return o}};ze.additionalProperties=function(e,r,n,i){if(this.types.object(e)){if(r.patternProperties)return null;var o=new Le(e,r,n,i);for(var s in e)BH.call(this,e,r,n,i,s,o);return o}};ze.minProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=Object.keys(e);return s.length>=r.minProperties||o.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),o}};ze.maxProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=Object.keys(e);return s.length<=r.maxProperties||o.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),o}};ze.items=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.items!==void 0){var s=new Le(e,r,n,i);return e.every(function(a,c){if(Array.isArray(r.items))var l=r.items[c]===void 0?r.additionalItems:r.items[c];else var l=r.items;if(l===void 0)return!0;if(l===!1)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=o.validateSchema(a,l,n,i.makeChild(l,c));return u.instance!==s.instance[c]&&(s.instance[c]=u.instance),s.importErrors(u),!0}),s}};ze.contains=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.contains!==void 0){if(!rn.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new Le(e,r,n,i),a=e.some(function(c,l){var u=o.validateSchema(c,r.contains,n,i.makeChild(r.contains,l));return u.errors.length===0});return a===!1&&s.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),s}};ze.minimum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(e,r,n,i);return r.exclusiveMinimum&&r.exclusiveMinimum===!0?e>r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):e>=r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),o}};ze.maximum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(e,r,n,i);return r.exclusiveMaximum&&r.exclusiveMaximum===!0?er.exclusiveMinimum;return s||o.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),o}};ze.exclusiveMaximum=function(e,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(e)){var o=new Le(e,r,n,i),s=e=r.minLength||o.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),o}};ze.maxLength=function(e,r,n,i){if(this.types.string(e)){var o=new Le(e,r,n,i),s=e.match(/[\uDC00-\uDFFF]/g),a=e.length-(s?s.length:0);return a<=r.maxLength||o.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),o}};ze.minItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(e,r,n,i);return e.length>=r.minItems||o.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),o}};ze.maxItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(e,r,n,i);return e.length<=r.maxItems||o.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),o}};function Qye(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var XO=is();QO.exports.SchemaScanResult=VH;function VH(t,e){this.id=t,this.ref=e}QO.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=XO.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=XO.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!XO.deepCompareStrict(s[f],l))throw new Error("Schema <"+f+"> already exists with different definition");return s[f]}s[f]=l,f[f.length-1]=="#"&&(s[f.substring(0,f.length-1)]=l)}i(f+"/items",Array.isArray(l.items)?l.items:[l.items]),i(f+"/extends",Array.isArray(l.extends)?l.extends:[l.extends]),n(f+"/additionalItems",l.additionalItems),o(f+"/properties",l.properties),n(f+"/additionalProperties",l.additionalProperties),o(f+"/definitions",l.definitions),o(f+"/patternProperties",l.patternProperties),o(f+"/dependencies",l.dependencies),i(f+"/disallow",l.disallow),i(f+"/allOf",l.allOf),i(f+"/anyOf",l.anyOf),i(f+"/oneOf",l.oneOf),n(f+"/not",l.not)}function i(c,l){if(Array.isArray(l))for(var u=0;u{"use strict";var WH=ZH(),ss=is(),KH=L_().scan,JH=ss.ValidatorResult,e_e=ss.ValidatorResultError,Lf=ss.SchemaError,YH=ss.SchemaContext,t_e="/",Jt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(Ri),this.attributes=Object.create(WH.validators)};Jt.prototype.customFormats={};Jt.prototype.schemas=null;Jt.prototype.types=null;Jt.prototype.attributes=null;Jt.prototype.unresolvedRefs=null;Jt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=KH(r||t_e,e),o=r||e.$id||e.id;for(var s in i.id)this.schemas[s]=i.id[s];for(var s in i.ref)this.unresolvedRefs.push(s);return this.unresolvedRefs=this.unresolvedRefs.filter(function(a){return typeof n.schemas[a]>"u"}),this.schemas[o]};Jt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=ss.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new Lf("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Jt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new Lf('Unexpected null in "type" keyword');if(typeof this.types[o]=="function")return this.types[o].call(this,e);if(o&&typeof o=="object"){var s=this.validateSchema(e,o,n,i);return s===void 0||!(s&&s.errors.length)}return!0}};var Ri=Jt.prototype.types={};Ri.string=function(e){return typeof e=="string"};Ri.number=function(e){return typeof e=="number"&&isFinite(e)};Ri.integer=function(e){return typeof e=="number"&&e%1===0};Ri.boolean=function(e){return typeof e=="boolean"};Ri.array=function(e){return Array.isArray(e)};Ri.null=function(e){return e===null};Ri.date=function(e){return e instanceof Date};Ri.any=function(e){return!0};Ri.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};QH.exports=Jt});var tG=v((m7e,ho)=>{"use strict";var r_e=ho.exports.Validator=eG();ho.exports.ValidatorResult=is().ValidatorResult;ho.exports.ValidatorResultError=is().ValidatorResultError;ho.exports.ValidationError=is().ValidationError;ho.exports.SchemaError=is().SchemaError;ho.exports.SchemaScanResult=L_().SchemaScanResult;ho.exports.scan=L_().scan;ho.exports.validate=function(t,e,r){var n=new r_e;return n.validate(t,e,r)}});import{readFileSync as n_e}from"node:fs";import{dirname as i_e,join as o_e}from"node:path";import{fileURLToPath as s_e}from"node:url";function d_e(t){let e=u_e.validate(t,l_e);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function nG(t){let e=d_e(t);if(!e.valid)throw new Error(`spec.yaml invalid: ${e.errors.join(` - `)}`)}var YH,e_e,t_e,r_e,n_e,QH=y(()=>{"use strict";YH=St(JH(),1),e_e=Yye(Qye(import.meta.url)),t_e=Xye(e_e,"schema.json"),r_e=JSON.parse(Jye(t_e,"utf8")),n_e=new YH.Validator});import{existsSync as QO,readdirSync as o_e}from"node:fs";import{dirname as s_e,join as ka,resolve as tG}from"node:path";function eG(t){return QO(t)?o_e(t).filter(r=>r.endsWith(".yaml")||r.endsWith(".yml")).map(r=>Ai(ka(t,r))):[]}function Ea(t,e){L_=e?{cwd:tG(t),spec:e}:null}function H(t=".",e="spec.yaml"){return L_&&e==="spec.yaml"&&tG(t)===L_.cwd?L_.spec:a_e(t,e)}function a_e(t,e){let r=ka(t,e),n=Ai(r),i=ka(t,s_e(e),"spec");if(!n.features||n.features.length===0){let o=eG(ka(i,"features"));o.length>0&&(n.features=o)}if(!n.scenarios||n.scenarios.length===0){let o=eG(ka(i,"scenarios"));o.length>0&&(n.scenarios=o)}if(!n.architecture){let o=ka(i,"architecture.yaml");QO(o)&&(n.architecture=Ai(o))}if(!n.capabilities||n.capabilities.length===0){let o=ka(i,"capabilities.yaml");if(QO(o)){let s=Ai(o);s&&Array.isArray(s.capabilities)&&(n.capabilities=s.capabilities)}}return XH(n),n}var L_,Be=y(()=>{"use strict";j_();QH();L_=null});import ml from"node:process";function rR(){return!!ml.stdout.isTTY}function L(t,e,r=""){let n=rG[t],i=r?` ${r}`:"";rR()?ml.stdout.write(`${eR[t]}${n}${tR} ${e}${i} -`):ml.stdout.write(`${n} ${e}${i} -`)}function zf(t,e,r=""){if(!rR())return;let n=r?` ${r}`:"";ml.stdout.write(`${nG}${eR.start}\xB7${tR} ${t} \xB7 ${e}${n}`)}function Aa(t,e,r=""){let n=rG[t],i=r?` ${r}`:"";rR()?ml.stdout.write(`${nG}${eR[t]}${n}${tR} ${e}${i} -`):ml.stdout.write(`${n} ${e}${i} -`)}var rG,eR,tR,nG,Oi=y(()=>{"use strict";rG={start:"\xB7",pass:"\u2713",fail:"\u2717",skip:"\xB7",note:"\u2139"},eR={start:"\x1B[90m",pass:"\x1B[32m",fail:"\x1B[31m",skip:"\x1B[90m",note:"\x1B[36m"},tR="\x1B[0m",nG="\r\x1B[K"});import{createHash as $G}from"node:crypto";import{existsSync as L_e,readFileSync as oR,writeFileSync as z_e}from"node:fs";import{join as z_}from"node:path";function U_e(t,e){let r=$G("sha256");for(let n of[...e].sort()){r.update(n),r.update("\0");try{r.update(oR(z_(t,n)))}catch{r.update("")}r.update("\0")}return r.digest("hex").slice(0,16)}function EG(t,e){let r=$G("sha256");try{r.update(oR(z_(t,e)))}catch{r.update("")}return r.digest("hex").slice(0,16)}function as(t){let e=z_(t,...kG);if(!L_e(e))return null;let r;try{r=oR(e,"utf8")}catch{return null}let n=null,i=null,o=null,s="other";for(let a of r.split(` -`)){if(a==="attested:"){s="v1",n??=new Map;continue}if(a==="attested_modules:"){s="modules",i??=new Map;continue}if(a==="attested_features:"){s="features",o??=new Set;continue}if(!(a.startsWith("#")||a.trim()==="")){if(s==="v1"){let c=a.match(/^ {2}(F-[\w-]+): ([0-9a-f]{16})$/);c&&n.set(c[1],c[2])}else if(s==="modules"){let c=a.match(/^ {2}(.+): ([0-9a-f]{16})$/);c&&i.set(c[1],c[2])}else if(s==="features"){let c=a.match(/^ {2}(F-[\w-]+): ok$/);c&&o.add(c[1])}}}return{v1:n,modules:i,features:o}}function U_(t){return t.features?.size??t.v1?.size??0}function q_(t,e,r){let n=r.modules??[];if(t.modules!==null||t.features!==null){if(!t.features?.has(r.id))return{state:"unattested"};let o=t.modules??new Map;for(let s of[...n].sort())if(o.get(s)!==EG(e,s))return{state:"stale",module:s};return{state:"fresh"}}let i=t.v1?.get(r.id);return i===void 0?{state:"unattested"}:i===U_e(e,n)?{state:"fresh"}:{state:"stale"}}function AG(t,e){let r=(e.features??[]).filter(a=>a.status==="done"&&(a.modules??[]).length>0);if(r.length===0)return!1;let n=new Set;for(let a of r)for(let c of a.modules??[])n.add(c);let i=[...n].sort().map(a=>` ${a}: ${EG(t,a)}`),o=r.map(a=>` ${a.id}: ok`).sort(),s=q_e+`attested_modules: + `)}`)}var rG,a_e,c_e,l_e,u_e,iG=y(()=>{"use strict";rG=St(tG(),1),a_e=i_e(s_e(import.meta.url)),c_e=o_e(a_e,"schema.json"),l_e=JSON.parse(n_e(c_e,"utf8")),u_e=new rG.Validator});import{existsSync as eR,readdirSync as f_e}from"node:fs";import{dirname as p_e,join as ka,resolve as sG}from"node:path";function oG(t){return eR(t)?f_e(t).filter(r=>r.endsWith(".yaml")||r.endsWith(".yml")).map(r=>Oi(ka(t,r))):[]}function Ea(t,e){z_=e?{cwd:sG(t),spec:e}:null}function B(t=".",e="spec.yaml"){return z_&&e==="spec.yaml"&&sG(t)===z_.cwd?z_.spec:m_e(t,e)}function m_e(t,e){let r=ka(t,e),n=Oi(r),i=ka(t,p_e(e),"spec");if(!n.features||n.features.length===0){let o=oG(ka(i,"features"));o.length>0&&(n.features=o)}if(!n.scenarios||n.scenarios.length===0){let o=oG(ka(i,"scenarios"));o.length>0&&(n.scenarios=o)}if(!n.architecture){let o=ka(i,"architecture.yaml");eR(o)&&(n.architecture=Oi(o))}if(!n.capabilities||n.capabilities.length===0){let o=ka(i,"capabilities.yaml");if(eR(o)){let s=Oi(o);s&&Array.isArray(s.capabilities)&&(n.capabilities=s.capabilities)}}return nG(n),n}var z_,Ue=y(()=>{"use strict";M_();iG();z_=null});import yl from"node:process";function nR(){return!!yl.stdout.isTTY}function L(t,e,r=""){let n=aG[t],i=r?` ${r}`:"";nR()?yl.stdout.write(`${tR[t]}${n}${rR} ${e}${i} +`):yl.stdout.write(`${n} ${e}${i} +`)}function zf(t,e,r=""){if(!nR())return;let n=r?` ${r}`:"";yl.stdout.write(`${cG}${tR.start}\xB7${rR} ${t} \xB7 ${e}${n}`)}function Aa(t,e,r=""){let n=aG[t],i=r?` ${r}`:"";nR()?yl.stdout.write(`${cG}${tR[t]}${n}${rR} ${e}${i} +`):yl.stdout.write(`${n} ${e}${i} +`)}var aG,tR,rR,cG,Ii=y(()=>{"use strict";aG={start:"\xB7",pass:"\u2713",fail:"\u2717",skip:"\xB7",note:"\u2139"},tR={start:"\x1B[90m",pass:"\x1B[32m",fail:"\x1B[31m",skip:"\x1B[90m",note:"\x1B[36m"},rR="\x1B[0m",cG="\r\x1B[K"});import{createHash as OG}from"node:crypto";import{existsSync as Z_e,readFileSync as sR,writeFileSync as V_e}from"node:fs";import{join as U_}from"node:path";function W_e(t,e){let r=OG("sha256");for(let n of[...e].sort()){r.update(n),r.update("\0");try{r.update(sR(U_(t,n)))}catch{r.update("")}r.update("\0")}return r.digest("hex").slice(0,16)}function IG(t,e){let r=OG("sha256");try{r.update(sR(U_(t,e)))}catch{r.update("")}return r.digest("hex").slice(0,16)}function as(t){let e=U_(t,...RG);if(!Z_e(e))return null;let r;try{r=sR(e,"utf8")}catch{return null}let n=null,i=null,o=null,s="other";for(let a of r.split(` +`)){if(a==="attested:"){s="v1",n??=new Map;continue}if(a==="attested_modules:"){s="modules",i??=new Map;continue}if(a==="attested_features:"){s="features",o??=new Set;continue}if(!(a.startsWith("#")||a.trim()==="")){if(s==="v1"){let c=a.match(/^ {2}(F-[\w-]+): ([0-9a-f]{16})$/);c&&n.set(c[1],c[2])}else if(s==="modules"){let c=a.match(/^ {2}(.+): ([0-9a-f]{16})$/);c&&i.set(c[1],c[2])}else if(s==="features"){let c=a.match(/^ {2}(F-[\w-]+): ok$/);c&&o.add(c[1])}}}return{v1:n,modules:i,features:o}}function q_(t){return t.features?.size??t.v1?.size??0}function B_(t,e,r){let n=r.modules??[];if(t.modules!==null||t.features!==null){if(!t.features?.has(r.id))return{state:"unattested"};let o=t.modules??new Map;for(let s of[...n].sort())if(o.get(s)!==IG(e,s))return{state:"stale",module:s};return{state:"fresh"}}let i=t.v1?.get(r.id);return i===void 0?{state:"unattested"}:i===W_e(e,n)?{state:"fresh"}:{state:"stale"}}function PG(t,e){let r=(e.features??[]).filter(a=>a.status==="done"&&(a.modules??[]).length>0);if(r.length===0)return!1;let n=new Set;for(let a of r)for(let c of a.modules??[])n.add(c);let i=[...n].sort().map(a=>` ${a}: ${IG(t,a)}`),o=r.map(a=>` ${a.id}: ok`).sort(),s=K_e+`attested_modules: `+i.join(` `)+` attested_features: `+o.join(` `)+` -`;return z_e(z_(t,...kG),s,"utf8"),!0}var kG,q_e,gl=y(()=>{"use strict";kG=["spec","attestation.yaml"];q_e=`# Cladding \xB7 Tier C \u2014 verification attestation (v2). Written ONLY by a GREEN +`;return V_e(U_(t,...RG),s,"utf8"),!0}var RG,K_e,bl=y(()=>{"use strict";RG=["spec","attestation.yaml"];K_e=`# Cladding \xB7 Tier C \u2014 verification attestation (v2). Written ONLY by a GREEN # \`clad check --tier=pre-push --strict\` gate \u2014 the file's one honest author. # Do not edit by hand. # @@ -211,53 +211,53 @@ attested_features: # Merge conflict here? NEVER hand-resolve the hashes \u2014 keep either side and run # \`clad check --tier=pre-push --strict\`; the GREEN gate rewrites the truth. # Content-anchored: survives fresh clones and squash/rebase. -`});import{resolve as sR}from"node:path";function B_(t){cs={cwd:sR(t),results:new Map}}function TG(t,e,r){!cs||cs.cwd!==sR(e)||cs.results.set(t,r)}function H_(t,e){return!cs||cs.cwd!==sR(e)?null:cs.results.get(t)??null}function G_(){cs=null}var cs,yl=y(()=>{"use strict";cs=null});function Ot(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var go=y(()=>{});import{fileURLToPath as B_e}from"node:url";var _l,H_e,aR,cR,bl=y(()=>{_l=(t,e)=>{let r=cR(H_e(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},H_e=t=>aR(t)?t.toString():t,aR=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,cR=t=>t instanceof URL?B_e(t):t});var Z_,lR=y(()=>{go();bl();Z_=(t,e=[],r={})=>{let n=_l(t,"First argument"),[i,o]=Ot(e)?[[],e]:[e,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let s=i.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!Ot(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,s,o]}});import{StringDecoder as G_e}from"node:string_decoder";var OG,RG,Ut,yo,Z_e,IG,V_e,V_,PG,W_e,Bf,K_e,uR,J_e,rn=y(()=>{({toString:OG}=Object.prototype),RG=t=>OG.call(t)==="[object ArrayBuffer]",Ut=t=>OG.call(t)==="[object Uint8Array]",yo=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Z_e=new TextEncoder,IG=t=>Z_e.encode(t),V_e=new TextDecoder,V_=t=>V_e.decode(t),PG=(t,e)=>W_e(t,e).join(""),W_e=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new G_e(e),n=t.map(o=>typeof o=="string"?IG(o):o).map(o=>r.write(o)),i=r.end();return i===""?n:[...n,i]},Bf=t=>t.length===1&&Ut(t[0])?t[0]:uR(K_e(t)),K_e=t=>t.map(e=>typeof e=="string"?IG(e):e),uR=t=>{let e=new Uint8Array(J_e(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},J_e=t=>{let e=0;for(let r of t)e+=r.length;return e}});import{ChildProcess as Y_e}from"node:child_process";var jG,MG,X_e,Q_e,CG,ebe,DG,NG,tbe,FG=y(()=>{go();rn();jG=t=>Array.isArray(t)&&Array.isArray(t.raw),MG=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=X_e({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},X_e=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=Q_e(i,t.raw[n]),c=DG(r,o,s);if(n===e.length)return c;let l=e[n],u=Array.isArray(l)?l.map(d=>NG(d)):[NG(l)];return DG(c,u,a)},Q_e=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=CG.has(e[0]);for(let s=0,a=0;sr||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],NG=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(Ot(t)&&("stdout"in t||"isMaxBuffer"in t))return tbe(t);throw t instanceof Y_e||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},tbe=({stdout:t})=>{if(typeof t=="string")return t;if(Ut(t))return V_(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)}});import dR from"node:process";var Xn,W_,An,K_,_o=y(()=>{Xn=t=>W_.includes(t),W_=[dR.stdin,dR.stdout,dR.stderr],An=["stdin","stdout","stderr"],K_=t=>An[t]??`stdio[${t}]`});import{debuglog as rbe}from"node:util";var zG,fR,nbe,ibe,obe,sbe,LG,abe,pR,cbe,lbe,ube,dbe,mR,bo,vo=y(()=>{go();_o();zG=t=>{let e={...t};for(let r of mR)e[r]=fR(t,r);return e},fR=(t,e)=>{let r=Array.from({length:nbe(t)+1}),n=ibe(t[e],r,e);return lbe(n,e)},nbe=({stdio:t})=>Array.isArray(t)?Math.max(t.length,An.length):An.length,ibe=(t,e,r)=>Ot(t)?obe(t,e,r):e.fill(t),obe=(t,e,r)=>{for(let n of Object.keys(t).sort(sbe))for(let i of abe(n,r,e))e[i]=t[n];return e},sbe=(t,e)=>LG(t)t==="stdout"||t==="stderr"?0:t==="all"?2:1,abe=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=pR(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid. +`});import{resolve as aR}from"node:path";function H_(t){cs={cwd:aR(t),results:new Map}}function CG(t,e,r){!cs||cs.cwd!==aR(e)||cs.results.set(t,r)}function G_(t,e){return!cs||cs.cwd!==aR(e)?null:cs.results.get(t)??null}function Z_(){cs=null}var cs,vl=y(()=>{"use strict";cs=null});function Ot(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var yo=y(()=>{});import{fileURLToPath as J_e}from"node:url";var Sl,Y_e,cR,lR,wl=y(()=>{Sl=(t,e)=>{let r=lR(Y_e(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},Y_e=t=>cR(t)?t.toString():t,cR=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,lR=t=>t instanceof URL?J_e(t):t});var V_,uR=y(()=>{yo();wl();V_=(t,e=[],r={})=>{let n=Sl(t,"First argument"),[i,o]=Ot(e)?[[],e]:[e,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let s=i.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!Ot(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,s,o]}});import{StringDecoder as X_e}from"node:string_decoder";var DG,NG,qt,_o,Q_e,jG,ebe,W_,MG,tbe,Bf,rbe,dR,nbe,nn=y(()=>{({toString:DG}=Object.prototype),NG=t=>DG.call(t)==="[object ArrayBuffer]",qt=t=>DG.call(t)==="[object Uint8Array]",_o=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Q_e=new TextEncoder,jG=t=>Q_e.encode(t),ebe=new TextDecoder,W_=t=>ebe.decode(t),MG=(t,e)=>tbe(t,e).join(""),tbe=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new X_e(e),n=t.map(o=>typeof o=="string"?jG(o):o).map(o=>r.write(o)),i=r.end();return i===""?n:[...n,i]},Bf=t=>t.length===1&&qt(t[0])?t[0]:dR(rbe(t)),rbe=t=>t.map(e=>typeof e=="string"?jG(e):e),dR=t=>{let e=new Uint8Array(nbe(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},nbe=t=>{let e=0;for(let r of t)e+=r.length;return e}});import{ChildProcess as ibe}from"node:child_process";var UG,qG,obe,sbe,FG,abe,LG,zG,cbe,BG=y(()=>{yo();nn();UG=t=>Array.isArray(t)&&Array.isArray(t.raw),qG=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=obe({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},obe=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=sbe(i,t.raw[n]),c=LG(r,o,s);if(n===e.length)return c;let l=e[n],u=Array.isArray(l)?l.map(d=>zG(d)):[zG(l)];return LG(c,u,a)},sbe=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=FG.has(e[0]);for(let s=0,a=0;sr||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],zG=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(Ot(t)&&("stdout"in t||"isMaxBuffer"in t))return cbe(t);throw t instanceof ibe||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},cbe=({stdout:t})=>{if(typeof t=="string")return t;if(qt(t))return W_(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)}});import fR from"node:process";var Qn,K_,Tn,J_,bo=y(()=>{Qn=t=>K_.includes(t),K_=[fR.stdin,fR.stdout,fR.stderr],Tn=["stdin","stdout","stderr"],J_=t=>Tn[t]??`stdio[${t}]`});import{debuglog as lbe}from"node:util";var GG,pR,ube,dbe,fbe,pbe,HG,mbe,mR,hbe,gbe,ybe,_be,hR,vo,So=y(()=>{yo();bo();GG=t=>{let e={...t};for(let r of hR)e[r]=pR(t,r);return e},pR=(t,e)=>{let r=Array.from({length:ube(t)+1}),n=dbe(t[e],r,e);return gbe(n,e)},ube=({stdio:t})=>Array.isArray(t)?Math.max(t.length,Tn.length):Tn.length,dbe=(t,e,r)=>Ot(t)?fbe(t,e,r):e.fill(t),fbe=(t,e,r)=>{for(let n of Object.keys(t).sort(pbe))for(let i of mbe(n,r,e))e[i]=t[n];return e},pbe=(t,e)=>HG(t)t==="stdout"||t==="stderr"?0:t==="all"?2:1,mbe=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=mR(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid. It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist. -Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},pR=t=>{if(t==="all")return t;if(An.includes(t))return An.indexOf(t);let e=cbe.exec(t);if(e!==null)return Number(e[1])},cbe=/^fd(\d+)$/,lbe=(t,e)=>t.map(r=>r===void 0?dbe[e]:r),ube=rbe("execa").enabled?"full":"none",dbe={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:ube,stripFinalNewline:!0},mR=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],bo=(t,e)=>e==="ipc"?t.at(-1):t[e]});var vl,Sl,UG,hR,fbe,J_,Y_,ls=y(()=>{vo();vl=({verbose:t},e)=>hR(t,e)!=="none",Sl=({verbose:t},e)=>!["none","short"].includes(hR(t,e)),UG=({verbose:t},e)=>{let r=hR(t,e);return J_(r)?r:void 0},hR=(t,e)=>e===void 0?fbe(t):bo(t,e),fbe=t=>t.find(e=>J_(e))??Y_.findLast(e=>t.includes(e)),J_=t=>typeof t=="function",Y_=["none","short","full"]});import{platform as pbe}from"node:process";import{stripVTControlCharacters as mbe}from"node:util";var qG,Hf,BG,hbe,gbe,ybe,_be,bbe,vbe,Sbe,X_=y(()=>{qG=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>vbe(BG(o))).join(" ");return{command:n,escapedCommand:i}},Hf=t=>mbe(t).split(` -`).map(e=>BG(e)).join(` -`),BG=t=>t.replaceAll(ybe,e=>hbe(e)),hbe=t=>{let e=_be[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=bbe?`\\u${n.padStart(4,"0")}`:`\\U${n}`},gbe=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},ybe=gbe(),_be={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},bbe=65535,vbe=t=>Sbe.test(t)?t:pbe==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,Sbe=/^[\w./-]+$/});import HG from"node:process";function gR(){let{env:t}=HG,{TERM:e,TERM_PROGRAM:r}=t;return HG.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var GG=y(()=>{});var ZG,VG,wbe,xbe,$be,kbe,Ebe,Q_,eQe,WG=y(()=>{GG();ZG={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},VG={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},wbe={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},xbe={...ZG,...VG},$be={...ZG,...wbe},kbe=gR(),Ebe=kbe?xbe:$be,Q_=Ebe,eQe=Object.entries(VG)});import Abe from"node:tty";var Tbe,be,nQe,KG,iQe,oQe,sQe,aQe,cQe,lQe,uQe,dQe,fQe,pQe,mQe,hQe,gQe,yQe,_Qe,eb,bQe,vQe,SQe,wQe,xQe,$Qe,kQe,EQe,AQe,JG,TQe,YG,OQe,RQe,IQe,PQe,CQe,DQe,NQe,jQe,MQe,FQe,LQe,yR=y(()=>{Tbe=Abe?.WriteStream?.prototype?.hasColors?.()??!1,be=(t,e)=>{if(!Tbe)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,c=0,u=(e===22?n:"")+r;for(;s!==-1;)a+=o.slice(c,s)+u,c=s+n.length,s=o.indexOf(n,c);return a+=o.slice(c)+n,a}},nQe=be(0,0),KG=be(1,22),iQe=be(2,22),oQe=be(3,23),sQe=be(4,24),aQe=be(53,55),cQe=be(7,27),lQe=be(8,28),uQe=be(9,29),dQe=be(30,39),fQe=be(31,39),pQe=be(32,39),mQe=be(33,39),hQe=be(34,39),gQe=be(35,39),yQe=be(36,39),_Qe=be(37,39),eb=be(90,39),bQe=be(40,49),vQe=be(41,49),SQe=be(42,49),wQe=be(43,49),xQe=be(44,49),$Qe=be(45,49),kQe=be(46,49),EQe=be(47,49),AQe=be(100,49),JG=be(91,39),TQe=be(92,39),YG=be(93,39),OQe=be(94,39),RQe=be(95,39),IQe=be(96,39),PQe=be(97,39),CQe=be(101,49),DQe=be(102,49),NQe=be(103,49),jQe=be(104,49),MQe=be(105,49),FQe=be(106,49),LQe=be(107,49)});var XG=y(()=>{yR();yR()});var tZ,Rbe,tb,QG,Ibe,eZ,Pbe,rZ=y(()=>{WG();XG();tZ=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=Rbe(r),c=Ibe[t]({failed:o,reject:s,piped:n}),l=Pbe[t]({reject:s});return`${eb(`[${a}]`)} ${eb(`[${i}]`)} ${l(c)} ${l(e)}`},Rbe=t=>`${tb(t.getHours(),2)}:${tb(t.getMinutes(),2)}:${tb(t.getSeconds(),2)}.${tb(t.getMilliseconds(),3)}`,tb=(t,e)=>String(t).padStart(e,"0"),QG=({failed:t,reject:e})=>t?e?Q_.cross:Q_.warning:Q_.tick,Ibe={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:QG,duration:QG},eZ=t=>t,Pbe={command:()=>KG,output:()=>eZ,ipc:()=>eZ,error:({reject:t})=>t?JG:YG,duration:()=>eb}});var nZ,Cbe,Dbe,iZ=y(()=>{ls();nZ=(t,e,r)=>{let n=UG(e,r);return t.map(({verboseLine:i,verboseObject:o})=>Cbe(i,o,n)).filter(i=>i!==void 0).map(i=>Dbe(i)).join("")},Cbe=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},Dbe=t=>t.endsWith(` +Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},mR=t=>{if(t==="all")return t;if(Tn.includes(t))return Tn.indexOf(t);let e=hbe.exec(t);if(e!==null)return Number(e[1])},hbe=/^fd(\d+)$/,gbe=(t,e)=>t.map(r=>r===void 0?_be[e]:r),ybe=lbe("execa").enabled?"full":"none",_be={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:ybe,stripFinalNewline:!0},hR=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],vo=(t,e)=>e==="ipc"?t.at(-1):t[e]});var xl,$l,ZG,gR,bbe,Y_,X_,ls=y(()=>{So();xl=({verbose:t},e)=>gR(t,e)!=="none",$l=({verbose:t},e)=>!["none","short"].includes(gR(t,e)),ZG=({verbose:t},e)=>{let r=gR(t,e);return Y_(r)?r:void 0},gR=(t,e)=>e===void 0?bbe(t):vo(t,e),bbe=t=>t.find(e=>Y_(e))??X_.findLast(e=>t.includes(e)),Y_=t=>typeof t=="function",X_=["none","short","full"]});import{platform as vbe}from"node:process";import{stripVTControlCharacters as Sbe}from"node:util";var VG,Hf,WG,wbe,xbe,$be,kbe,Ebe,Abe,Tbe,Q_=y(()=>{VG=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>Abe(WG(o))).join(" ");return{command:n,escapedCommand:i}},Hf=t=>Sbe(t).split(` +`).map(e=>WG(e)).join(` +`),WG=t=>t.replaceAll($be,e=>wbe(e)),wbe=t=>{let e=kbe[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=Ebe?`\\u${n.padStart(4,"0")}`:`\\U${n}`},xbe=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},$be=xbe(),kbe={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Ebe=65535,Abe=t=>Tbe.test(t)?t:vbe==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,Tbe=/^[\w./-]+$/});import KG from"node:process";function yR(){let{env:t}=KG,{TERM:e,TERM_PROGRAM:r}=t;return KG.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var JG=y(()=>{});var YG,XG,Obe,Rbe,Ibe,Pbe,Cbe,eb,_Qe,QG=y(()=>{JG();YG={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},XG={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Obe={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Rbe={...YG,...XG},Ibe={...YG,...Obe},Pbe=yR(),Cbe=Pbe?Rbe:Ibe,eb=Cbe,_Qe=Object.entries(XG)});import Dbe from"node:tty";var Nbe,be,SQe,eZ,wQe,xQe,$Qe,kQe,EQe,AQe,TQe,OQe,RQe,IQe,PQe,CQe,DQe,NQe,jQe,tb,MQe,FQe,LQe,zQe,UQe,qQe,BQe,HQe,GQe,tZ,ZQe,rZ,VQe,WQe,KQe,JQe,YQe,XQe,QQe,eet,tet,ret,net,_R=y(()=>{Nbe=Dbe?.WriteStream?.prototype?.hasColors?.()??!1,be=(t,e)=>{if(!Nbe)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,c=0,u=(e===22?n:"")+r;for(;s!==-1;)a+=o.slice(c,s)+u,c=s+n.length,s=o.indexOf(n,c);return a+=o.slice(c)+n,a}},SQe=be(0,0),eZ=be(1,22),wQe=be(2,22),xQe=be(3,23),$Qe=be(4,24),kQe=be(53,55),EQe=be(7,27),AQe=be(8,28),TQe=be(9,29),OQe=be(30,39),RQe=be(31,39),IQe=be(32,39),PQe=be(33,39),CQe=be(34,39),DQe=be(35,39),NQe=be(36,39),jQe=be(37,39),tb=be(90,39),MQe=be(40,49),FQe=be(41,49),LQe=be(42,49),zQe=be(43,49),UQe=be(44,49),qQe=be(45,49),BQe=be(46,49),HQe=be(47,49),GQe=be(100,49),tZ=be(91,39),ZQe=be(92,39),rZ=be(93,39),VQe=be(94,39),WQe=be(95,39),KQe=be(96,39),JQe=be(97,39),YQe=be(101,49),XQe=be(102,49),QQe=be(103,49),eet=be(104,49),tet=be(105,49),ret=be(106,49),net=be(107,49)});var nZ=y(()=>{_R();_R()});var sZ,Mbe,rb,iZ,Fbe,oZ,Lbe,aZ=y(()=>{QG();nZ();sZ=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=Mbe(r),c=Fbe[t]({failed:o,reject:s,piped:n}),l=Lbe[t]({reject:s});return`${tb(`[${a}]`)} ${tb(`[${i}]`)} ${l(c)} ${l(e)}`},Mbe=t=>`${rb(t.getHours(),2)}:${rb(t.getMinutes(),2)}:${rb(t.getSeconds(),2)}.${rb(t.getMilliseconds(),3)}`,rb=(t,e)=>String(t).padStart(e,"0"),iZ=({failed:t,reject:e})=>t?e?eb.cross:eb.warning:eb.tick,Fbe={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:iZ,duration:iZ},oZ=t=>t,Lbe={command:()=>eZ,output:()=>oZ,ipc:()=>oZ,error:({reject:t})=>t?tZ:rZ,duration:()=>tb}});var cZ,zbe,Ube,lZ=y(()=>{ls();cZ=(t,e,r)=>{let n=ZG(e,r);return t.map(({verboseLine:i,verboseObject:o})=>zbe(i,o,n)).filter(i=>i!==void 0).map(i=>Ube(i)).join("")},zbe=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},Ube=t=>t.endsWith(` `)?t:`${t} -`});import{inspect as Nbe}from"node:util";var Ri,jbe,Mbe,Fbe,rb,Lbe,wl=y(()=>{X_();rZ();iZ();Ri=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=jbe({type:t,result:i,verboseInfo:n}),s=Mbe(e,o),a=nZ(s,n,r);a!==""&&console.warn(a.slice(0,-1))},jbe=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:e,options:o}),Mbe=(t,e)=>t.split(` -`).map(r=>Fbe({...e,message:r})),Fbe=t=>({verboseLine:tZ(t),verboseObject:t}),rb=t=>{let e=typeof t=="string"?t:Nbe(t);return Hf(e).replaceAll(" "," ".repeat(Lbe))},Lbe=2});var oZ,sZ=y(()=>{ls();wl();oZ=(t,e)=>{vl(e)&&Ri({type:"command",verboseMessage:t,verboseInfo:e})}});var aZ,zbe,Ube,qbe,cZ=y(()=>{ls();aZ=(t,e,r)=>{qbe(t);let n=zbe(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},zbe=t=>vl({verbose:t})?Ube++:void 0,Ube=0n,qbe=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Y_.includes(e)&&!J_(e)){let r=Y_.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as lZ}from"node:process";var nb,_R,ib=y(()=>{nb=()=>lZ.bigint(),_R=t=>Number(lZ.bigint()-t)/1e6});var ob,bR=y(()=>{sZ();cZ();ib();X_();vo();ob=(t,e,r)=>{let n=nb(),{command:i,escapedCommand:o}=qG(t,e),s=fR(r,"verbose"),a=aZ(s,o,{...r});return oZ(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var mZ=v((fet,pZ)=>{pZ.exports=fZ;fZ.sync=Hbe;var uZ=Ge("fs");function Bbe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{_Z.exports=gZ;gZ.sync=Gbe;var hZ=Ge("fs");function gZ(t,e,r){hZ.stat(t,function(n,i){r(n,n?!1:yZ(i,e))})}function Gbe(t,e){return yZ(hZ.statSync(t),e)}function yZ(t,e){return t.isFile()&&Zbe(t,e)}function Zbe(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===s||r&a&&n===o||r&u&&o===0;return d}});var SZ=v((het,vZ)=>{var met=Ge("fs"),sb;process.platform==="win32"||global.TESTING_WINDOWS?sb=mZ():sb=bZ();vZ.exports=vR;vR.sync=Vbe;function vR(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){vR(t,e||{},function(o,s){o?i(o):n(s)})})}sb(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function Vbe(t,e){try{return sb.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var TZ=v((get,AZ)=>{var xl=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",wZ=Ge("path"),Wbe=xl?";":":",xZ=SZ(),$Z=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),kZ=(t,e)=>{let r=e.colon||Wbe,n=t.match(/\//)||xl&&t.match(/\\/)?[""]:[...xl?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=xl?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=xl?i.split(r):[""];return xl&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},EZ=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=kZ(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d($Z(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=wZ.join(p,t),h=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;u(c(h,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let m=i[d];xZ(l+m,{pathExt:o},(h,g)=>{if(!h&&g)if(e.all)s.push(l+m);else return f(l+m);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},Kbe=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=kZ(t,e),o=[];for(let s=0;s{"use strict";var OZ=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};SR.exports=OZ;SR.exports.default=OZ});var DZ=v((_et,CZ)=>{"use strict";var IZ=Ge("path"),Jbe=TZ(),Ybe=RZ();function PZ(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=Jbe.sync(t.command,{path:r[Ybe({env:r})],pathExt:e?IZ.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=IZ.resolve(i?t.options.cwd:"",s)),s}function Xbe(t){return PZ(t)||PZ(t,!0)}CZ.exports=Xbe});var NZ=v((bet,xR)=>{"use strict";var wR=/([()\][%!^"`<>&|;, *?])/g;function Qbe(t){return t=t.replace(wR,"^$1"),t}function eve(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(wR,"^$1"),e&&(t=t.replace(wR,"^$1")),t}xR.exports.command=Qbe;xR.exports.argument=eve});var MZ=v((vet,jZ)=>{"use strict";jZ.exports=/^#!(.*)/});var LZ=v((wet,FZ)=>{"use strict";var tve=MZ();FZ.exports=(t="")=>{let e=t.match(tve);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var UZ=v((xet,zZ)=>{"use strict";var $R=Ge("fs"),rve=LZ();function nve(t){let r=Buffer.alloc(150),n;try{n=$R.openSync(t,"r"),$R.readSync(n,r,0,150,0),$R.closeSync(n)}catch{}return rve(r.toString())}zZ.exports=nve});var GZ=v(($et,HZ)=>{"use strict";var ive=Ge("path"),qZ=DZ(),BZ=NZ(),ove=UZ(),sve=process.platform==="win32",ave=/\.(?:com|exe)$/i,cve=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function lve(t){t.file=qZ(t);let e=t.file&&ove(t.file);return e?(t.args.unshift(t.file),t.command=e,qZ(t)):t.file}function uve(t){if(!sve)return t;let e=lve(t),r=!ave.test(e);if(t.options.forceShell||r){let n=cve.test(e);t.command=ive.normalize(t.command),t.command=BZ.command(t.command),t.args=t.args.map(o=>BZ.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function dve(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:uve(n)}HZ.exports=dve});var WZ=v((ket,VZ)=>{"use strict";var kR=process.platform==="win32";function ER(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function fve(t,e){if(!kR)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=ZZ(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function ZZ(t,e){return kR&&t===1&&!e.file?ER(e.original,"spawn"):null}function pve(t,e){return kR&&t===1&&!e.file?ER(e.original,"spawnSync"):null}VZ.exports={hookChildProcess:fve,verifyENOENT:ZZ,verifyENOENTSync:pve,notFoundError:ER}});var YZ=v((Eet,$l)=>{"use strict";var KZ=Ge("child_process"),AR=GZ(),TR=WZ();function JZ(t,e,r){let n=AR(t,e,r),i=KZ.spawn(n.command,n.args,n.options);return TR.hookChildProcess(i,n),i}function mve(t,e,r){let n=AR(t,e,r),i=KZ.spawnSync(n.command,n.args,n.options);return i.error=i.error||TR.verifyENOENTSync(i.status,n),i}$l.exports=JZ;$l.exports.spawn=JZ;$l.exports.sync=mve;$l.exports._parse=AR;$l.exports._enoent=TR});function ab(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}var XZ=y(()=>{});var QZ=y(()=>{});import{promisify as hve}from"node:util";import{execFile as gve,execFileSync as Iet}from"node:child_process";import e9 from"node:path";import{fileURLToPath as yve}from"node:url";function cb(t){return t instanceof URL?yve(t):t}function t9(t){return{*[Symbol.iterator](){let e=e9.resolve(cb(t)),r;for(;r!==e;)yield e,r=e,e=e9.resolve(e,"..")}}}var Det,Net,r9=y(()=>{QZ();Det=hve(gve);Net=10*1024*1024});import lb from"node:process";import Oa from"node:path";var _ve,bve,vve,n9,i9=y(()=>{XZ();r9();_ve=({cwd:t=lb.cwd(),path:e=lb.env[ab()],preferLocal:r=!0,execPath:n=lb.execPath,addExecPath:i=!0}={})=>{let o=Oa.resolve(cb(t)),s=[],a=e.split(Oa.delimiter);return r&&bve(s,a,o),i&&vve(s,a,n,o),e===""||e===Oa.delimiter?`${s.join(Oa.delimiter)}${e}`:[...s,e].join(Oa.delimiter)},bve=(t,e,r)=>{for(let n of t9(r)){let i=Oa.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},vve=(t,e,r,n)=>{let i=Oa.resolve(n,cb(r),"..");e.includes(i)||t.push(i)},n9=({env:t=lb.env,...e}={})=>{t={...t};let r=ab({env:t});return e.path=t[r],t[r]=_ve(e),t}});var o9,Qn,s9,a9,c9,ub,Gf,Zf,Ra=y(()=>{o9=(t,e,r)=>{let n=r?Zf:Gf,i=t instanceof Qn?{}:{cause:t};return new n(e,i)},Qn=class extends Error{},s9=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,c9,{value:!0,writable:!1,enumerable:!1,configurable:!1})},a9=t=>ub(t)&&c9 in t,c9=Symbol("isExecaError"),ub=t=>Object.prototype.toString.call(t)==="[object Error]",Gf=class extends Error{};s9(Gf,Gf.name);Zf=class extends Error{};s9(Zf,Zf.name)});var l9,Sve,u9,d9,f9=y(()=>{l9=()=>{let t=d9-u9+1;return Array.from({length:t},Sve)},Sve=(t,e)=>({name:`SIGRT${e+1}`,number:u9+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),u9=34,d9=64});var p9,m9=y(()=>{p9=[{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:!0},{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:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{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"}]});import{constants as wve}from"node:os";var OR,xve,h9=y(()=>{m9();f9();OR=()=>{let t=l9();return[...p9,...t].map(xve)},xve=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=wve,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as $ve}from"node:os";var kve,Eve,g9,Ave,Tve,Ove,Xet,y9=y(()=>{h9();kve=()=>{let t=OR();return Object.fromEntries(t.map(Eve))},Eve=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],g9=kve(),Ave=()=>{let t=OR(),e=65,r=Array.from({length:e},(n,i)=>Tve(i,t));return Object.assign({},...r)},Tve=(t,e)=>{let r=Ove(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:c}}},Ove=(t,e)=>{let r=e.find(({name:n})=>$ve.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},Xet=Ave()});import{constants as Vf}from"node:os";var b9,v9,S9,Rve,Ive,_9,Pve,RR,Cve,Dve,db,Wf=y(()=>{y9();b9=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return S9(t,e)},v9=t=>t===0?t:S9(t,"`subprocess.kill()`'s argument"),S9=(t,e)=>{if(Number.isInteger(t))return Rve(t,e);if(typeof t=="string")return Pve(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. -${RR()}`)},Rve=(t,e)=>{if(_9.has(t))return _9.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist. -${RR()}`)},Ive=()=>new Map(Object.entries(Vf.signals).reverse().map(([t,e])=>[e,t])),_9=Ive(),Pve=(t,e)=>{if(t in Vf.signals)return t;throw t.toUpperCase()in Vf.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist. -${RR()}`)},RR=()=>`Available signal names: ${Cve()}. -Available signal numbers: ${Dve()}.`,Cve=()=>Object.keys(Vf.signals).sort().map(t=>`'${t}'`).join(", "),Dve=()=>[...new Set(Object.values(Vf.signals).sort((t,e)=>t-e))].join(", "),db=t=>g9[t].description});import{setTimeout as Nve}from"node:timers/promises";var w9,jve,x9,Mve,Fve,Lve,IR,fb=y(()=>{Ra();Wf();w9=t=>{if(t===!1)return t;if(t===!0)return jve;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},jve=1e3*5,x9=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:i,controller:o},s,a)=>{let{signal:c,error:l}=Mve(s,a,r);Fve(l,n);let u=t(c);return Lve({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:u,context:i,controller:o}),u},Mve=(t,e,r)=>{let[n=r,i]=ub(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(i!==void 0&&!ub(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:v9(n),error:i}},Fve=(t,e)=>{t!==void 0&&e.reject(t)},Lve=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:s})=>{e===n&&i&&IR({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal})},IR=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await Nve(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}}});import{once as zve}from"node:events";var pb,PR=y(()=>{pb=async(t,e)=>{t.aborted||await zve(t,"abort",{signal:e})}});var $9,k9,Uve,CR=y(()=>{PR();$9=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},k9=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:i})=>e===void 0||r?[]:[Uve(t,e,n,i)],Uve=async(t,e,r,{signal:n})=>{throw await pb(e,n),r.terminationReason??="cancel",t.kill(),e.reason}});var kl,qve,DR,E9,A9,mb,T9,O9,R9,I9,P9,C9,Bve,Hve,Gve,ei,Zve,us,El,Al=y(()=>{kl=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{qve(t,e,r),DR(t,e,n)},qve=(t,e,r)=>{if(!r)throw new Error(`${ei(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},DR=(t,e,r)=>{if(!r)throw new Error(`${ei(t,e)} cannot be used: the ${us(e)} has already exited or disconnected.`)},E9=t=>{throw new Error(`${ei("getOneMessage",t)} could not complete: the ${us(t)} exited or disconnected.`)},A9=t=>{throw new Error(`${ei("sendMessage",t)} failed: the ${us(t)} is sending a message too, instead of listening to incoming messages. +`});import{inspect as qbe}from"node:util";var Pi,Bbe,Hbe,Gbe,nb,Zbe,kl=y(()=>{Q_();aZ();lZ();Pi=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=Bbe({type:t,result:i,verboseInfo:n}),s=Hbe(e,o),a=cZ(s,n,r);a!==""&&console.warn(a.slice(0,-1))},Bbe=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:e,options:o}),Hbe=(t,e)=>t.split(` +`).map(r=>Gbe({...e,message:r})),Gbe=t=>({verboseLine:sZ(t),verboseObject:t}),nb=t=>{let e=typeof t=="string"?t:qbe(t);return Hf(e).replaceAll(" "," ".repeat(Zbe))},Zbe=2});var uZ,dZ=y(()=>{ls();kl();uZ=(t,e)=>{xl(e)&&Pi({type:"command",verboseMessage:t,verboseInfo:e})}});var fZ,Vbe,Wbe,Kbe,pZ=y(()=>{ls();fZ=(t,e,r)=>{Kbe(t);let n=Vbe(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},Vbe=t=>xl({verbose:t})?Wbe++:void 0,Wbe=0n,Kbe=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!X_.includes(e)&&!Y_(e)){let r=X_.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as mZ}from"node:process";var ib,bR,ob=y(()=>{ib=()=>mZ.bigint(),bR=t=>Number(mZ.bigint()-t)/1e6});var sb,vR=y(()=>{dZ();pZ();ob();Q_();So();sb=(t,e,r)=>{let n=ib(),{command:i,escapedCommand:o}=VG(t,e),s=pR(r,"verbose"),a=fZ(s,o,{...r});return uZ(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var bZ=v((Iet,_Z)=>{_Z.exports=yZ;yZ.sync=Ybe;var hZ=Ge("fs");function Jbe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{xZ.exports=SZ;SZ.sync=Xbe;var vZ=Ge("fs");function SZ(t,e,r){vZ.stat(t,function(n,i){r(n,n?!1:wZ(i,e))})}function Xbe(t,e){return wZ(vZ.statSync(t),e)}function wZ(t,e){return t.isFile()&&Qbe(t,e)}function Qbe(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===s||r&a&&n===o||r&u&&o===0;return d}});var EZ=v((Det,kZ)=>{var Cet=Ge("fs"),ab;process.platform==="win32"||global.TESTING_WINDOWS?ab=bZ():ab=$Z();kZ.exports=SR;SR.sync=eve;function SR(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){SR(t,e||{},function(o,s){o?i(o):n(s)})})}ab(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function eve(t,e){try{return ab.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var CZ=v((Net,PZ)=>{var El=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",AZ=Ge("path"),tve=El?";":":",TZ=EZ(),OZ=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),RZ=(t,e)=>{let r=e.colon||tve,n=t.match(/\//)||El&&t.match(/\\/)?[""]:[...El?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=El?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=El?i.split(r):[""];return El&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},IZ=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=RZ(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(OZ(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=AZ.join(p,t),h=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;u(c(h,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let m=i[d];TZ(l+m,{pathExt:o},(h,g)=>{if(!h&&g)if(e.all)s.push(l+m);else return f(l+m);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},rve=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=RZ(t,e),o=[];for(let s=0;s{"use strict";var DZ=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};wR.exports=DZ;wR.exports.default=DZ});var LZ=v((Met,FZ)=>{"use strict";var jZ=Ge("path"),nve=CZ(),ive=NZ();function MZ(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=nve.sync(t.command,{path:r[ive({env:r})],pathExt:e?jZ.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=jZ.resolve(i?t.options.cwd:"",s)),s}function ove(t){return MZ(t)||MZ(t,!0)}FZ.exports=ove});var zZ=v((Fet,$R)=>{"use strict";var xR=/([()\][%!^"`<>&|;, *?])/g;function sve(t){return t=t.replace(xR,"^$1"),t}function ave(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(xR,"^$1"),e&&(t=t.replace(xR,"^$1")),t}$R.exports.command=sve;$R.exports.argument=ave});var qZ=v((Let,UZ)=>{"use strict";UZ.exports=/^#!(.*)/});var HZ=v((zet,BZ)=>{"use strict";var cve=qZ();BZ.exports=(t="")=>{let e=t.match(cve);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var ZZ=v((Uet,GZ)=>{"use strict";var kR=Ge("fs"),lve=HZ();function uve(t){let r=Buffer.alloc(150),n;try{n=kR.openSync(t,"r"),kR.readSync(n,r,0,150,0),kR.closeSync(n)}catch{}return lve(r.toString())}GZ.exports=uve});var JZ=v((qet,KZ)=>{"use strict";var dve=Ge("path"),VZ=LZ(),WZ=zZ(),fve=ZZ(),pve=process.platform==="win32",mve=/\.(?:com|exe)$/i,hve=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function gve(t){t.file=VZ(t);let e=t.file&&fve(t.file);return e?(t.args.unshift(t.file),t.command=e,VZ(t)):t.file}function yve(t){if(!pve)return t;let e=gve(t),r=!mve.test(e);if(t.options.forceShell||r){let n=hve.test(e);t.command=dve.normalize(t.command),t.command=WZ.command(t.command),t.args=t.args.map(o=>WZ.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function _ve(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:yve(n)}KZ.exports=_ve});var QZ=v((Bet,XZ)=>{"use strict";var ER=process.platform==="win32";function AR(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function bve(t,e){if(!ER)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=YZ(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function YZ(t,e){return ER&&t===1&&!e.file?AR(e.original,"spawn"):null}function vve(t,e){return ER&&t===1&&!e.file?AR(e.original,"spawnSync"):null}XZ.exports={hookChildProcess:bve,verifyENOENT:YZ,verifyENOENTSync:vve,notFoundError:AR}});var r9=v((Het,Al)=>{"use strict";var e9=Ge("child_process"),TR=JZ(),OR=QZ();function t9(t,e,r){let n=TR(t,e,r),i=e9.spawn(n.command,n.args,n.options);return OR.hookChildProcess(i,n),i}function Sve(t,e,r){let n=TR(t,e,r),i=e9.spawnSync(n.command,n.args,n.options);return i.error=i.error||OR.verifyENOENTSync(i.status,n),i}Al.exports=t9;Al.exports.spawn=t9;Al.exports.sync=Sve;Al.exports._parse=TR;Al.exports._enoent=OR});function cb(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}var n9=y(()=>{});var i9=y(()=>{});import{promisify as wve}from"node:util";import{execFile as xve,execFileSync as Ket}from"node:child_process";import o9 from"node:path";import{fileURLToPath as $ve}from"node:url";function lb(t){return t instanceof URL?$ve(t):t}function s9(t){return{*[Symbol.iterator](){let e=o9.resolve(lb(t)),r;for(;r!==e;)yield e,r=e,e=o9.resolve(e,"..")}}}var Xet,Qet,a9=y(()=>{i9();Xet=wve(xve);Qet=10*1024*1024});import ub from"node:process";import Oa from"node:path";var kve,Eve,Ave,c9,l9=y(()=>{n9();a9();kve=({cwd:t=ub.cwd(),path:e=ub.env[cb()],preferLocal:r=!0,execPath:n=ub.execPath,addExecPath:i=!0}={})=>{let o=Oa.resolve(lb(t)),s=[],a=e.split(Oa.delimiter);return r&&Eve(s,a,o),i&&Ave(s,a,n,o),e===""||e===Oa.delimiter?`${s.join(Oa.delimiter)}${e}`:[...s,e].join(Oa.delimiter)},Eve=(t,e,r)=>{for(let n of s9(r)){let i=Oa.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},Ave=(t,e,r,n)=>{let i=Oa.resolve(n,lb(r),"..");e.includes(i)||t.push(i)},c9=({env:t=ub.env,...e}={})=>{t={...t};let r=cb({env:t});return e.path=t[r],t[r]=kve(e),t}});var u9,ei,d9,f9,p9,db,Gf,Zf,Ra=y(()=>{u9=(t,e,r)=>{let n=r?Zf:Gf,i=t instanceof ei?{}:{cause:t};return new n(e,i)},ei=class extends Error{},d9=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,p9,{value:!0,writable:!1,enumerable:!1,configurable:!1})},f9=t=>db(t)&&p9 in t,p9=Symbol("isExecaError"),db=t=>Object.prototype.toString.call(t)==="[object Error]",Gf=class extends Error{};d9(Gf,Gf.name);Zf=class extends Error{};d9(Zf,Zf.name)});var m9,Tve,h9,g9,y9=y(()=>{m9=()=>{let t=g9-h9+1;return Array.from({length:t},Tve)},Tve=(t,e)=>({name:`SIGRT${e+1}`,number:h9+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),h9=34,g9=64});var _9,b9=y(()=>{_9=[{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:!0},{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:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{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"}]});import{constants as Ove}from"node:os";var RR,Rve,v9=y(()=>{b9();y9();RR=()=>{let t=m9();return[..._9,...t].map(Rve)},Rve=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=Ove,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as Ive}from"node:os";var Pve,Cve,S9,Dve,Nve,jve,gtt,w9=y(()=>{v9();Pve=()=>{let t=RR();return Object.fromEntries(t.map(Cve))},Cve=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],S9=Pve(),Dve=()=>{let t=RR(),e=65,r=Array.from({length:e},(n,i)=>Nve(i,t));return Object.assign({},...r)},Nve=(t,e)=>{let r=jve(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:c}}},jve=(t,e)=>{let r=e.find(({name:n})=>Ive.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},gtt=Dve()});import{constants as Vf}from"node:os";var $9,k9,E9,Mve,Fve,x9,Lve,IR,zve,Uve,fb,Wf=y(()=>{w9();$9=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return E9(t,e)},k9=t=>t===0?t:E9(t,"`subprocess.kill()`'s argument"),E9=(t,e)=>{if(Number.isInteger(t))return Mve(t,e);if(typeof t=="string")return Lve(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. +${IR()}`)},Mve=(t,e)=>{if(x9.has(t))return x9.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist. +${IR()}`)},Fve=()=>new Map(Object.entries(Vf.signals).reverse().map(([t,e])=>[e,t])),x9=Fve(),Lve=(t,e)=>{if(t in Vf.signals)return t;throw t.toUpperCase()in Vf.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist. +${IR()}`)},IR=()=>`Available signal names: ${zve()}. +Available signal numbers: ${Uve()}.`,zve=()=>Object.keys(Vf.signals).sort().map(t=>`'${t}'`).join(", "),Uve=()=>[...new Set(Object.values(Vf.signals).sort((t,e)=>t-e))].join(", "),fb=t=>S9[t].description});import{setTimeout as qve}from"node:timers/promises";var A9,Bve,T9,Hve,Gve,Zve,PR,pb=y(()=>{Ra();Wf();A9=t=>{if(t===!1)return t;if(t===!0)return Bve;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},Bve=1e3*5,T9=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:i,controller:o},s,a)=>{let{signal:c,error:l}=Hve(s,a,r);Gve(l,n);let u=t(c);return Zve({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:u,context:i,controller:o}),u},Hve=(t,e,r)=>{let[n=r,i]=db(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(i!==void 0&&!db(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:k9(n),error:i}},Gve=(t,e)=>{t!==void 0&&e.reject(t)},Zve=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:s})=>{e===n&&i&&PR({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal})},PR=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await qve(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}}});import{once as Vve}from"node:events";var mb,CR=y(()=>{mb=async(t,e)=>{t.aborted||await Vve(t,"abort",{signal:e})}});var O9,R9,Wve,DR=y(()=>{CR();O9=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},R9=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:i})=>e===void 0||r?[]:[Wve(t,e,n,i)],Wve=async(t,e,r,{signal:n})=>{throw await mb(e,n),r.terminationReason??="cancel",t.kill(),e.reason}});var Tl,Kve,NR,I9,P9,hb,C9,D9,N9,j9,M9,F9,Jve,Yve,Xve,ti,Qve,us,Ol,Rl=y(()=>{Tl=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{Kve(t,e,r),NR(t,e,n)},Kve=(t,e,r)=>{if(!r)throw new Error(`${ti(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},NR=(t,e,r)=>{if(!r)throw new Error(`${ti(t,e)} cannot be used: the ${us(e)} has already exited or disconnected.`)},I9=t=>{throw new Error(`${ti("getOneMessage",t)} could not complete: the ${us(t)} exited or disconnected.`)},P9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} is sending a message too, instead of listening to incoming messages. This can be fixed by both sending a message and listening to incoming messages at the same time: const [receivedMessage] = await Promise.all([ - ${ei("getOneMessage",t)}, - ${ei("sendMessage",t,"message, {strict: true}")}, -]);`)},mb=(t,e)=>new Error(`${ei("sendMessage",e)} failed when sending an acknowledgment response to the ${us(e)}.`,{cause:t}),T9=t=>{throw new Error(`${ei("sendMessage",t)} failed: the ${us(t)} is not listening to incoming messages.`)},O9=t=>{throw new Error(`${ei("sendMessage",t)} failed: the ${us(t)} exited without listening to incoming messages.`)},R9=()=>new Error(`\`cancelSignal\` aborted: the ${us(!0)} disconnected.`),I9=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},P9=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${ei(e,r)} cannot be used: the ${us(r)} is disconnecting.`,{cause:t})},C9=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(Bve(t))throw new Error(`${ei(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},Bve=({code:t,message:e})=>Hve.has(t)||Gve.some(r=>e.includes(r)),Hve=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Gve=["could not be cloned","circular structure","call stack size exceeded"],ei=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Zve(e)}${t}(${r})`,Zve=t=>t?"":"subprocess.",us=t=>t?"parent process":"subprocess",El=t=>{t.connected&&t.disconnect()}});var Ii,Tl=y(()=>{Ii=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)}});var gb,Ol,Pi,D9,Vve,Wve,N9,Kve,j9,Kf,hb,ds=y(()=>{vo();gb=(t,e="stdin")=>{let{options:n,fileDescriptors:i}=Pi.get(t),o=D9(i,e,!0),s=t.stdio[o];if(s===null)throw new TypeError(N9(o,e,n,!0));return s},Ol=(t,e="stdout")=>{let{options:n,fileDescriptors:i}=Pi.get(t),o=D9(i,e,!1),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(N9(o,e,n,!1));return s},Pi=new WeakMap,D9=(t,e,r)=>{let n=Vve(e,r);return Wve(n,e,r,t),n},Vve=(t,e)=>{let r=pR(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Kf(e)}" must not be "${t}". + ${ti("getOneMessage",t)}, + ${ti("sendMessage",t,"message, {strict: true}")}, +]);`)},hb=(t,e)=>new Error(`${ti("sendMessage",e)} failed when sending an acknowledgment response to the ${us(e)}.`,{cause:t}),C9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} is not listening to incoming messages.`)},D9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} exited without listening to incoming messages.`)},N9=()=>new Error(`\`cancelSignal\` aborted: the ${us(!0)} disconnected.`),j9=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},M9=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${ti(e,r)} cannot be used: the ${us(r)} is disconnecting.`,{cause:t})},F9=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(Jve(t))throw new Error(`${ti(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},Jve=({code:t,message:e})=>Yve.has(t)||Xve.some(r=>e.includes(r)),Yve=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Xve=["could not be cloned","circular structure","call stack size exceeded"],ti=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Qve(e)}${t}(${r})`,Qve=t=>t?"":"subprocess.",us=t=>t?"parent process":"subprocess",Ol=t=>{t.connected&&t.disconnect()}});var Ci,Il=y(()=>{Ci=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)}});var yb,Pl,Di,L9,eSe,tSe,z9,rSe,U9,Kf,gb,ds=y(()=>{So();yb=(t,e="stdin")=>{let{options:n,fileDescriptors:i}=Di.get(t),o=L9(i,e,!0),s=t.stdio[o];if(s===null)throw new TypeError(z9(o,e,n,!0));return s},Pl=(t,e="stdout")=>{let{options:n,fileDescriptors:i}=Di.get(t),o=L9(i,e,!1),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(z9(o,e,n,!1));return s},Di=new WeakMap,L9=(t,e,r)=>{let n=eSe(e,r);return tSe(n,e,r,t),n},eSe=(t,e)=>{let r=mR(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Kf(e)}" must not be "${t}". It must be ${n} or "fd3", "fd4" (and so on). -It is optional and defaults to "${i}".`)},Wve=(t,e,r,n)=>{let i=n[j9(t)];if(i===void 0)throw new TypeError(`"${Kf(r)}" must not be ${e}. That file descriptor does not exist. -Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!r)throw new TypeError(`"${Kf(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&r)throw new TypeError(`"${Kf(r)}" must not be ${e}. It must be a writable stream, not readable.`)},N9=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:o}=Kve(t,r);return`The "${i}: ${hb(o)}" option is incompatible with using "${Kf(n)}: ${hb(e)}". -Please set this option with "pipe" instead.`},Kve=(t,{stdin:e,stdout:r,stderr:n,stdio:i})=>{let o=j9(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},j9=t=>t==="all"?1:t,Kf=t=>t?"to":"from",hb=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream"});import{addAbortListener as Jve}from"node:events";var Ia,yb=y(()=>{Ia=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),Jve(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))}});var _b,NR,bb,jR,M9,F9,Jf=y(()=>{_b=(t,e)=>{e&&NR(t)},NR=t=>{t.refCounted()},bb=(t,e)=>{e&&jR(t)},jR=t=>{t.unrefCounted()},M9=(t,e)=>{e&&(jR(t),jR(t))},F9=(t,e)=>{e&&(NR(t),NR(t))}});import{once as Yve}from"node:events";import{scheduler as Xve}from"node:timers/promises";var L9,z9,vb,U9=y(()=>{wb();Jf();Sb();xb();L9=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},i)=>{if(B9(i)||G9(i))return;vb.has(t)||vb.set(t,[]);let o=vb.get(t);if(o.push(i),!(o.length>1))for(;o.length>0;){await H9(t,n,i),await Xve.yield();let s=await q9({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",s),n.emit("message:done")}},z9=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{MR();let o=vb.get(t);for(;o?.length>0;)await Yve(n,"message:done");t.removeListener("message",i),F9(e,r),n.connected=!1,n.emit("disconnect")},vb=new WeakMap});import{EventEmitter as Qve}from"node:events";var fs,$b,eSe,kb,Yf=y(()=>{U9();Jf();fs=(t,e,r)=>{if($b.has(t))return $b.get(t);let n=new Qve;return n.connected=!0,$b.set(t,n),eSe({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},$b=new WeakMap,eSe=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let i=L9.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",i),e.once("disconnect",z9.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:i})),M9(r,n)},kb=t=>{let e=$b.get(t);return e===void 0?t.channel!==null:e.connected}});import{once as tSe}from"node:events";var Z9,rSe,V9,q9,B9,W9,Eb,nSe,Ab,K9,Sb=y(()=>{Tl();yb();Rb();Al();Yf();wb();Z9=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:i})=>{if(!i)return n;let o=fs(t,e,r),s=Tb(t,o);return{id:rSe++,type:Ab,message:n,hasListeners:s}},rSe=0n,V9=(t,e)=>{if(!(e?.type!==Ab||e.hasListeners))for(let{id:r}of t)r!==void 0&&Eb[r].resolve({isDeadlock:!0,hasListeners:!1})},q9=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(t?.type!==Ab||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:K9,message:Tb(e,i)};try{await Ob({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return s},B9=t=>{if(t?.type!==K9)return!1;let{id:e,message:r}=t;return Eb[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},W9=async(t,e,r)=>{if(t?.type!==Ab)return;let n=Ii();Eb[t.id]=n;let i=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([n,nSe(e,r,i)]);o&&A9(r),s||T9(r)}finally{i.abort(),delete Eb[t.id]}},Eb={},nSe=async(t,e,{signal:r})=>{Ia(t,1,r),await tSe(t,"disconnect",{signal:r}),O9(e)},Ab="execa:ipc:request",K9="execa:ipc:response"});var J9,Y9,H9,Xf,Tb,iSe,wb=y(()=>{Tl();vo();ds();Sb();J9=(t,e,r)=>{Xf.has(t)||Xf.set(t,new Set);let n=Xf.get(t),i=Ii(),o=r?e.id:void 0,s={onMessageSent:i,id:o};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},Y9=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},H9=async(t,e,r)=>{for(;!Tb(t,e)&&Xf.get(t)?.size>0;){let n=[...Xf.get(t)];V9(n,r),await Promise.all(n.map(({onMessageSent:i})=>i))}},Xf=new WeakMap,Tb=(t,e)=>e.listenerCount("message")>iSe(t),iSe=t=>Pi.has(t)&&!bo(Pi.get(t).options.buffer,"ipc")?1:0});import{promisify as oSe}from"node:util";var Ob,sSe,LR,aSe,FR,Rb=y(()=>{Al();wb();Sb();Ob=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},i,{strict:o=!1}={})=>{let s="sendMessage";return kl({methodName:s,isSubprocess:r,ipc:n,isConnected:t.connected}),sSe({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:i,strict:o})},sSe=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:i,strict:o})=>{let s=Z9({anyProcess:t,channel:e,isSubprocess:n,message:i,strict:o}),a=J9(t,s,o);try{await LR({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:s,message:i})}catch(c){throw El(t),c}finally{Y9(a)}},LR=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:i})=>{let o=aSe(t);try{await Promise.all([W9(n,t,r),o(n)])}catch(s){throw P9({error:s,methodName:e,isSubprocess:r}),C9({error:s,methodName:e,isSubprocess:r,message:i}),s}},aSe=t=>{if(FR.has(t))return FR.get(t);let e=oSe(t.send.bind(t));return FR.set(t,e),e},FR=new WeakMap});import{scheduler as cSe}from"node:timers/promises";var Q9,eV,lSe,X9,G9,tV,MR,zR,xb=y(()=>{Rb();Yf();Al();Q9=(t,e)=>{let r="cancelSignal";return DR(r,!1,t.connected),LR({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:tV,message:e},message:e})},eV=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await lSe({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),zR.signal),lSe=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!X9){if(X9=!0,!n){I9();return}if(e===null){MR();return}fs(t,e,r),await cSe.yield()}},X9=!1,G9=t=>t?.type!==tV?!1:(zR.abort(t.message),!0),tV="execa:ipc:cancel",MR=()=>{zR.abort(R9())},zR=new AbortController});var rV,nV,uSe,dSe,UR=y(()=>{PR();xb();fb();rV=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},nV=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[uSe({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:i,controller:o})]:[],uSe=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:i}})=>{await pb(e,i);let o=dSe(e);throw await Q9(t,o),IR({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:i}),n.terminationReason??="gracefulCancel",e.reason},dSe=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e}});import{setTimeout as fSe}from"node:timers/promises";var iV,oV,pSe,qR=y(()=>{Ra();iV=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},oV=(t,e,r,n)=>e===0||e===void 0?[]:[pSe(t,e,r,n)],pSe=async(t,e,r,{signal:n})=>{throw await fSe(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new Qn}});import{execPath as mSe,execArgv as hSe}from"node:process";import sV from"node:path";var aV,cV,BR=y(()=>{bl();aV=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},cV=(t,e,{node:r=!1,nodePath:n=mSe,nodeOptions:i=hSe.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=_l(n,'The "nodePath" option'),l=sV.resolve(o,c),u={...a,nodePath:l,node:r,cwd:o};if(!r)return[t,e,u];if(sV.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...i,t,...e],{ipc:!0,...u,shell:!1}]}});import{serialize as gSe}from"node:v8";var lV,ySe,_Se,bSe,uV,HR=y(()=>{lV=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");bSe[r](t)}},ySe=t=>{try{gSe(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},_Se=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},bSe={advanced:ySe,json:_Se},uV=async(t,e)=>{e!==void 0&&await t.sendMessage(e)}});var fV,vSe,nn,GR,SSe,dV,Ib,Pa=y(()=>{fV=({encoding:t})=>{if(GR.has(t))return;let e=SSe(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Ib(t)}\`. -Please rename it to ${Ib(e)}.`);let r=[...GR].map(n=>Ib(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Ib(t)}\`. -Please rename it to one of: ${r}.`)},vSe=new Set(["utf8","utf16le"]),nn=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),GR=new Set([...vSe,...nn]),SSe=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in dV)return dV[e];if(GR.has(e))return e},dV={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Ib=t=>typeof t=="string"?`"${t}"`:String(t)});import{statSync as wSe}from"node:fs";import xSe from"node:path";import $Se from"node:process";var pV,mV,hV,ZR=y(()=>{bl();pV=(t=mV())=>{let e=_l(t,'The "cwd" option');return xSe.resolve(e)},mV=()=>{try{return $Se.cwd()}catch(t){throw t.message=`The current directory does not exist. -${t.message}`,t}},hV=(t,e)=>{if(e===mV())return t;let r;try{r=wSe(e)}catch(n){return`The "cwd" option is invalid: ${e}. +It is optional and defaults to "${i}".`)},tSe=(t,e,r,n)=>{let i=n[U9(t)];if(i===void 0)throw new TypeError(`"${Kf(r)}" must not be ${e}. That file descriptor does not exist. +Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!r)throw new TypeError(`"${Kf(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&r)throw new TypeError(`"${Kf(r)}" must not be ${e}. It must be a writable stream, not readable.`)},z9=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:o}=rSe(t,r);return`The "${i}: ${gb(o)}" option is incompatible with using "${Kf(n)}: ${gb(e)}". +Please set this option with "pipe" instead.`},rSe=(t,{stdin:e,stdout:r,stderr:n,stdio:i})=>{let o=U9(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},U9=t=>t==="all"?1:t,Kf=t=>t?"to":"from",gb=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream"});import{addAbortListener as nSe}from"node:events";var Ia,_b=y(()=>{Ia=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),nSe(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))}});var bb,jR,vb,MR,q9,B9,Jf=y(()=>{bb=(t,e)=>{e&&jR(t)},jR=t=>{t.refCounted()},vb=(t,e)=>{e&&MR(t)},MR=t=>{t.unrefCounted()},q9=(t,e)=>{e&&(MR(t),MR(t))},B9=(t,e)=>{e&&(jR(t),jR(t))}});import{once as iSe}from"node:events";import{scheduler as oSe}from"node:timers/promises";var H9,G9,Sb,Z9=y(()=>{xb();Jf();wb();$b();H9=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},i)=>{if(W9(i)||J9(i))return;Sb.has(t)||Sb.set(t,[]);let o=Sb.get(t);if(o.push(i),!(o.length>1))for(;o.length>0;){await K9(t,n,i),await oSe.yield();let s=await V9({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",s),n.emit("message:done")}},G9=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{FR();let o=Sb.get(t);for(;o?.length>0;)await iSe(n,"message:done");t.removeListener("message",i),B9(e,r),n.connected=!1,n.emit("disconnect")},Sb=new WeakMap});import{EventEmitter as sSe}from"node:events";var fs,kb,aSe,Eb,Yf=y(()=>{Z9();Jf();fs=(t,e,r)=>{if(kb.has(t))return kb.get(t);let n=new sSe;return n.connected=!0,kb.set(t,n),aSe({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},kb=new WeakMap,aSe=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let i=H9.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",i),e.once("disconnect",G9.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:i})),q9(r,n)},Eb=t=>{let e=kb.get(t);return e===void 0?t.channel!==null:e.connected}});import{once as cSe}from"node:events";var Y9,lSe,X9,V9,W9,Q9,Ab,uSe,Tb,eV,wb=y(()=>{Il();_b();Ib();Rl();Yf();xb();Y9=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:i})=>{if(!i)return n;let o=fs(t,e,r),s=Ob(t,o);return{id:lSe++,type:Tb,message:n,hasListeners:s}},lSe=0n,X9=(t,e)=>{if(!(e?.type!==Tb||e.hasListeners))for(let{id:r}of t)r!==void 0&&Ab[r].resolve({isDeadlock:!0,hasListeners:!1})},V9=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(t?.type!==Tb||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:eV,message:Ob(e,i)};try{await Rb({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return s},W9=t=>{if(t?.type!==eV)return!1;let{id:e,message:r}=t;return Ab[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},Q9=async(t,e,r)=>{if(t?.type!==Tb)return;let n=Ci();Ab[t.id]=n;let i=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([n,uSe(e,r,i)]);o&&P9(r),s||C9(r)}finally{i.abort(),delete Ab[t.id]}},Ab={},uSe=async(t,e,{signal:r})=>{Ia(t,1,r),await cSe(t,"disconnect",{signal:r}),D9(e)},Tb="execa:ipc:request",eV="execa:ipc:response"});var tV,rV,K9,Xf,Ob,dSe,xb=y(()=>{Il();So();ds();wb();tV=(t,e,r)=>{Xf.has(t)||Xf.set(t,new Set);let n=Xf.get(t),i=Ci(),o=r?e.id:void 0,s={onMessageSent:i,id:o};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},rV=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},K9=async(t,e,r)=>{for(;!Ob(t,e)&&Xf.get(t)?.size>0;){let n=[...Xf.get(t)];X9(n,r),await Promise.all(n.map(({onMessageSent:i})=>i))}},Xf=new WeakMap,Ob=(t,e)=>e.listenerCount("message")>dSe(t),dSe=t=>Di.has(t)&&!vo(Di.get(t).options.buffer,"ipc")?1:0});import{promisify as fSe}from"node:util";var Rb,pSe,zR,mSe,LR,Ib=y(()=>{Rl();xb();wb();Rb=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},i,{strict:o=!1}={})=>{let s="sendMessage";return Tl({methodName:s,isSubprocess:r,ipc:n,isConnected:t.connected}),pSe({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:i,strict:o})},pSe=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:i,strict:o})=>{let s=Y9({anyProcess:t,channel:e,isSubprocess:n,message:i,strict:o}),a=tV(t,s,o);try{await zR({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:s,message:i})}catch(c){throw Ol(t),c}finally{rV(a)}},zR=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:i})=>{let o=mSe(t);try{await Promise.all([Q9(n,t,r),o(n)])}catch(s){throw M9({error:s,methodName:e,isSubprocess:r}),F9({error:s,methodName:e,isSubprocess:r,message:i}),s}},mSe=t=>{if(LR.has(t))return LR.get(t);let e=fSe(t.send.bind(t));return LR.set(t,e),e},LR=new WeakMap});import{scheduler as hSe}from"node:timers/promises";var iV,oV,gSe,nV,J9,sV,FR,UR,$b=y(()=>{Ib();Yf();Rl();iV=(t,e)=>{let r="cancelSignal";return NR(r,!1,t.connected),zR({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:sV,message:e},message:e})},oV=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await gSe({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),UR.signal),gSe=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!nV){if(nV=!0,!n){j9();return}if(e===null){FR();return}fs(t,e,r),await hSe.yield()}},nV=!1,J9=t=>t?.type!==sV?!1:(UR.abort(t.message),!0),sV="execa:ipc:cancel",FR=()=>{UR.abort(N9())},UR=new AbortController});var aV,cV,ySe,_Se,qR=y(()=>{CR();$b();pb();aV=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},cV=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[ySe({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:i,controller:o})]:[],ySe=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:i}})=>{await mb(e,i);let o=_Se(e);throw await iV(t,o),PR({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:i}),n.terminationReason??="gracefulCancel",e.reason},_Se=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e}});import{setTimeout as bSe}from"node:timers/promises";var lV,uV,vSe,BR=y(()=>{Ra();lV=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},uV=(t,e,r,n)=>e===0||e===void 0?[]:[vSe(t,e,r,n)],vSe=async(t,e,r,{signal:n})=>{throw await bSe(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new ei}});import{execPath as SSe,execArgv as wSe}from"node:process";import dV from"node:path";var fV,pV,HR=y(()=>{wl();fV=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},pV=(t,e,{node:r=!1,nodePath:n=SSe,nodeOptions:i=wSe.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=Sl(n,'The "nodePath" option'),l=dV.resolve(o,c),u={...a,nodePath:l,node:r,cwd:o};if(!r)return[t,e,u];if(dV.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...i,t,...e],{ipc:!0,...u,shell:!1}]}});import{serialize as xSe}from"node:v8";var mV,$Se,kSe,ESe,hV,GR=y(()=>{mV=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");ESe[r](t)}},$Se=t=>{try{xSe(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},kSe=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},ESe={advanced:$Se,json:kSe},hV=async(t,e)=>{e!==void 0&&await t.sendMessage(e)}});var yV,ASe,on,ZR,TSe,gV,Pb,Pa=y(()=>{yV=({encoding:t})=>{if(ZR.has(t))return;let e=TSe(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Pb(t)}\`. +Please rename it to ${Pb(e)}.`);let r=[...ZR].map(n=>Pb(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Pb(t)}\`. +Please rename it to one of: ${r}.`)},ASe=new Set(["utf8","utf16le"]),on=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),ZR=new Set([...ASe,...on]),TSe=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in gV)return gV[e];if(ZR.has(e))return e},gV={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Pb=t=>typeof t=="string"?`"${t}"`:String(t)});import{statSync as OSe}from"node:fs";import RSe from"node:path";import ISe from"node:process";var _V,bV,vV,VR=y(()=>{wl();_V=(t=bV())=>{let e=Sl(t,'The "cwd" option');return RSe.resolve(e)},bV=()=>{try{return ISe.cwd()}catch(t){throw t.message=`The current directory does not exist. +${t.message}`,t}},vV=(t,e)=>{if(e===bV())return t;let r;try{r=OSe(e)}catch(n){return`The "cwd" option is invalid: ${e}. ${n.message} ${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}. -${t}`}});import kSe from"node:path";import gV from"node:process";var yV,Pb,ESe,ASe,VR=y(()=>{yV=St(YZ(),1);i9();fb();Wf();CR();UR();qR();BR();HR();Pa();ZR();bl();vo();Pb=(t,e,r)=>{r.cwd=pV(r.cwd);let[n,i,o]=cV(t,e,r),{command:s,args:a,options:c}=yV.default._parse(n,i,o),l=zG(c),u=ESe(l);return iV(u),fV(u),lV(u),$9(u),rV(u),u.shell=cR(u.shell),u.env=ASe(u),u.killSignal=b9(u.killSignal),u.forceKillAfterDelay=w9(u.forceKillAfterDelay),u.lines=u.lines.map((d,f)=>d&&!nn.has(u.encoding)&&u.buffer[f]),gV.platform==="win32"&&kSe.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},ESe=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m="advanced",...h})=>({...h,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),ASe=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...gV.env,...t}:t;return r||n?n9({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s}});var Cb,WR=y(()=>{Cb=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r]});function Rl(t){if(typeof t=="string")return TSe(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return OSe(t)}var TSe,OSe,_V,RSe,bV,ISe,KR=y(()=>{TSe=t=>t.at(-1)===_V?t.slice(0,t.at(-2)===bV?-2:-1):t,OSe=t=>t.at(-1)===RSe?t.subarray(0,t.at(-2)===ISe?-2:-1):t,_V=` -`,RSe=_V.codePointAt(0),bV="\r",ISe=bV.codePointAt(0)});function ti(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function JR(t,{checkOpen:e=!0}={}){return ti(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Ca(t,{checkOpen:e=!0}={}){return ti(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function YR(t,e){return JR(t,e)&&Ca(t,e)}var Da=y(()=>{});function vV(){return this[QR].next()}function SV(t){return this[QR].return(t)}function eI({preventCancel:t=!1}={}){let e=this.getReader(),r=new XR(e,t),n=Object.create(CSe);return n[QR]=r,n}var PSe,XR,QR,CSe,wV=y(()=>{PSe=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),XR=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#i(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},QR=Symbol();Object.defineProperty(vV,"name",{value:"next"});Object.defineProperty(SV,"name",{value:"return"});CSe=Object.create(PSe,{next:{enumerable:!0,configurable:!0,writable:!0,value:vV},return:{enumerable:!0,configurable:!0,writable:!0,value:SV}})});var xV=y(()=>{});var $V=y(()=>{wV();xV()});var kV,DSe,NSe,jSe,Qf,tI=y(()=>{Da();$V();kV=t=>{if(Ca(t,{checkOpen:!1})&&Qf.on!==void 0)return NSe(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(DSe.call(t)==="[object ReadableStream]")return eI.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:DSe}=Object.prototype,NSe=async function*(t){let e=new AbortController,r={};jSe(t,e,r);try{for await(let[n]of Qf.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},jSe=async(t,e,r)=>{try{await Qf.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},Qf={}});var Il,MSe,TV,EV,FSe,AV,Ci,ep=y(()=>{tI();Il=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let l=kV(t),u=e();u.length=0;try{for await(let d of l){let f=FSe(d),p=r[f](d,u);TV({convertedChunk:p,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:c})}return MSe({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(u)}catch(d){let f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(u),f}},MSe=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let s=i(t);s!==void 0&&TV({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:o})},TV=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){EV(t,e,i,a);return}let c=n(t,o-e.length);throw c!==void 0&&EV(c,e,i,o),new Ci},EV=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},FSe=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=AV.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&AV.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:AV}=Object.prototype,Ci=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var So,tp,Db,Nb,jb,Mb=y(()=>{So=t=>t,tp=()=>{},Db=({contents:t})=>t,Nb=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},jb=t=>t.length});async function Fb(t,e){return Il(t,qSe,e)}var LSe,zSe,USe,qSe,OV=y(()=>{ep();Mb();LSe=()=>({contents:[]}),zSe=()=>1,USe=(t,{contents:e})=>(e.push(t),e),qSe={init:LSe,convertChunk:{string:So,buffer:So,arrayBuffer:So,dataView:So,typedArray:So,others:So},getSize:zSe,truncateChunk:tp,addChunk:USe,getFinalChunk:tp,finalize:Db}});async function Lb(t,e){return Il(t,YSe,e)}var BSe,HSe,GSe,RV,IV,ZSe,VSe,WSe,KSe,CV,PV,JSe,DV,YSe,NV=y(()=>{ep();Mb();BSe=()=>({contents:new ArrayBuffer(0)}),HSe=t=>GSe.encode(t),GSe=new TextEncoder,RV=t=>new Uint8Array(t),IV=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),ZSe=(t,e)=>t.slice(0,e),VSe=(t,{contents:e,length:r},n)=>{let i=DV()?KSe(e,n):WSe(e,n);return new Uint8Array(i).set(t,r),i},WSe=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(CV(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},KSe=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:CV(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},CV=t=>PV**Math.ceil(Math.log(t)/Math.log(PV)),PV=2,JSe=({contents:t,length:e})=>DV()?t:t.slice(0,e),DV=()=>"resize"in ArrayBuffer.prototype,YSe={init:BSe,convertChunk:{string:HSe,buffer:RV,arrayBuffer:RV,dataView:IV,typedArray:IV,others:Nb},getSize:jb,truncateChunk:ZSe,addChunk:VSe,getFinalChunk:tp,finalize:JSe}});async function Ub(t,e){return Il(t,rwe,e)}var XSe,zb,QSe,ewe,twe,rwe,jV=y(()=>{ep();Mb();XSe=()=>({contents:"",textDecoder:new TextDecoder}),zb=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),QSe=(t,{contents:e})=>e+t,ewe=(t,e)=>t.slice(0,e),twe=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},rwe={init:XSe,convertChunk:{string:So,buffer:zb,arrayBuffer:zb,dataView:zb,typedArray:zb,others:Nb},getSize:jb,truncateChunk:ewe,addChunk:QSe,getFinalChunk:twe,finalize:Db}});var MV=y(()=>{OV();NV();jV();ep()});import{on as nwe}from"node:events";import{finished as iwe}from"node:stream/promises";var qb=y(()=>{tI();MV();Object.assign(Qf,{on:nwe,finished:iwe})});var FV,owe,LV,zV,swe,UV,qV,Bb,Na=y(()=>{qb();_o();vo();FV=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{if(!(t instanceof Ci))throw t;if(o==="all")return t;let s=owe(r,n,i);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},owe=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",LV=(t,e,r)=>{if(e.length!==r)return;let n=new Ci;throw n.maxBufferInfo={fdNumber:"ipc"},n},zV=(t,e)=>{let{streamName:r,threshold:n,unit:i}=swe(t,e);return`Command's ${r} was larger than ${n} ${i}`},swe=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let i=bo(e,r);return r==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:K_(r),threshold:i,unit:n}},UV=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>Bb(r)),qV=(t,e,r)=>{if(!e)return t;let n=Bb(r);return t.length>n?t.slice(0,n):t},Bb=([,t])=>t});import{inspect as awe}from"node:util";var HV,cwe,lwe,uwe,dwe,fwe,BV,GV=y(()=>{KR();rn();ZR();X_();Na();Wf();Ra();HV=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:b})=>{let _=n?.code,S=cwe({originalError:n,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:_,signal:i,signalDescription:o,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),x=uwe(n,b),w=x===void 0?"":` -${x}`,O=`${S}: ${a}${w}`,T=e===void 0?[t[2],t[1]]:[e],A=[O,...T,...t.slice(3),r.map(D=>dwe(D)).join(` -`)].map(D=>Hf(Rl(fwe(D)))).filter(Boolean).join(` - -`);return{originalMessage:x,shortMessage:O,message:A}},cwe=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=lwe(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${zV(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${db(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},lwe=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",uwe=(t,e)=>{if(t instanceof Qn)return;let r=a9(t)?t.originalMessage:String(t?.message??t),n=Hf(hV(r,e));return n===""?void 0:n},dwe=t=>typeof t=="string"?t:awe(t),fwe=t=>Array.isArray(t)?t.map(e=>Rl(BV(e))).filter(Boolean).join(` -`):BV(t),BV=t=>typeof t=="string"?t:Ut(t)?V_(t):""});var Hb,Pl,rp,pwe,ZV,mwe,np=y(()=>{Wf();ib();Ra();GV();Hb=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>ZV({command:t,escapedCommand:e,cwd:o,durationMs:_R(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),Pl=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>rp({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),rp=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:S},isSync:x})=>{let{exitCode:w,signal:O,signalDescription:T}=mwe(l,u),{originalMessage:A,shortMessage:D,message:$}=HV({stdio:d,all:f,ipcOutput:p,originalError:t,signal:O,signalDescription:T,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:S,timeout:h,cwd:_}),re=o9(t,$,x);return Object.assign(re,pwe({error:re,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:O,signalDescription:T,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:A,shortMessage:D})),re},pwe=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>ZV({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:_R(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),ZV=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),mwe=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:db(e);return{exitCode:r,signal:n,signalDescription:i}}});function hwe(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(VV(t*1e3)%1e3),nanoseconds:Math.trunc(VV(t*1e6)%1e3)}}function gwe(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function rI(t){switch(typeof t){case"number":{if(Number.isFinite(t))return hwe(t);break}case"bigint":return gwe(t)}throw new TypeError("Expected a finite number or bigint")}var VV,WV=y(()=>{VV=t=>Number.isFinite(t)?t:0});function nI(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+bwe);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&ywe(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+_we(d,u):f;i.push(p)}},a=rI(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%vwe):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var ywe,_we,bwe,vwe,KV=y(()=>{WV();ywe=t=>t===0||t===0n,_we=(t,e)=>e===1||e===1n?t:`${t}s`,bwe=1e-7,vwe=24n*60n*60n*1000n});var JV,YV=y(()=>{wl();JV=(t,e)=>{t.failed&&Ri({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var XV,Swe,QV=y(()=>{KV();ls();wl();YV();XV=(t,e)=>{vl(e)&&(JV(t,e),Swe(t,e))},Swe=(t,e)=>{let r=`(done in ${nI(t.durationMs)})`;Ri({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Cl,Gb=y(()=>{QV();Cl=(t,e,{reject:r})=>{if(XV(t,e),t.failed&&r)throw t;return t}});var rW,wwe,xwe,nW,iW,eW,$we,iI,tW,ja,oW,kwe,Zb,sW,Ewe,Awe,oI,aW,Twe,cW,Vb,Owe,sI,Rwe,Iwe,lW,Tn,Wb,aI,uW,dW,ps,vr=y(()=>{Da();go();rn();rW=(t,e)=>ja(t)?"asyncGenerator":oW(t)?"generator":Zb(t)?"fileUrl":Ewe(t)?"filePath":Owe(t)?"webStream":ti(t,{checkOpen:!1})?"native":Ut(t)?"uint8Array":Rwe(t)?"asyncIterable":Iwe(t)?"iterable":sI(t)?nW({transform:t},e):kwe(t)?wwe(t,e):"native",wwe=(t,e)=>YR(t.transform,{checkOpen:!1})?xwe(t,e):sI(t.transform)?nW(t,e):$we(t,e),xwe=(t,e)=>(iW(t,e,"Duplex stream"),"duplex"),nW=(t,e)=>(iW(t,e,"web TransformStream"),"webTransform"),iW=({final:t,binary:e,objectMode:r},n,i)=>{eW(t,`${n}.final`,i),eW(e,`${n}.binary`,i),iI(r,`${n}.objectMode`)},eW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},$we=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!tW(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(YR(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(sI(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!tW(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return iI(r,`${i}.binary`),iI(n,`${i}.objectMode`),ja(t)||ja(e)?"asyncGenerator":"generator"},iI=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},tW=t=>ja(t)||oW(t),ja=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",oW=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",kwe=t=>Ot(t)&&(t.transform!==void 0||t.final!==void 0),Zb=t=>Object.prototype.toString.call(t)==="[object URL]",sW=t=>Zb(t)&&t.protocol!=="file:",Ewe=t=>Ot(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Awe.has(e))&&oI(t.file),Awe=new Set(["file","append"]),oI=t=>typeof t=="string",aW=(t,e)=>t==="native"&&typeof e=="string"&&!Twe.has(e),Twe=new Set(["ipc","ignore","inherit","overlapped","pipe"]),cW=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Vb=t=>Object.prototype.toString.call(t)==="[object WritableStream]",Owe=t=>cW(t)||Vb(t),sI=t=>cW(t?.readable)&&Vb(t?.writable),Rwe=t=>lW(t)&&typeof t[Symbol.asyncIterator]=="function",Iwe=t=>lW(t)&&typeof t[Symbol.iterator]=="function",lW=t=>typeof t=="object"&&t!==null,Tn=new Set(["generator","asyncGenerator","duplex","webTransform"]),Wb=new Set(["fileUrl","filePath","fileNumber"]),aI=new Set(["fileUrl","filePath"]),uW=new Set([...aI,"webStream","nodeStream"]),dW=new Set(["webTransform","duplex"]),ps={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var cI,Pwe,Cwe,fW,lI=y(()=>{vr();cI=(t,e,r,n)=>n==="output"?Pwe(t,e,r):Cwe(t,e,r),Pwe=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},Cwe=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},fW=(t,e)=>{let r=t.findLast(({type:n})=>Tn.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var pW,Dwe,Nwe,jwe,Mwe,Fwe,Lwe,mW=y(()=>{go();Pa();vr();lI();pW=(t,e,r,n)=>[...t.filter(({type:i})=>!Tn.has(i)),...Dwe(t,e,r,n)],Dwe=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>Tn.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=Nwe({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return Lwe(o,r)},Nwe=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?jwe({stdioItem:t,optionName:i}):e==="webTransform"?Mwe({stdioItem:t,index:r,newTransforms:n,direction:o}):Fwe({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),jwe=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Mwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=Ot(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=cI(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},Fwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Ot(e)?e:{transform:e},d=c||nn.has(o),{writableObjectMode:f,readableObjectMode:p}=cI(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Lwe=(t,e)=>e==="input"?t.reverse():t});import uI from"node:process";var hW,zwe,Uwe,Dl,dI,gW,qwe,Bwe,yW=y(()=>{Da();vr();hW=(t,e,r)=>{let n=t.map(i=>zwe(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Bwe},zwe=({type:t,value:e},r)=>Uwe[r]??gW[t](e),Uwe=["input","output","output"],Dl=()=>{},dI=()=>"input",gW={generator:Dl,asyncGenerator:Dl,fileUrl:Dl,filePath:Dl,iterable:dI,asyncIterable:dI,uint8Array:dI,webStream:t=>Vb(t)?"output":"input",nodeStream(t){return Ca(t,{checkOpen:!1})?JR(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Dl,duplex:Dl,native(t){let e=qwe(t);if(e!==void 0)return e;if(ti(t,{checkOpen:!1}))return gW.nodeStream(t)}},qwe=t=>{if([0,uI.stdin].includes(t))return"input";if([1,2,uI.stdout,uI.stderr].includes(t))return"output"},Bwe="output"});var _W,bW=y(()=>{_W=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var vW,Hwe,Gwe,SW,Zwe,Vwe,wW=y(()=>{_o();bW();ls();vW=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Hwe(t,n).map((a,c)=>SW(a,c));return o?Zwe(s,r,i):_W(s,e)},Hwe=(t,e)=>{if(t===void 0)return An.map(n=>e[n]);if(Gwe(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${An.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,An.length);return Array.from({length:r},(n,i)=>t[i])},Gwe=t=>An.some(e=>t[e]!==void 0),SW=(t,e)=>Array.isArray(t)?t.map(r=>SW(r,e)):t??(e>=An.length?"ignore":"pipe"),Zwe=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!Sl(r,i)&&Vwe(n)?"ignore":n),Vwe=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as Wwe}from"node:fs";import Kwe from"node:tty";var $W,Jwe,Ywe,Xwe,Qwe,xW,kW=y(()=>{Da();_o();rn();ds();$W=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?Jwe({stdioItem:t,fdNumber:n,direction:i}):Qwe({stdioItem:t,fdNumber:n}),Jwe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=Ywe({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(ti(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},Ywe=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=Xwe(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(Kwe.isatty(i))throw new TypeError(`The \`${e}: ${hb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:yo(Wwe(i)),optionName:e}}},Xwe=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=W_.indexOf(t);if(r!==-1)return r},Qwe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:xW(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:xW(e,e,r),optionName:r}:ti(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,xW=(t,e,r)=>{let n=W_[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var EW,exe,txe,rxe,nxe,AW=y(()=>{Da();rn();vr();EW=({input:t,inputFile:e},r)=>r===0?[...exe(t),...rxe(e)]:[],exe=t=>t===void 0?[]:[{type:txe(t),value:t,optionName:"input"}],txe=t=>{if(Ca(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(Ut(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},rxe=t=>t===void 0?[]:[{...nxe(t),optionName:"inputFile"}],nxe=t=>{if(Zb(t))return{type:"fileUrl",value:t};if(oI(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var TW,OW,ixe,oxe,RW,sxe,axe,IW,PW=y(()=>{vr();TW=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),OW=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=ixe(i,t);if(s.length!==0){if(o){oxe({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(uW.has(t))return RW({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});dW.has(t)&&axe({otherStdioItems:s,type:t,value:e,optionName:r})}},ixe=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),oxe=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{aI.has(e)&&RW({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},RW=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>sxe(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return IW(s,n,e),i==="output"?o[0].stream:void 0},sxe=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,axe=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);IW(i,n,e)},IW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${ps[r]} that is the same.`)}});var Kb,cxe,lxe,uxe,dxe,fxe,pxe,mxe,hxe,gxe,yxe,_xe,fI,bxe,Jb=y(()=>{_o();mW();lI();vr();yW();wW();kW();AW();PW();Kb=(t,e,r,n)=>{let o=vW(e,r,n).map((a,c)=>cxe({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=gxe({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>bxe(a)),s},cxe=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=K_(e),{stdioItems:o,isStdioArray:s}=lxe({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=hW(o,e,i),c=o.map(d=>$W({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=pW(c,i,a,r),u=fW(l,a);return hxe(l,u),{direction:a,objectMode:u,stdioItems:l}},lxe=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>uxe(c,n)),...EW(r,e)],s=TW(o),a=s.length>1;return dxe(s,a,n),pxe(s),{stdioItems:s,isStdioArray:a}},uxe=(t,e)=>({type:rW(t,e),value:t,optionName:e}),dxe=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(fxe.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},fxe=new Set(["ignore","ipc"]),pxe=t=>{for(let e of t)mxe(e)},mxe=({type:t,value:e,optionName:r})=>{if(sW(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. -For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(aW(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},hxe=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>Wb.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},gxe=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push(yxe({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw fI(i),o}},yxe=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>_xe({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},_xe=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=OW({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},fI=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Xn(r)&&r.destroy()},bxe=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as CW}from"node:fs";var NW,Di,vxe,jW,DW,Sxe,MW=y(()=>{rn();Jb();vr();NW=(t,e)=>Kb(Sxe,t,e,!0),Di=({type:t,optionName:e})=>{jW(e,ps[t])},vxe=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&jW(t,`"${e}"`),{}),jW=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},DW={generator(){},asyncGenerator:Di,webStream:Di,nodeStream:Di,webTransform:Di,duplex:Di,asyncIterable:Di,native:vxe},Sxe={input:{...DW,fileUrl:({value:t})=>({contents:[yo(CW(t))]}),filePath:({value:{file:t}})=>({contents:[yo(CW(t))]}),fileNumber:Di,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...DW,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:Di,string:Di,uint8Array:Di}}});var wo,pI,ip=y(()=>{KR();wo=(t,{stripFinalNewline:e},r)=>pI(e,r)&&t!==void 0&&!Array.isArray(t)?Rl(t):t,pI=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var Yb,hI,FW,LW,wxe,xxe,$xe,zW,kxe,mI,Exe,Axe,Txe,Xb=y(()=>{Yb=(t,e,r,n)=>t||r?void 0:LW(e,n),hI=(t,e,r)=>r?t.flatMap(n=>FW(n,e)):FW(t,e),FW=(t,e)=>{let{transform:r,final:n}=LW(e,{});return[...r(t),...n()]},LW=(t,e)=>(e.previousChunks="",{transform:wxe.bind(void 0,e,t),final:$xe.bind(void 0,e)}),wxe=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o0&&(a=mI(n,a),n=""),yield a,i=o}i!==r.length-1&&(n=mI(n,r.slice(i+1))),t.previousChunks=n},xxe=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),$xe=function*({previousChunks:t}){t.length>0&&(yield t)},zW=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:kxe.bind(void 0,n)},kxe=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}=typeof e=="string"?Exe:Txe;if(e.at(-1)===i){yield e;return}yield o(e,t?n:r)},mI=(t,e)=>`${t}${e}`,Exe={windowsNewline:`\r +${t}`}});import PSe from"node:path";import SV from"node:process";var wV,Cb,CSe,DSe,WR=y(()=>{wV=St(r9(),1);l9();pb();Wf();DR();qR();BR();HR();GR();Pa();VR();wl();So();Cb=(t,e,r)=>{r.cwd=_V(r.cwd);let[n,i,o]=pV(t,e,r),{command:s,args:a,options:c}=wV.default._parse(n,i,o),l=GG(c),u=CSe(l);return lV(u),yV(u),mV(u),O9(u),aV(u),u.shell=lR(u.shell),u.env=DSe(u),u.killSignal=$9(u.killSignal),u.forceKillAfterDelay=A9(u.forceKillAfterDelay),u.lines=u.lines.map((d,f)=>d&&!on.has(u.encoding)&&u.buffer[f]),SV.platform==="win32"&&PSe.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},CSe=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m="advanced",...h})=>({...h,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),DSe=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...SV.env,...t}:t;return r||n?c9({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s}});var Db,KR=y(()=>{Db=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r]});function Cl(t){if(typeof t=="string")return NSe(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return jSe(t)}var NSe,jSe,xV,MSe,$V,FSe,JR=y(()=>{NSe=t=>t.at(-1)===xV?t.slice(0,t.at(-2)===$V?-2:-1):t,jSe=t=>t.at(-1)===MSe?t.subarray(0,t.at(-2)===FSe?-2:-1):t,xV=` +`,MSe=xV.codePointAt(0),$V="\r",FSe=$V.codePointAt(0)});function ri(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function YR(t,{checkOpen:e=!0}={}){return ri(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Ca(t,{checkOpen:e=!0}={}){return ri(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function XR(t,e){return YR(t,e)&&Ca(t,e)}var Da=y(()=>{});function kV(){return this[eI].next()}function EV(t){return this[eI].return(t)}function tI({preventCancel:t=!1}={}){let e=this.getReader(),r=new QR(e,t),n=Object.create(zSe);return n[eI]=r,n}var LSe,QR,eI,zSe,AV=y(()=>{LSe=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),QR=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#i(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},eI=Symbol();Object.defineProperty(kV,"name",{value:"next"});Object.defineProperty(EV,"name",{value:"return"});zSe=Object.create(LSe,{next:{enumerable:!0,configurable:!0,writable:!0,value:kV},return:{enumerable:!0,configurable:!0,writable:!0,value:EV}})});var TV=y(()=>{});var OV=y(()=>{AV();TV()});var RV,USe,qSe,BSe,Qf,rI=y(()=>{Da();OV();RV=t=>{if(Ca(t,{checkOpen:!1})&&Qf.on!==void 0)return qSe(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(USe.call(t)==="[object ReadableStream]")return tI.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:USe}=Object.prototype,qSe=async function*(t){let e=new AbortController,r={};BSe(t,e,r);try{for await(let[n]of Qf.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},BSe=async(t,e,r)=>{try{await Qf.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},Qf={}});var Dl,HSe,CV,IV,GSe,PV,Ni,ep=y(()=>{rI();Dl=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let l=RV(t),u=e();u.length=0;try{for await(let d of l){let f=GSe(d),p=r[f](d,u);CV({convertedChunk:p,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:c})}return HSe({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(u)}catch(d){let f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(u),f}},HSe=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let s=i(t);s!==void 0&&CV({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:o})},CV=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){IV(t,e,i,a);return}let c=n(t,o-e.length);throw c!==void 0&&IV(c,e,i,o),new Ni},IV=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},GSe=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=PV.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&PV.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:PV}=Object.prototype,Ni=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var wo,tp,Nb,jb,Mb,Fb=y(()=>{wo=t=>t,tp=()=>{},Nb=({contents:t})=>t,jb=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},Mb=t=>t.length});async function Lb(t,e){return Dl(t,KSe,e)}var ZSe,VSe,WSe,KSe,DV=y(()=>{ep();Fb();ZSe=()=>({contents:[]}),VSe=()=>1,WSe=(t,{contents:e})=>(e.push(t),e),KSe={init:ZSe,convertChunk:{string:wo,buffer:wo,arrayBuffer:wo,dataView:wo,typedArray:wo,others:wo},getSize:VSe,truncateChunk:tp,addChunk:WSe,getFinalChunk:tp,finalize:Nb}});async function zb(t,e){return Dl(t,iwe,e)}var JSe,YSe,XSe,NV,jV,QSe,ewe,twe,rwe,FV,MV,nwe,LV,iwe,zV=y(()=>{ep();Fb();JSe=()=>({contents:new ArrayBuffer(0)}),YSe=t=>XSe.encode(t),XSe=new TextEncoder,NV=t=>new Uint8Array(t),jV=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),QSe=(t,e)=>t.slice(0,e),ewe=(t,{contents:e,length:r},n)=>{let i=LV()?rwe(e,n):twe(e,n);return new Uint8Array(i).set(t,r),i},twe=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(FV(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},rwe=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:FV(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},FV=t=>MV**Math.ceil(Math.log(t)/Math.log(MV)),MV=2,nwe=({contents:t,length:e})=>LV()?t:t.slice(0,e),LV=()=>"resize"in ArrayBuffer.prototype,iwe={init:JSe,convertChunk:{string:YSe,buffer:NV,arrayBuffer:NV,dataView:jV,typedArray:jV,others:jb},getSize:Mb,truncateChunk:QSe,addChunk:ewe,getFinalChunk:tp,finalize:nwe}});async function qb(t,e){return Dl(t,lwe,e)}var owe,Ub,swe,awe,cwe,lwe,UV=y(()=>{ep();Fb();owe=()=>({contents:"",textDecoder:new TextDecoder}),Ub=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),swe=(t,{contents:e})=>e+t,awe=(t,e)=>t.slice(0,e),cwe=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},lwe={init:owe,convertChunk:{string:wo,buffer:Ub,arrayBuffer:Ub,dataView:Ub,typedArray:Ub,others:jb},getSize:Mb,truncateChunk:awe,addChunk:swe,getFinalChunk:cwe,finalize:Nb}});var qV=y(()=>{DV();zV();UV();ep()});import{on as uwe}from"node:events";import{finished as dwe}from"node:stream/promises";var Bb=y(()=>{rI();qV();Object.assign(Qf,{on:uwe,finished:dwe})});var BV,fwe,HV,GV,pwe,ZV,VV,Hb,Na=y(()=>{Bb();bo();So();BV=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{if(!(t instanceof Ni))throw t;if(o==="all")return t;let s=fwe(r,n,i);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},fwe=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",HV=(t,e,r)=>{if(e.length!==r)return;let n=new Ni;throw n.maxBufferInfo={fdNumber:"ipc"},n},GV=(t,e)=>{let{streamName:r,threshold:n,unit:i}=pwe(t,e);return`Command's ${r} was larger than ${n} ${i}`},pwe=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let i=vo(e,r);return r==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:J_(r),threshold:i,unit:n}},ZV=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>Hb(r)),VV=(t,e,r)=>{if(!e)return t;let n=Hb(r);return t.length>n?t.slice(0,n):t},Hb=([,t])=>t});import{inspect as mwe}from"node:util";var KV,hwe,gwe,ywe,_we,bwe,WV,JV=y(()=>{JR();nn();VR();Q_();Na();Wf();Ra();KV=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:b})=>{let _=n?.code,S=hwe({originalError:n,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:_,signal:i,signalDescription:o,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),x=ywe(n,b),w=x===void 0?"":` +${x}`,O=`${S}: ${a}${w}`,T=e===void 0?[t[2],t[1]]:[e],A=[O,...T,...t.slice(3),r.map(D=>_we(D)).join(` +`)].map(D=>Hf(Cl(bwe(D)))).filter(Boolean).join(` + +`);return{originalMessage:x,shortMessage:O,message:A}},hwe=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=gwe(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${GV(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${fb(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},gwe=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",ywe=(t,e)=>{if(t instanceof ei)return;let r=f9(t)?t.originalMessage:String(t?.message??t),n=Hf(vV(r,e));return n===""?void 0:n},_we=t=>typeof t=="string"?t:mwe(t),bwe=t=>Array.isArray(t)?t.map(e=>Cl(WV(e))).filter(Boolean).join(` +`):WV(t),WV=t=>typeof t=="string"?t:qt(t)?W_(t):""});var Gb,Nl,rp,vwe,YV,Swe,np=y(()=>{Wf();ob();Ra();JV();Gb=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>YV({command:t,escapedCommand:e,cwd:o,durationMs:bR(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),Nl=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>rp({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),rp=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:S},isSync:x})=>{let{exitCode:w,signal:O,signalDescription:T}=Swe(l,u),{originalMessage:A,shortMessage:D,message:$}=KV({stdio:d,all:f,ipcOutput:p,originalError:t,signal:O,signalDescription:T,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:S,timeout:h,cwd:_}),ie=u9(t,$,x);return Object.assign(ie,vwe({error:ie,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:O,signalDescription:T,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:A,shortMessage:D})),ie},vwe=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>YV({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:bR(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),YV=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Swe=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:fb(e);return{exitCode:r,signal:n,signalDescription:i}}});function wwe(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(XV(t*1e3)%1e3),nanoseconds:Math.trunc(XV(t*1e6)%1e3)}}function xwe(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function nI(t){switch(typeof t){case"number":{if(Number.isFinite(t))return wwe(t);break}case"bigint":return xwe(t)}throw new TypeError("Expected a finite number or bigint")}var XV,QV=y(()=>{XV=t=>Number.isFinite(t)?t:0});function iI(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+Ewe);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&$we(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+kwe(d,u):f;i.push(p)}},a=nI(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%Awe):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var $we,kwe,Ewe,Awe,eW=y(()=>{QV();$we=t=>t===0||t===0n,kwe=(t,e)=>e===1||e===1n?t:`${t}s`,Ewe=1e-7,Awe=24n*60n*60n*1000n});var tW,rW=y(()=>{kl();tW=(t,e)=>{t.failed&&Pi({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var nW,Twe,iW=y(()=>{eW();ls();kl();rW();nW=(t,e)=>{xl(e)&&(tW(t,e),Twe(t,e))},Twe=(t,e)=>{let r=`(done in ${iI(t.durationMs)})`;Pi({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var jl,Zb=y(()=>{iW();jl=(t,e,{reject:r})=>{if(nW(t,e),t.failed&&r)throw t;return t}});var aW,Owe,Rwe,cW,lW,oW,Iwe,oI,sW,ja,uW,Pwe,Vb,dW,Cwe,Dwe,sI,fW,Nwe,pW,Wb,jwe,aI,Mwe,Fwe,mW,On,Kb,cI,hW,gW,ps,Sr=y(()=>{Da();yo();nn();aW=(t,e)=>ja(t)?"asyncGenerator":uW(t)?"generator":Vb(t)?"fileUrl":Cwe(t)?"filePath":jwe(t)?"webStream":ri(t,{checkOpen:!1})?"native":qt(t)?"uint8Array":Mwe(t)?"asyncIterable":Fwe(t)?"iterable":aI(t)?cW({transform:t},e):Pwe(t)?Owe(t,e):"native",Owe=(t,e)=>XR(t.transform,{checkOpen:!1})?Rwe(t,e):aI(t.transform)?cW(t,e):Iwe(t,e),Rwe=(t,e)=>(lW(t,e,"Duplex stream"),"duplex"),cW=(t,e)=>(lW(t,e,"web TransformStream"),"webTransform"),lW=({final:t,binary:e,objectMode:r},n,i)=>{oW(t,`${n}.final`,i),oW(e,`${n}.binary`,i),oI(r,`${n}.objectMode`)},oW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},Iwe=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!sW(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(XR(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(aI(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!sW(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return oI(r,`${i}.binary`),oI(n,`${i}.objectMode`),ja(t)||ja(e)?"asyncGenerator":"generator"},oI=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},sW=t=>ja(t)||uW(t),ja=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",uW=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",Pwe=t=>Ot(t)&&(t.transform!==void 0||t.final!==void 0),Vb=t=>Object.prototype.toString.call(t)==="[object URL]",dW=t=>Vb(t)&&t.protocol!=="file:",Cwe=t=>Ot(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Dwe.has(e))&&sI(t.file),Dwe=new Set(["file","append"]),sI=t=>typeof t=="string",fW=(t,e)=>t==="native"&&typeof e=="string"&&!Nwe.has(e),Nwe=new Set(["ipc","ignore","inherit","overlapped","pipe"]),pW=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Wb=t=>Object.prototype.toString.call(t)==="[object WritableStream]",jwe=t=>pW(t)||Wb(t),aI=t=>pW(t?.readable)&&Wb(t?.writable),Mwe=t=>mW(t)&&typeof t[Symbol.asyncIterator]=="function",Fwe=t=>mW(t)&&typeof t[Symbol.iterator]=="function",mW=t=>typeof t=="object"&&t!==null,On=new Set(["generator","asyncGenerator","duplex","webTransform"]),Kb=new Set(["fileUrl","filePath","fileNumber"]),cI=new Set(["fileUrl","filePath"]),hW=new Set([...cI,"webStream","nodeStream"]),gW=new Set(["webTransform","duplex"]),ps={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var lI,Lwe,zwe,yW,uI=y(()=>{Sr();lI=(t,e,r,n)=>n==="output"?Lwe(t,e,r):zwe(t,e,r),Lwe=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},zwe=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},yW=(t,e)=>{let r=t.findLast(({type:n})=>On.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var _W,Uwe,qwe,Bwe,Hwe,Gwe,Zwe,bW=y(()=>{yo();Pa();Sr();uI();_W=(t,e,r,n)=>[...t.filter(({type:i})=>!On.has(i)),...Uwe(t,e,r,n)],Uwe=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>On.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=qwe({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return Zwe(o,r)},qwe=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?Bwe({stdioItem:t,optionName:i}):e==="webTransform"?Hwe({stdioItem:t,index:r,newTransforms:n,direction:o}):Gwe({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),Bwe=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Hwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=Ot(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=lI(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},Gwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Ot(e)?e:{transform:e},d=c||on.has(o),{writableObjectMode:f,readableObjectMode:p}=lI(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Zwe=(t,e)=>e==="input"?t.reverse():t});import dI from"node:process";var vW,Vwe,Wwe,Ml,fI,SW,Kwe,Jwe,wW=y(()=>{Da();Sr();vW=(t,e,r)=>{let n=t.map(i=>Vwe(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Jwe},Vwe=({type:t,value:e},r)=>Wwe[r]??SW[t](e),Wwe=["input","output","output"],Ml=()=>{},fI=()=>"input",SW={generator:Ml,asyncGenerator:Ml,fileUrl:Ml,filePath:Ml,iterable:fI,asyncIterable:fI,uint8Array:fI,webStream:t=>Wb(t)?"output":"input",nodeStream(t){return Ca(t,{checkOpen:!1})?YR(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Ml,duplex:Ml,native(t){let e=Kwe(t);if(e!==void 0)return e;if(ri(t,{checkOpen:!1}))return SW.nodeStream(t)}},Kwe=t=>{if([0,dI.stdin].includes(t))return"input";if([1,2,dI.stdout,dI.stderr].includes(t))return"output"},Jwe="output"});var xW,$W=y(()=>{xW=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var kW,Ywe,Xwe,EW,Qwe,exe,AW=y(()=>{bo();$W();ls();kW=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Ywe(t,n).map((a,c)=>EW(a,c));return o?Qwe(s,r,i):xW(s,e)},Ywe=(t,e)=>{if(t===void 0)return Tn.map(n=>e[n]);if(Xwe(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Tn.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,Tn.length);return Array.from({length:r},(n,i)=>t[i])},Xwe=t=>Tn.some(e=>t[e]!==void 0),EW=(t,e)=>Array.isArray(t)?t.map(r=>EW(r,e)):t??(e>=Tn.length?"ignore":"pipe"),Qwe=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!$l(r,i)&&exe(n)?"ignore":n),exe=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as txe}from"node:fs";import rxe from"node:tty";var OW,nxe,ixe,oxe,sxe,TW,RW=y(()=>{Da();bo();nn();ds();OW=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?nxe({stdioItem:t,fdNumber:n,direction:i}):sxe({stdioItem:t,fdNumber:n}),nxe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=ixe({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(ri(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},ixe=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=oxe(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(rxe.isatty(i))throw new TypeError(`The \`${e}: ${gb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:_o(txe(i)),optionName:e}}},oxe=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=K_.indexOf(t);if(r!==-1)return r},sxe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:TW(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:TW(e,e,r),optionName:r}:ri(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,TW=(t,e,r)=>{let n=K_[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var IW,axe,cxe,lxe,uxe,PW=y(()=>{Da();nn();Sr();IW=({input:t,inputFile:e},r)=>r===0?[...axe(t),...lxe(e)]:[],axe=t=>t===void 0?[]:[{type:cxe(t),value:t,optionName:"input"}],cxe=t=>{if(Ca(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(qt(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},lxe=t=>t===void 0?[]:[{...uxe(t),optionName:"inputFile"}],uxe=t=>{if(Vb(t))return{type:"fileUrl",value:t};if(sI(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var CW,DW,dxe,fxe,NW,pxe,mxe,jW,MW=y(()=>{Sr();CW=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),DW=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=dxe(i,t);if(s.length!==0){if(o){fxe({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(hW.has(t))return NW({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});gW.has(t)&&mxe({otherStdioItems:s,type:t,value:e,optionName:r})}},dxe=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),fxe=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{cI.has(e)&&NW({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},NW=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>pxe(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return jW(s,n,e),i==="output"?o[0].stream:void 0},pxe=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,mxe=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);jW(i,n,e)},jW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${ps[r]} that is the same.`)}});var Jb,hxe,gxe,yxe,_xe,bxe,vxe,Sxe,wxe,xxe,$xe,kxe,pI,Exe,Yb=y(()=>{bo();bW();uI();Sr();wW();AW();RW();PW();MW();Jb=(t,e,r,n)=>{let o=kW(e,r,n).map((a,c)=>hxe({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=xxe({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>Exe(a)),s},hxe=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=J_(e),{stdioItems:o,isStdioArray:s}=gxe({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=vW(o,e,i),c=o.map(d=>OW({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=_W(c,i,a,r),u=yW(l,a);return wxe(l,u),{direction:a,objectMode:u,stdioItems:l}},gxe=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>yxe(c,n)),...IW(r,e)],s=CW(o),a=s.length>1;return _xe(s,a,n),vxe(s),{stdioItems:s,isStdioArray:a}},yxe=(t,e)=>({type:aW(t,e),value:t,optionName:e}),_xe=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(bxe.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},bxe=new Set(["ignore","ipc"]),vxe=t=>{for(let e of t)Sxe(e)},Sxe=({type:t,value:e,optionName:r})=>{if(dW(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. +For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(fW(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},wxe=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>Kb.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},xxe=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push($xe({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw pI(i),o}},$xe=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>kxe({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},kxe=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=DW({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},pI=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Qn(r)&&r.destroy()},Exe=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as FW}from"node:fs";var zW,ji,Axe,UW,LW,Txe,qW=y(()=>{nn();Yb();Sr();zW=(t,e)=>Jb(Txe,t,e,!0),ji=({type:t,optionName:e})=>{UW(e,ps[t])},Axe=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&UW(t,`"${e}"`),{}),UW=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},LW={generator(){},asyncGenerator:ji,webStream:ji,nodeStream:ji,webTransform:ji,duplex:ji,asyncIterable:ji,native:Axe},Txe={input:{...LW,fileUrl:({value:t})=>({contents:[_o(FW(t))]}),filePath:({value:{file:t}})=>({contents:[_o(FW(t))]}),fileNumber:ji,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...LW,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:ji,string:ji,uint8Array:ji}}});var xo,mI,ip=y(()=>{JR();xo=(t,{stripFinalNewline:e},r)=>mI(e,r)&&t!==void 0&&!Array.isArray(t)?Cl(t):t,mI=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var Xb,gI,BW,HW,Oxe,Rxe,Ixe,GW,Pxe,hI,Cxe,Dxe,Nxe,Qb=y(()=>{Xb=(t,e,r,n)=>t||r?void 0:HW(e,n),gI=(t,e,r)=>r?t.flatMap(n=>BW(n,e)):BW(t,e),BW=(t,e)=>{let{transform:r,final:n}=HW(e,{});return[...r(t),...n()]},HW=(t,e)=>(e.previousChunks="",{transform:Oxe.bind(void 0,e,t),final:Ixe.bind(void 0,e)}),Oxe=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o0&&(a=hI(n,a),n=""),yield a,i=o}i!==r.length-1&&(n=hI(n,r.slice(i+1))),t.previousChunks=n},Rxe=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),Ixe=function*({previousChunks:t}){t.length>0&&(yield t)},GW=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:Pxe.bind(void 0,n)},Pxe=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}=typeof e=="string"?Cxe:Nxe;if(e.at(-1)===i){yield e;return}yield o(e,t?n:r)},hI=(t,e)=>`${t}${e}`,Cxe={windowsNewline:`\r `,unixNewline:` `,LF:` -`,concatBytes:mI},Axe=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},Txe={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Axe}});import{Buffer as Oxe}from"node:buffer";var UW,Rxe,qW,Ixe,Pxe,BW,HW=y(()=>{rn();UW=(t,e)=>t?void 0:Rxe.bind(void 0,e),Rxe=function*(t,e){if(typeof e!="string"&&!Ut(e)&&!Oxe.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},qW=(t,e)=>t?Ixe.bind(void 0,e):Pxe.bind(void 0,e),Ixe=function*(t,e){BW(t,e),yield e},Pxe=function*(t,e){if(BW(t,e),typeof e!="string"&&!Ut(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},BW=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`. +`,concatBytes:hI},Dxe=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},Nxe={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Dxe}});import{Buffer as jxe}from"node:buffer";var ZW,Mxe,VW,Fxe,Lxe,WW,KW=y(()=>{nn();ZW=(t,e)=>t?void 0:Mxe.bind(void 0,e),Mxe=function*(t,e){if(typeof e!="string"&&!qt(e)&&!jxe.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},VW=(t,e)=>t?Fxe.bind(void 0,e):Lxe.bind(void 0,e),Fxe=function*(t,e){WW(t,e),yield e},Lxe=function*(t,e){if(WW(t,e),typeof e!="string"&&!qt(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},WW=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`. Instead, \`yield\` should either be called with a value, or not be called at all. For example: - if (condition) { yield value; }`)}});import{Buffer as Cxe}from"node:buffer";import{StringDecoder as Dxe}from"node:string_decoder";var Qb,Nxe,jxe,Mxe,gI=y(()=>{rn();Qb=(t,e,r)=>{if(r)return;if(t)return{transform:Nxe.bind(void 0,new TextEncoder)};let n=new Dxe(e);return{transform:jxe.bind(void 0,n),final:Mxe.bind(void 0,n)}},Nxe=function*(t,e){Cxe.isBuffer(e)?yield yo(e):typeof e=="string"?yield t.encode(e):yield e},jxe=function*(t,e){yield Ut(e)?t.write(e):e},Mxe=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as GW}from"node:util";var yI,ev,ZW,Fxe,VW,Lxe,WW=y(()=>{yI=GW(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),ev=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Lxe}=e[r];for await(let i of n(t))yield*ev(i,e,r+1)},ZW=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Fxe(r,Number(e),t)},Fxe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*ev(n,r,e+1)},VW=GW(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Lxe=function*(t){yield t}});var _I,KW,Ma,op,zxe,Uxe,bI=y(()=>{_I=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},KW=(t,e)=>[...e.flatMap(r=>[...Ma(r,t,0)]),...op(t)],Ma=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Uxe}=e[r];for(let i of n(t))yield*Ma(i,e,r+1)},op=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*zxe(r,Number(e),t)},zxe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ma(n,r,e+1)},Uxe=function*(t){yield t}});import{Transform as qxe,getDefaultHighWaterMark as JW}from"node:stream";var vI,tv,YW,rv=y(()=>{vr();Xb();HW();gI();WW();bI();vI=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=YW(t,s,o),l=ja(e),u=ja(r),d=l?yI.bind(void 0,ev,a):_I.bind(void 0,Ma),f=l||u?yI.bind(void 0,ZW,a):_I.bind(void 0,op),p=l||u?VW.bind(void 0,a):void 0;return{stream:new qxe({writableObjectMode:n,writableHighWaterMark:JW(n),readableObjectMode:i,readableHighWaterMark:JW(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},tv=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=YW(s,r,a);t=KW(c,t)}return t},YW=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:UW(n,a)},Qb(r,s,n),Yb(r,o,n,c),{transform:t,final:e},{transform:qW(i,a)},zW({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var XW,Bxe,Hxe,Gxe,Zxe,QW=y(()=>{rv();rn();vr();XW=(t,e)=>{for(let r of Bxe(t))Hxe(t,r,e)},Bxe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Hxe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ps[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>Gxe(a,n));r.input=Bf(s)},Gxe=(t,e)=>{let r=tv(t,e,"utf8",!0);return Zxe(r),Bf(r)},Zxe=t=>{let e=t.find(r=>typeof r!="string"&&!Ut(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var nv,Vxe,Wxe,e3,t3,Kxe,r3,SI=y(()=>{Pa();vr();wl();ls();nv=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Sl(r,n)&&!nn.has(e)&&Vxe(n)&&(t.some(({type:i,value:o})=>i==="native"&&Wxe.has(o))||t.every(({type:i})=>Tn.has(i))),Vxe=t=>t===1||t===2,Wxe=new Set(["pipe","overlapped"]),e3=async(t,e,r,n)=>{for await(let i of t)Kxe(e)||r3(i,r,n)},t3=(t,e,r)=>{for(let n of t)r3(n,e,r)},Kxe=t=>t._readableState.pipes.length>0,r3=(t,e,r)=>{let n=rb(t);Ri({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as Jxe,appendFileSync as Yxe}from"node:fs";var n3,Xxe,Qxe,e0e,t0e,r0e,i3=y(()=>{SI();rv();Xb();rn();vr();Na();n3=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>Xxe({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},Xxe=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=qV(t,o,d),p=yo(f),{stdioItems:m,objectMode:h}=e[r],g=Qxe([p],m,c,n),{serializedResult:b,finalResult:_=b}=e0e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});t0e({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&r0e(b,m,i),S}catch(x){return n.error=x,S}},Qxe=(t,e,r,n)=>{try{return tv(t,e,r,!1)}catch(i){return n.error=i,t}},e0e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Bf(t)};let s=PG(t,r);return n[o]?{serializedResult:s,finalResult:hI(s,!i[o],e)}:{serializedResult:s}},t0e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!nv({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=hI(t,!1,s);try{t3(a,e,n)}catch(c){r.error??=c}},r0e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>Wb.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?Yxe(n,t):(r.add(o),Jxe(n,t))}}});var o3,s3=y(()=>{rn();ip();o3=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,wo(e,r,"all")]:Array.isArray(e)?[wo(t,r,"all"),...e]:Ut(t)&&Ut(e)?uR([t,e]):`${t}${e}`}});import{once as wI}from"node:events";var a3,n0e,c3,l3,i0e,xI,$I=y(()=>{Ra();a3=async(t,e)=>{let[r,n]=await n0e(t);return e.isForcefullyTerminated??=!1,[r,n]},n0e=async t=>{let[e,r]=await Promise.allSettled([wI(t,"spawn"),wI(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?c3(t):r.value},c3=async t=>{try{return await wI(t,"exit")}catch{return c3(t)}},l3=async t=>{let[e,r]=await t;if(!i0e(e,r)&&xI(e,r))throw new Qn;return[e,r]},i0e=(t,e)=>t===void 0&&e===void 0,xI=(t,e)=>t!==0||e!==null});var u3,o0e,d3=y(()=>{Ra();Na();$I();u3=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=o0e(t,e,r),s=o?.code==="ETIMEDOUT",a=UV(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},o0e=(t,e,r)=>t!==void 0?t:xI(e,r)?new Qn:void 0});import{spawnSync as s0e}from"node:child_process";var f3,a0e,c0e,l0e,iv,u0e,d0e,f0e,p0e,p3=y(()=>{bR();VR();WR();np();Gb();MW();ip();QW();i3();Na();s3();d3();f3=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=a0e(t,e,r),d=u0e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Cl(d,c,l)},a0e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ob(t,e,r),a=c0e(r),{file:c,commandArguments:l,options:u}=Pb(t,e,a);l0e(u);let d=NW(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},c0e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,l0e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&iv("ipcInput"),t&&iv("ipc: true"),r&&iv("detached: true"),n&&iv("cancelSignal")},iv=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},u0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=d0e({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=u3(c,r),{output:m,error:h=l}=n3({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>wo(_,r,S)),b=wo(o3(m,r),r,"all");return p0e({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},d0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{XW(o,r);let a=f0e(r);return s0e(...Cb(t,e,a))}catch(a){return Pl({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},f0e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Bb(e)}),p0e=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?Hb({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):rp({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as kI,on as m0e}from"node:events";var m3,h0e,g0e,y0e,_0e,h3=y(()=>{Al();Yf();Jf();m3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(kl({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:kb(t)}),h0e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),h0e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{_b(e,i);let o=fs(t,e,r),s=new AbortController;try{return await Promise.race([g0e(o,n,s),y0e(o,r,s),_0e(o,r,s)])}catch(a){throw El(t),a}finally{s.abort(),bb(e,i)}},g0e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await kI(t,"message",{signal:r});return n}for await(let[n]of m0e(t,"message",{signal:r}))if(e(n))return n},y0e=async(t,e,{signal:r})=>{await kI(t,"disconnect",{signal:r}),E9(e)},_0e=async(t,e,{signal:r})=>{let[n]=await kI(t,"strict:error",{signal:r});throw mb(n,e)}});import{once as y3,on as b0e}from"node:events";var _3,EI,v0e,S0e,w0e,g3,AI=y(()=>{Al();Yf();Jf();_3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>EI({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),EI=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{kl({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:kb(t)}),_b(e,o);let s=fs(t,e,r),a=new AbortController,c={};return v0e(t,s,a),S0e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),w0e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},v0e=async(t,e,r)=>{try{await y3(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},S0e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await y3(t,"strict:error",{signal:r.signal});n.error=mb(i,e),r.abort()}catch{}},w0e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of b0e(r,"message",{signal:o.signal}))g3(s),yield c}catch{g3(s)}finally{o.abort(),bb(e,a),n||El(t),i&&await t}},g3=({error:t})=>{if(t)throw t}});import b3 from"node:process";var v3,S3,w3,TI=y(()=>{Rb();h3();AI();xb();v3=(t,{ipc:e})=>{Object.assign(t,w3(t,!1,e))},S3=()=>{let t=b3,e=!0,r=b3.channel!==void 0;return{...w3(t,e,r),getCancelSignal:eV.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},w3=(t,e,r)=>({sendMessage:Ob.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:m3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:_3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as x0e}from"node:child_process";import{PassThrough as $0e,Readable as k0e,Writable as E0e,Duplex as A0e}from"node:stream";var x3,T0e,sp,O0e,R0e,I0e,P0e,$3=y(()=>{Jb();np();Gb();x3=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{fI(n);let a=new x0e;T0e(a,n),Object.assign(a,{readable:O0e,writable:R0e,duplex:I0e});let c=Pl({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=P0e(c,s,i);return{subprocess:a,promise:l}},T0e=(t,e)=>{let r=sp(),n=sp(),i=sp(),o=Array.from({length:e.length-3},sp),s=sp(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},sp=()=>{let t=new $0e;return t.end(),t},O0e=()=>new k0e({read(){}}),R0e=()=>new E0e({write(){}}),I0e=()=>new A0e({read(){},write(){}}),P0e=async(t,e,r)=>Cl(t,e,r)});import{createReadStream as k3,createWriteStream as E3}from"node:fs";import{Buffer as C0e}from"node:buffer";import{Readable as ap,Writable as D0e,Duplex as N0e}from"node:stream";var T3,cp,A3,j0e,O3=y(()=>{rv();Jb();vr();T3=(t,e)=>Kb(j0e,t,e,!1),cp=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ps[t]}.`)},A3={fileNumber:cp,generator:vI,asyncGenerator:vI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:N0e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},j0e={input:{...A3,fileUrl:({value:t})=>({stream:k3(t)}),filePath:({value:{file:t}})=>({stream:k3(t)}),webStream:({value:t})=>({stream:ap.fromWeb(t)}),iterable:({value:t})=>({stream:ap.from(t)}),asyncIterable:({value:t})=>({stream:ap.from(t)}),string:({value:t})=>({stream:ap.from(t)}),uint8Array:({value:t})=>({stream:ap.from(C0e.from(t))})},output:{...A3,fileUrl:({value:t})=>({stream:E3(t)}),filePath:({value:{file:t,append:e}})=>({stream:E3(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:D0e.fromWeb(t)}),iterable:cp,asyncIterable:cp,string:cp,uint8Array:cp}}});import{on as M0e,once as R3}from"node:events";import{PassThrough as F0e,getDefaultHighWaterMark as L0e}from"node:stream";import{finished as C3}from"node:stream/promises";function Fa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)RI(i);let e=t.some(({readableObjectMode:i})=>i),r=z0e(t,e),n=new OI({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var z0e,OI,U0e,q0e,B0e,RI,H0e,G0e,Z0e,V0e,W0e,D3,N3,II,j3,K0e,ov,I3,P3,sv=y(()=>{z0e=(t,e)=>{if(t.length===0)return L0e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},OI=class extends F0e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(RI(e),this.#t.has(e))return;this.#t.add(e),this.#n??=U0e(this,this.#t,this.#o);let r=H0e({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(RI(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},U0e=async(t,e,r)=>{ov(t,I3);let n=new AbortController;try{await Promise.race([q0e(t,n),B0e(t,e,r,n)])}finally{n.abort(),ov(t,-I3)}},q0e=async(t,{signal:e})=>{try{await C3(t,{signal:e,cleanup:!0})}catch(r){throw D3(t,r),r}},B0e=async(t,e,r,{signal:n})=>{for await(let[i]of M0e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},RI=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},H0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{ov(t,P3);let a=new AbortController;try{await Promise.race([G0e(o,e,a),Z0e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),V0e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),ov(t,-P3)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?II(t):W0e(t))},G0e=async(t,e,{signal:r})=>{try{await t,r.aborted||II(e)}catch(n){r.aborted||D3(e,n)}},Z0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await C3(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;N3(s)?i.add(e):j3(t,s)}},V0e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await R3(t,i,{signal:o}),!t.readable)return R3(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},W0e=t=>{t.writable&&t.end()},D3=(t,e)=>{N3(e)?II(t):j3(t,e)},N3=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",II=t=>{(t.readable||t.writable)&&t.destroy()},j3=(t,e)=>{t.destroyed||(t.once("error",K0e),t.destroy(e))},K0e=()=>{},ov=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},I3=2,P3=1});import{finished as M3}from"node:stream/promises";var Nl,J0e,PI,Y0e,CI,av=y(()=>{_o();Nl=(t,e)=>{t.pipe(e),J0e(t,e),Y0e(t,e)},J0e=async(t,e)=>{if(!(Xn(t)||Xn(e))){try{await M3(t,{cleanup:!0,readable:!0,writable:!1})}catch{}PI(e)}},PI=t=>{t.writable&&t.end()},Y0e=async(t,e)=>{if(!(Xn(t)||Xn(e))){try{await M3(e,{cleanup:!0,readable:!1,writable:!0})}catch{}CI(t)}},CI=t=>{t.readable&&t.destroy()}});var F3,X0e,Q0e,e$e,t$e,r$e,L3=y(()=>{sv();_o();yb();vr();av();F3=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>Tn.has(c)))X0e(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!Tn.has(c)))e$e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Fa(o);Nl(s,i)}},X0e=(t,e,r,n)=>{r==="output"?Nl(t.stdio[n],e):Nl(e,t.stdio[n]);let i=Q0e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},Q0e=["stdin","stdout","stderr"],e$e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;t$e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},t$e=(t,{signal:e})=>{Xn(t)&&Ia(t,r$e,e)},r$e=2});var La,z3=y(()=>{La=[];La.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&La.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&La.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var cv,DI,NI,n$e,jI,lv,i$e,MI,FI,LI,U3,Nst,jst,q3=y(()=>{z3();cv=t=>!!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",DI=Symbol.for("signal-exit emitter"),NI=globalThis,n$e=Object.defineProperty.bind(Object),jI=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(NI[DI])return NI[DI];n$e(NI,DI,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},lv=class{},i$e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),MI=class extends lv{onExit(){return()=>{}}load(){}unload(){}},FI=class extends lv{#t=LI.platform==="win32"?"SIGINT":"SIGHUP";#r=new jI;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of La)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!cv(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of La)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,La.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return cv(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&cv(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},LI=globalThis.process,{onExit:U3,load:Nst,unload:jst}=i$e(cv(LI)?new FI(LI):new MI)});import{addAbortListener as o$e}from"node:events";var B3,H3=y(()=>{q3();B3=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=U3(()=>{t.kill()});o$e(n,()=>{i()})}});var Z3,s$e,a$e,G3,c$e,V3=y(()=>{lR();ib();ds();bl();Z3=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=nb(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=s$e(r,n,i),{sourceStream:d,sourceError:f}=c$e(t,l),{options:p,fileDescriptors:m}=Pi.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},s$e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=a$e(t,e,...r),a=gb(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},a$e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(G3,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||aR(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=Z_(r,...n);return{destination:e(G3)(i,o,s),pipeOptions:s}}if(Pi.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},G3=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),c$e=(t,e)=>{try{return{sourceStream:Ol(t,e)}}catch(r){return{sourceError:r}}}});var K3,l$e,zI,W3,UI=y(()=>{np();av();K3=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=l$e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw zI({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},l$e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return CI(t),n;if(e!==void 0)return PI(r),e},zI=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Pl({error:t,command:W3,escapedCommand:W3,fileDescriptors:e,options:r,startTime:n,isSync:!1}),W3="source.pipe(destination)"});var J3,Y3=y(()=>{J3=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as u$e}from"node:stream/promises";var X3,d$e,f$e,p$e,uv,m$e,h$e,Q3=y(()=>{sv();yb();av();X3=(t,e,r)=>{let n=uv.has(e)?f$e(t,e):d$e(t,e);return Ia(t,m$e,r.signal),Ia(e,h$e,r.signal),p$e(e),n},d$e=(t,e)=>{let r=Fa([t]);return Nl(r,e),uv.set(e,r),r},f$e=(t,e)=>{let r=uv.get(e);return r.add(t),r},p$e=async t=>{try{await u$e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}uv.delete(t)},uv=new WeakMap,m$e=2,h$e=1});import{aborted as g$e}from"node:util";var eK,y$e,tK=y(()=>{UI();eK=(t,e)=>t===void 0?[]:[y$e(t,e)],y$e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await g$e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw zI({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var dv,_$e,b$e,rK=y(()=>{go();V3();UI();Y3();Q3();tK();dv=(t,...e)=>{if(Ot(e[0]))return dv.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Z3(t,...e),i=_$e({...n,destination:r});return i.pipe=dv.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},_$e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=b$e(t,i);K3({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=X3(e,o,d);return await Promise.race([J3(u),...eK(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},b$e=(t,e)=>Promise.allSettled([t,e])});import{on as v$e}from"node:events";import{getDefaultHighWaterMark as S$e}from"node:stream";var fv,w$e,qI,x$e,iK,BI,nK,$$e,k$e,pv=y(()=>{gI();Xb();bI();fv=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return w$e(e,s),iK({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},w$e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},qI=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;x$e(e,s,t);let a=t.readableObjectMode&&!o;return iK({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},x$e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},iK=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=v$e(t,"data",{signal:e.signal,highWaterMark:nK,highWatermark:nK});return $$e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},BI=S$e(!0),nK=BI,$$e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=k$e({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ma(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*op(a)}},k$e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[Qb(t,r,!e),Yb(t,i,!n,{})].filter(Boolean)});import{setImmediate as E$e}from"node:timers/promises";var oK,A$e,T$e,O$e,HI,sK,GI=y(()=>{qb();rn();SI();pv();Na();ip();oK=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=A$e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([T$e(t),d]);return}let f=pI(c,r),p=qI({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([O$e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},A$e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!nv({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=qI({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await e3(a,t,r,o)},T$e=async t=>{await E$e(),t.readableFlowing===null&&t.resume()},O$e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await Fb(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await Lb(r,{maxBuffer:o})):await Ub(r,{maxBuffer:o})}catch(a){return sK(FV({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},HI=async t=>{try{return await t}catch(e){return sK(e)}},sK=({bufferedData:t})=>RG(t)?new Uint8Array(t):t});import{finished as R$e}from"node:stream/promises";var lp,I$e,P$e,C$e,D$e,N$e,ZI,mv,aK,hv=y(()=>{lp=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=I$e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],R$e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||D$e(a,e,r,n)}finally{s.abort()}},I$e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&P$e(t,r,n),n},P$e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{C$e(e,r),n.call(t,...i)}},C$e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},D$e=(t,e,r,n)=>{if(!N$e(t,e,r,n))throw t},N$e=(t,e,r,n=!0)=>r.propagating?aK(t)||mv(t):(r.propagating=!0,ZI(r,e)===n?aK(t):mv(t)),ZI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",mv=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",aK=t=>t?.code==="EPIPE"});var cK,VI,WI=y(()=>{GI();hv();cK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>VI({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),VI=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=lp(t,e,l);if(ZI(l,e)){await u;return}let[d]=await Promise.all([oK({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var lK,uK,j$e,M$e,KI=y(()=>{sv();WI();lK=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Fa([t,e].filter(Boolean)):void 0,uK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>VI({...j$e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:M$e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),j$e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},M$e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var dK,fK,pK=y(()=>{wl();ls();dK=t=>Sl(t,"ipc"),fK=(t,e)=>{let r=rb(t);Ri({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var mK,hK,gK=y(()=>{Na();pK();vo();AI();mK=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=dK(o),a=bo(e,"ipc"),c=bo(r,"ipc");for await(let l of EI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(LV(t,i,c),i.push(l)),s&&fK(l,o);return i},hK=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as F$e}from"node:events";var yK,L$e,z$e,U$e,_K=y(()=>{Da();qR();CR();UR();_o();vr();GI();gK();HR();KI();WI();$I();hv();yK=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:b})=>{let _=a3(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=cK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=uK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),O=[],T=mK({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),A=L$e(h,t,S),D=z$e(m,S);try{return await Promise.race([Promise.all([{},l3(_),Promise.all(x),w,T,uV(t,d),...A,...D]),g,U$e(t,b),...oV(t,o,f,b),...k9({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...nV({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch($){return f.terminationReason??="other",Promise.all([{error:$},_,Promise.all(x.map(re=>HI(re))),HI(w),hK(T,O),Promise.allSettled(A),Promise.allSettled(D)])}},L$e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:lp(n,i,r)),z$e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>ti(o,{checkOpen:!1})&&!Xn(o)).map(({type:i,value:o,stream:s=o})=>lp(s,n,e,{isSameDirection:Tn.has(i),stopOnExit:i==="native"}))),U$e=async(t,{signal:e})=>{let[r]=await F$e(t,"error",{signal:e});throw r}});var bK,up,jl,gv=y(()=>{Tl();bK=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),up=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Ii();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},jl=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as vK}from"node:stream/promises";var JI,SK,YI,XI,yv,_v,QI=y(()=>{hv();JI=async t=>{if(t!==void 0)try{await YI(t)}catch{}},SK=async t=>{if(t!==void 0)try{await XI(t)}catch{}},YI=async t=>{await vK(t,{cleanup:!0,readable:!1,writable:!0})},XI=async t=>{await vK(t,{cleanup:!0,readable:!0,writable:!1})},yv=async(t,e)=>{if(await t,e)throw e},_v=(t,e,r)=>{r&&!mv(r)?t.destroy(r):e&&t.destroy()}});import{Readable as q$e}from"node:stream";import{callbackify as B$e}from"node:util";var wK,eP,tP,rP,H$e,nP,iP,xK,oP=y(()=>{Pa();ds();pv();Tl();gv();QI();wK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||nn.has(r),{subprocessStdout:a,waitReadableDestroy:c}=eP(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=tP(a,s),{read:f,onStdoutDataDone:p}=rP({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new q$e({read:f,destroy:B$e(iP.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return nP({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},eP=(t,e,r)=>{let n=Ol(t,e),i=up(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},tP=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:BI},rP=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Ii(),s=fv({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){H$e(this,s,o)},onStdoutDataDone:o}},H$e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},nP=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await XI(t),await n,await JI(i),await e,r.readable&&r.push(null)}catch(o){await JI(i),xK(r,o)}},iP=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await jl(r,e)&&(xK(t,n),await yv(e,n))},xK=(t,e)=>{_v(t,t.readable,e)}});import{Writable as G$e}from"node:stream";import{callbackify as $K}from"node:util";var kK,sP,aP,Z$e,V$e,cP,lP,EK,uP=y(()=>{ds();gv();QI();kK=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=sP(t,r,e),s=new G$e({...aP(n,t,i),destroy:$K(lP.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return cP(n,s),s},sP=(t,e,r)=>{let n=gb(t,e),i=up(r,n,"writableFinal"),o=up(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},aP=(t,e,r)=>({write:Z$e.bind(void 0,t),final:$K(V$e.bind(void 0,t,e,r))}),Z$e=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},V$e=async(t,e,r)=>{await jl(r,e)&&(t.writable&&t.end(),await e)},cP=async(t,e,r)=>{try{await YI(t),e.writable&&e.end()}catch(n){await SK(r),EK(e,n)}},lP=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await jl(r,e),await jl(n,e)&&(EK(t,i),await yv(e,i))},EK=(t,e)=>{_v(t,t.writable,e)}});import{Duplex as W$e}from"node:stream";import{callbackify as K$e}from"node:util";var AK,J$e,TK=y(()=>{Pa();oP();uP();AK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||nn.has(r),{subprocessStdout:c,waitReadableDestroy:l}=eP(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=sP(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=tP(c,a),{read:g,onStdoutDataDone:b}=rP({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new W$e({read:g,...aP(u,t,d),destroy:K$e(J$e.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return nP({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),cP(u,_,c),_},J$e=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([iP({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),lP({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var dP,Y$e,OK=y(()=>{Pa();ds();pv();dP=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||nn.has(e),s=Ol(t,r),a=fv({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return Y$e(a,s,t)},Y$e=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var RK,IK=y(()=>{gv();oP();uP();TK();OK();RK=(t,{encoding:e})=>{let r=bK();t.readable=wK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=kK.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=AK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=dP.bind(void 0,t,e),t[Symbol.asyncIterator]=dP.bind(void 0,t,e,{})}});var PK,X$e,Q$e,CK=y(()=>{PK=(t,e)=>{for(let[r,n]of Q$e){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},X$e=(async()=>{})().constructor.prototype,Q$e=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(X$e,t)])});import{setMaxListeners as eke}from"node:events";import{spawn as tke}from"node:child_process";var DK,rke,nke,ike,oke,ske,NK=y(()=>{qb();bR();VR();ds();WR();TI();np();Gb();$3();O3();ip();L3();fb();H3();rK();KI();_K();IK();Tl();CK();DK=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=rke(t,e,r),{subprocess:f,promise:p}=ike({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=dv.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),PK(f,p),Pi.set(f,{options:u,fileDescriptors:d}),f},rke=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ob(t,e,r),{file:a,commandArguments:c,options:l}=Pb(t,e,r),u=nke(l),d=T3(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},nke=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},ike=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=tke(...Cb(t,e,r))}catch(m){return x3({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;eke(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];F3(c,a,l),B3(c,r,l);let d={},f=Ii();c.kill=x9.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=lK(c,r),RK(c,r),v3(c,r);let p=oke({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},oke=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await yK({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map((x,w)=>wo(x,e,w)),_=wo(h,e,"all"),S=ske({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Cl(S,n,e)},ske=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?rp({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Ci,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):Hb({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var bv,ake,cke,jK=y(()=>{go();vo();bv=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,ake(n,t[n],i)]));return{...t,...r}},ake=(t,e,r)=>cke.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,cke=new Set(["env",...mR])});var ms,lke,uke,MK=y(()=>{go();lR();FG();p3();NK();jK();ms=(t,e,r,n)=>{let i=(s,a,c)=>ms(s,a,r,c),o=(...s)=>lke({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},lke=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Ot(o))return i(t,bv(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=uke({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?f3(a,c,l):DK(a,c,l,i)},uke=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=jG(e)?MG(e,r):[e,...r],[s,a,c]=Z_(...o),l=bv(bv(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var FK,LK,zK,dke,fke,UK=y(()=>{FK=({file:t,commandArguments:e})=>zK(t,e),LK=({file:t,commandArguments:e})=>({...zK(t,e),isSync:!0}),zK=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=dke(t);return{file:r,commandArguments:n}},dke=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(fke)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},fke=/ +/g});var qK,BK,pke,HK,mke,GK,ZK=y(()=>{qK=(t,e,r)=>{t.sync=e(pke,r),t.s=t.sync},BK=({options:t})=>HK(t),pke=({options:t})=>({...HK(t),isSync:!0}),HK=t=>({options:{...mke(t),...t}}),mke=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},GK={preferLocal:!0}});var klt,Ye,Elt,Alt,Tlt,Olt,Rlt,Ilt,Plt,Clt,Mr=y(()=>{MK();UK();BR();ZK();TI();klt=ms(()=>({})),Ye=ms(()=>({isSync:!0})),Elt=ms(FK),Alt=ms(LK),Tlt=ms(aV),Olt=ms(BK,{},GK,qK),{sendMessage:Rlt,getOneMessage:Ilt,getEachMessage:Plt,getCancelSignal:Clt}=S3()});import{existsSync as vv,statSync as hke}from"node:fs";import{dirname as fP,extname as gke,isAbsolute as VK,join as pP,relative as mP,resolve as Sv,sep as yke}from"node:path";function wv(t){return t==="./gradlew"||t==="gradle"}function _ke(t){return(vv(pP(t,"build.gradle.kts"))||vv(pP(t,"build.gradle")))&&vv(pP(t,"gradle.properties"))}function bke(t,e){let n=mP(t,e).split(yke).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function hs(t,e){return t===":"?`:${e}`:`${t}:${e}`}function vke(t,e){let r=Sv(t,e),n=r;vv(r)?hke(r).isFile()&&(n=fP(r)):gke(r)!==""&&(n=fP(r));let i=mP(t,n);if(i.startsWith("..")||VK(i))return null;let o=n;for(;;){if(_ke(o))return o;if(Sv(o)===Sv(t))return null;let s=fP(o);if(s===o)return null;let a=mP(t,s);if(a.startsWith("..")||VK(a))return null;o=s}}function xv(t,e){let r=Sv(t),n=new Map,i=[];for(let o of e){let s=vke(r,o);if(!s){i.push(o);continue}let a=bke(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var $v=y(()=>{"use strict"});import{existsSync as gP,readFileSync as Ske}from"node:fs";import{join as Ml}from"node:path";function Fl(t="."){let e=Ml(t,".cladding","config.yaml");if(!gP(e))return hP;try{let n=(0,WK.parse)(Ske(e,"utf8"))?.gate;if(!n)return hP;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of wke){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return hP}}function KK(t="."){let e=Fl(t).testReport,r=e?[e,...yP]:yP;return[...new Set(r.map(n=>Ml(t,n)))]}function JK(t="."){let e=Fl(t).testReport;if(e){let r=Ml(t,e);return gP(r)?r:null}return yP.map(r=>Ml(t,r)).find(r=>gP(r))??null}function YK(t,e){let r=[],n=!1;for(let i of t){let o=xke.exec(i);if(o){n=!0;for(let s of e)r.push(hs(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var WK,wke,hP,yP,xke,dp=y(()=>{"use strict";WK=St(Qt(),1);$v();wke=["type","lint","test","coverage"],hP={scope:"feature"},yP=["test-report.junit.xml",Ml("coverage","junit.xml"),Ml(".cladding","test-report.junit.xml")];xke=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as bP,readFileSync as XK,readdirSync as $ke,statSync as kke}from"node:fs";import{join as kv}from"node:path";function wP(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=kv(t,e);if(bP(r))try{if(QK.test(XK(r,"utf8")))return!0}catch{}}return!1}function eJ(t){try{return bP(t)&&QK.test(XK(t,"utf8"))}catch{return!1}}function tJ(t,e=0){if(e>4||!bP(t))return!1;let r;try{r=$ke(t)}catch{return!1}for(let n of r){let i=kv(t,n),o=!1;try{o=kke(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(tJ(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&eJ(i))return!0}return!1}function Tke(t){if(wP(t))return!0;for(let e of Eke)if(eJ(kv(t,e)))return!0;for(let e of Ake)if(tJ(kv(t,e)))return!0;return!1}function rJ(t="."){let e=Fl(t).coverage;return e||(Tke(t)?"kover":"jacoco")}function nJ(t="."){return vP[rJ(t)]}function iJ(t="."){return _P[rJ(t)]}var vP,_P,SP,QK,Eke,Ake,Ev=y(()=>{"use strict";dp();vP={kover:"koverXmlReport",jacoco:"jacocoTestReport"},_P={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},SP=[_P.kover,_P.jacoco],QK=/kover/i;Eke=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],Ake=["buildSrc","build-logic"]});import{existsSync as pp,readFileSync as sJ,readdirSync as aJ}from"node:fs";import{join as gs}from"node:path";function $P(t){return pp(gs(t,"gradlew"))?"./gradlew":"gradle"}function Oke(t){let e=$P(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[nJ(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function Rke(t){let e=!1;try{e=/(^|\n)\s*flutter\s*:|sdk:\s*flutter/.test(sJ(gs(t,"pubspec.yaml"),"utf8"))}catch{}let r={cmd:"dart",args:["format","--output=none","--set-exit-if-changed","."]},n={cmd:"gitleaks",args:["detect","--no-banner"]};return e?{type:{cmd:"flutter",args:["analyze"]},lint:r,test:{cmd:"flutter",args:["test"]},coverage:{cmd:"flutter",args:["test","--coverage"]},secret:n}:{type:{cmd:"dart",args:["analyze"]},lint:r,test:{cmd:"dart",args:["test"]},coverage:{cmd:"dart",args:["test","--coverage=coverage"]},secret:n}}function Pke(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function Nke(t,e){for(let r of e)if(pp(gs(t,r)))return r}function jke(t,e){try{return aJ(t).find(n=>n.endsWith(e))}catch{return}}function Lke(t){try{return JSON.parse(sJ(gs(t,"package.json"),"utf8"))}catch{return{}}}function fp(t,e){let r=t.scripts?.[e];return typeof r=="string"&&r.trim().length>0?r.trim():void 0}function oJ(t,e){return[t.dependencies,t.devDependencies,t.optionalDependencies,t.peerDependencies].some(r=>r?.[e]!==void 0)}function zke(t,e,r){if(fp(r,"lint"))return{cmd:"npm",args:["run","--silent","lint"]};for(let n of Mke)if(n.configs.some(i=>pp(gs(t,i))))return n.gate;if(Fke.some(n=>pp(gs(t,n)))||r.eslintConfig!==void 0)return e}function qke(t,e){return Uke.some(r=>pp(gs(t,r)))?!0:e.jest!==void 0}function Bke(t){if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?vitest(?:\s+run)?$/i.test(t))return"vitest";if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?jest$/i.test(t))return"jest"}function xP(t,e){let r={...t};return e==="lint"?delete r.lint:delete r.coverage,r}function Hke(t,e){let r=Lke(t),n=e.lint?zke(t,e.lint,r):void 0,i=n?{...e,lint:n}:xP(e,"lint"),o=fp(r,"test"),s=o?Bke(o):void 0;return o&&!s?(i=xP(i,"coverage"),{...i,test:{cmd:"npm",args:["test"]},...fp(r,"coverage")?{coverage:{cmd:"npm",args:["run","--silent","coverage"]}}:{}}):s==="jest"||!o&&qke(t,r)?{...i,test:{cmd:"npx",args:[...Ni,"jest"]},coverage:{cmd:"npx",args:[...Ni,"jest","--coverage"]}}:(s==="vitest"&&!fp(r,"coverage")&&!oJ(r,"@vitest/coverage-v8")&&!oJ(r,"@vitest/coverage-istanbul")?i=xP(i,"coverage"):s==="vitest"&&fp(r,"coverage")&&(i={...i,coverage:{cmd:"npm",args:["run","--silent","coverage"]}}),i)}function dt(t="."){for(let e of Cke){let r;for(let o of e.manifests)if(o.startsWith(".")?r=jke(t,o):r=Nke(t,[o]),r)break;if(!r||e.requiresSource&&!Pke(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"?Hke(t,n):n;return{language:e.language,manifest:r,gates:i}}return Dke}var Ni,Ike,Cke,Dke,Mke,Fke,Uke,on=y(()=>{"use strict";Ev();Ni=["--offline","--no-install"];Ike=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);Cke=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:[...Ni,"tsc","--noEmit"]},lint:{cmd:"npx",args:[...Ni,"eslint","."]},test:{cmd:"npx",args:[...Ni,"vitest","run"]},coverage:{cmd:"npx",args:[...Ni,"vitest","run","--coverage"]},secret:{cmd:"npx",args:[...Ni,"secretlint","**/*"]},arch:{cmd:"npx",args:[...Ni,"madge","--circular","--extensions","ts,tsx,js,jsx","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:Oke},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"swift",manifests:["Package.swift"],gates:{type:{cmd:"swift",args:["build"]},lint:{cmd:"swiftlint",args:["lint"]},test:{cmd:"swift",args:["test"]},coverage:{cmd:"swift",args:["test","--enable-code-coverage"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dart",manifests:["pubspec.yaml"],gates:Rke}],Dke={language:"unknown",manifest:"",gates:{}};Mke=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:[...Ni,"biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:[...Ni,"oxlint"]}}],Fke=["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts",".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"];Uke=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs","jest.config.json"]});import{existsSync as Gke,readFileSync as Zke}from"node:fs";import{join as Vke}from"node:path";function za(t){return t.code==="ENOENT"}function Av(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return cJ.test(o)||cJ.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function qt(t,e,r,n=[]){if(za(r))return{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`};let i=`${String(r.stderr??"")} -${String(r.stdout??"")}`,o=/ENOTCACHED|ENOTFOUND|EAI_AGAIN|canceled due to missing packages|could not determine executable/i.test(i),a=n.find(l=>l!=="--"&&!l.startsWith("-"))?.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=r.exitCode===127&&a!==void 0&&new RegExp(`(?:^|[\\s:])${a}: (?:command )?not found\\b`,"i").test(i);return e==="npx"&&(o||c)?{stage:t,pass:!1,exitCode:2,stderr:"setup gap: 'npx' could not resolve the configured tool without installing it; the inferred tool is not installed or unavailable offline"}:null}function tr(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Ll(t,e){let r=Vke(t,"package.json");if(!Gke(r))return!1;try{return!!JSON.parse(Zke(r,"utf8")).scripts?.[e]}catch{return!1}}var cJ,On=y(()=>{"use strict";cJ=/config (is |file )?not found|no such file|ENOENT|ENOTCACHED|ENOTFOUND|EAI_AGAIN|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function Wke(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.arch;if(!n)return[{detector:Tv,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=Ye(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Tv,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:Av(i,Tv,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var Tv,Ua,Ov=y(()=>{"use strict";Mr();on();On();Tv="ARCHITECTURE_VIOLATION";Ua={name:Tv,subprocess:!0,run:Wke}});function Kke(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.secret;if(!n)return[{detector:Rv,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=Ye(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Rv,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:Av(i,Rv,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var Rv,qa,Iv=y(()=>{"use strict";Mr();on();On();Rv="HARDCODED_SECRET";qa={name:Rv,subprocess:!0,run:Kke}});import{existsSync as kP,readdirSync as lJ}from"node:fs";import{join as Pv}from"node:path";function Yke(t,e){let r=Pv(t,e.path);if(!kP(r))return!0;if(e.isDirectory)try{return lJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function Xke(t){let{cwd:e="."}=t,r=[];for(let i of Jke)Yke(e,i)&&r.push({detector:mp,severity:i.severity,path:i.path,message:`${i.path} is absent \u2014 cladding scaffold incomplete (${i.purpose}). Run \`clad init --intent ""\` to populate it.`});let n=Pv(e,"spec.yaml");if(kP(n)){let i=tEe(n),o=i?null:Qke(e);if(i)r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present but unreadable (${i}) \u2014 cladding is governing nothing. Fix the SSoT root, then \`clad sync\` to validate.`});else if(o)r.push({detector:mp,severity:"error",path:o.path,message:`spec shard '${o.path}' is present but unparseable (${o.reason}) \u2014 loadSpec throws on it, so every spec-gated detector silently passes. Fix it, then \`clad sync\`.`});else{let s=eEe(e);s&&r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present and parses, but the assembled spec does not load (${s}) \u2014 every spec-gated detector then degrades to non-blocking info, so the gate would pass GREEN on an unloadable SSoT. Fix it, then \`clad sync\` to validate.`})}}return r}function Qke(t){for(let e of["spec/features","spec/scenarios"]){let r=Pv(t,e);if(!kP(r))continue;let n;try{n=lJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{Ai(Pv(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function eEe(t){try{return H(t),null}catch(e){return e.message}}function tEe(t){let e;try{e=Ai(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var mp,Jke,uJ,dJ=y(()=>{"use strict";Be();j_();mp="ABSENCE_OF_GOVERNANCE",Jke=[{path:"spec.yaml",severity:"error",purpose:"SSoT root \u2014 every spec-gated detector needs it"},{path:"spec/architecture.yaml",severity:"warn",purpose:"architecture invariants (layers + forbidden_imports)"},{path:"spec/capabilities.yaml",severity:"warn",purpose:"capability \u2194 feature traceability"},{path:"docs/project-context.md",severity:"warn",purpose:"intent narrative + decision history"},{path:"docs/conventions.md",severity:"info",purpose:"project style guide (recommended)"},{path:"spec/scenarios",severity:"info",purpose:"user-journey scenarios (recommended)",isDirectory:!0}];uJ={name:mp,run:Xke}});function Cv(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function EP(t,e){let r=e?.trim()??"";if(!t)return r.length>0?"condition is present but ears pattern is not declared":null;if(t==="ubiquitous")return r.length>0?`ears='ubiquitous' but condition is present ('${r.slice(0,40)}\u2026')`:null;if(t==="complex"){if(r.length===0)return"ears='complex' requires a 'while' precondition and a 'when' trigger \u2014 empty";let i=Cv(r)==="while",o=nEe.test(r);return i?o?null:"ears='complex' requires a 'when' trigger clause after the 'while' precondition \u2014 none found":`ears='complex' requires the condition to start with 'while' (precondition) \u2014 got '${Cv(r)}'`}let n=rEe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:Cv(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${Cv(r)}'`:null}function iEe(t,e){let r=EP(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function fJ(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...iEe(r,n));return e}var rEe,nEe,AP=y(()=>{"use strict";rEe={event:"when",state:"while",optional:"where",unwanted:"if"},nEe=/\bwhen\b/i});function ge(t,e,r){let n;try{n=H(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var wt=y(()=>{"use strict";Be()});function oEe(t){let{cwd:e="."}=t;return ge(e,Dv,sEe)}function sEe(t){let e=[];for(let r of t.features)for(let n of r.acceptance_criteria??[]){let i=!!n.text?.trim(),o=!!(n.condition?.trim()||n.action?.trim()||n.response?.trim());!i&&!o&&e.push({detector:Dv,severity:"error",message:`${r.id}.${n.id} has neither rendered text nor any EARS field (condition/action/response) \u2014 structurally empty AC`})}for(let r of fJ(t.features))e.push({detector:Dv,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var Dv,pJ,mJ=y(()=>{"use strict";AP();wt();Dv="AC_DRIFT";pJ={name:Dv,run:oEe}});function ji(t=".",e){let n=(e??"").trim().toLowerCase()||dt(t).language;return gJ[n]??hJ}var aEe,cEe,lEe,hJ,uEe,dEe,gJ,fEe,yJ,Ba=y(()=>{"use strict";on();aEe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,cEe=/^[ \t]*import\s+([\w.]+)/gm,lEe=/^[ \t]*(?:from|import)\s+([\w.]+)/gm,hJ={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:aEe,importStyle:"relative"},uEe={ext:"kt",extensions:[".kt",".kts"],sourceRoots:["src/main/kotlin","src/test/kotlin"],mainRoot:"src/main/kotlin",testGlobs:["src/test/kotlin/**/*Test.kt","src/test/kotlin/**/*Tests.kt"],coverageSummary:"build/reports/jacoco/test/jacocoTestReport.xml",coverageFormat:"jacoco-xml",importMatcher:cEe,importStyle:"dotted"},dEe={ext:"py",extensions:[".py"],sourceRoots:["."],mainRoot:"src",testGlobs:["tests/test_*.py","tests/**/test_*.py","tests/**/*_test.py"],coverageSummary:"coverage.xml",coverageFormat:"cobertura-xml",importMatcher:lEe,importStyle:"dotted"},gJ={typescript:hJ,kotlin:uEe,python:dEe},fEe=[".js",".jsx",".mts",".cts",".rs",".go",".java",".rb",".php",".cs",".fs",".ex",".exs"],yJ=new Set([...Object.values(gJ).flatMap(t=>t?.extensions??[]),...fEe].map(t=>t.toLowerCase()))});import{existsSync as pEe,readFileSync as mEe,readdirSync as hEe,statSync as gEe}from"node:fs";import{join as bJ,relative as _J}from"node:path";function yEe(t,e){if(!pEe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=hEe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=bJ(i,s),c;try{c=gEe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function _Ee(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function vEe(t){return bEe.test(t)}function SEe(t){let{cwd:e="."}=t,r;try{r=H(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=ji(e,r.project?.language),o=i.sourceRoots.flatMap(a=>yEe(bJ(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=mEe(a,"utf8")}catch{continue}let l=c.split(` -`);for(let u=0;u{"use strict";Be();Ba();vJ="AI_HINTS_FORBIDDEN_PATTERN";bEe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;SJ={name:vJ,run:SEe}});function wEe(t){let{cwd:e="."}=t,r;try{r=H(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:xJ,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var xJ,$J,kJ=y(()=>{"use strict";Be();xJ="AC_DUPLICATE_WITHIN_FEATURE";$J={name:xJ,run:wEe}});import{createRequire as xEe}from"module";import{basename as $Ee,dirname as OP,normalize as kEe,relative as EEe,resolve as AEe,sep as TJ}from"path";import*as TEe from"fs";function OEe(t){let e=kEe(t);return e.length>1&&e[e.length-1]===TJ&&(e=e.substring(0,e.length-1)),e}function OJ(t,e){return t.replace(REe,e)}function PEe(t){return t==="/"||IEe.test(t)}function TP(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=AEe(t)),(n||o)&&(t=OEe(t)),t===".")return"";let s=t[t.length-1]!==i;return OJ(s?t+i:t,i)}function RJ(t,e){return e+t}function CEe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:OJ(EEe(t,n),e.pathSeparator)+e.pathSeparator+r}}function DEe(t){return t}function NEe(t,e,r){return e+t+r}function jEe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?CEe(t,e):n?RJ:DEe}function MEe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function FEe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function qEe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?FEe(t):MEe(t):n&&n.length?zEe:LEe:UEe}function WEe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?VEe:r&&r.length?n?BEe:HEe:n?GEe:ZEe}function YEe(t){return t.group?JEe:KEe}function eAe(t){return t.group?XEe:QEe}function nAe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?rAe:tAe}function IJ(t,e,r){if(r.options.useRealPaths)return iAe(e,r);let n=OP(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=OP(n)}return r.symlinks.set(t,e),i>1}function iAe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function Nv(t,e,r,n){e(t&&!n?t:null,r)}function pAe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?oAe:lAe:n?e?sAe:fAe:i?e?cAe:dAe:e?aAe:uAe}function gAe(t){return t?hAe:mAe}function vAe(t,e){return new Promise((r,n)=>{DJ(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function DJ(t,e,r){new CJ(t,e,r).start()}function SAe(t,e){return new CJ(t,e).start()}var EJ,REe,IEe,LEe,zEe,UEe,BEe,HEe,GEe,ZEe,VEe,KEe,JEe,XEe,QEe,tAe,rAe,oAe,sAe,aAe,cAe,lAe,uAe,dAe,fAe,PJ,mAe,hAe,yAe,_Ae,bAe,CJ,AJ,NJ,jJ,MJ=y(()=>{EJ=xEe(import.meta.url);REe=/[\\/]/g;IEe=/^[a-z]:[\\/]$/i;LEe=(t,e)=>{e.push(t||".")},zEe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},UEe=()=>{};BEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},HEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},GEe=(t,e,r,n)=>{r.files++},ZEe=(t,e)=>{e.push(t)},VEe=()=>{};KEe=t=>t,JEe=()=>[""].slice(0,0);XEe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},QEe=()=>{};tAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&IJ(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},rAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&IJ(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};oAe=t=>t.counts,sAe=t=>t.groups,aAe=t=>t.paths,cAe=t=>t.paths.slice(0,t.options.maxFiles),lAe=(t,e,r)=>(Nv(e,r,t.counts,t.options.suppressErrors),null),uAe=(t,e,r)=>(Nv(e,r,t.paths,t.options.suppressErrors),null),dAe=(t,e,r)=>(Nv(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),fAe=(t,e,r)=>(Nv(e,r,t.groups,t.options.suppressErrors),null);PJ={withFileTypes:!0},mAe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",PJ,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},hAe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",PJ)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};yAe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},_Ae=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},bAe=class{aborted=!1;abort(){this.aborted=!0}},CJ=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=pAe(e,this.isSynchronous),this.root=TP(t,e),this.state={root:PEe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new _Ae,options:e,queue:new yAe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new bAe,fs:e.fs||TEe},this.joinPath=jEe(this.root,e),this.pushDirectory=qEe(this.root,e),this.pushFile=WEe(e),this.getArray=YEe(e),this.groupFiles=eAe(e),this.resolveSymlink=nAe(e,this.isSynchronous),this.walkDirectory=gAe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(b.isDirectory()){if(_=TP(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let S=$Ee(_),x=TP(OP(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};AJ=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return vAe(this.root,this.options)}withCallback(t){DJ(this.root,this.options,t)}sync(){return SAe(this.root,this.options)}},NJ=null;try{EJ.resolve("picomatch"),NJ=EJ("picomatch")}catch{}jJ=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:TJ,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new AJ(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new AJ(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||NJ;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var hp=v((jut,qJ)=>{"use strict";var FJ="[^\\\\/]",wAe="(?=.)",LJ="[^/]",RP="(?:\\/|$)",zJ="(?:^|\\/)",IP=`\\.{1,2}${RP}`,xAe="(?!\\.)",$Ae=`(?!${zJ}${IP})`,kAe=`(?!\\.{0,1}${RP})`,EAe=`(?!${IP})`,AAe="[^.\\/]",TAe=`${LJ}*?`,OAe="/",UJ={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:wAe,QMARK:LJ,END_ANCHOR:RP,DOTS_SLASH:IP,NO_DOT:xAe,NO_DOTS:$Ae,NO_DOT_SLASH:kAe,NO_DOTS_SLASH:EAe,QMARK_NO_DOT:AAe,STAR:TAe,START_ANCHOR:zJ,SEP:OAe},RAe={...UJ,SLASH_LITERAL:"[\\\\/]",QMARK:FJ,STAR:`${FJ}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},IAe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};qJ.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:IAe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?RAe:UJ}}});var gp=v(Fr=>{"use strict";var{REGEX_BACKSLASH:PAe,REGEX_REMOVE_BACKSLASH:CAe,REGEX_SPECIAL_CHARS:DAe,REGEX_SPECIAL_CHARS_GLOBAL:NAe}=hp();Fr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Fr.hasRegexChars=t=>DAe.test(t);Fr.isRegexChar=t=>t.length===1&&Fr.hasRegexChars(t);Fr.escapeRegex=t=>t.replace(NAe,"\\$1");Fr.toPosixSlashes=t=>t.replace(PAe,"/");Fr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Fr.removeBackslashes=t=>t.replace(CAe,e=>e==="\\"?"":e);Fr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Fr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Fr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Fr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Fr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var JJ=v((Fut,KJ)=>{"use strict";var BJ=gp(),{CHAR_ASTERISK:PP,CHAR_AT:jAe,CHAR_BACKWARD_SLASH:yp,CHAR_COMMA:MAe,CHAR_DOT:CP,CHAR_EXCLAMATION_MARK:DP,CHAR_FORWARD_SLASH:WJ,CHAR_LEFT_CURLY_BRACE:NP,CHAR_LEFT_PARENTHESES:jP,CHAR_LEFT_SQUARE_BRACKET:FAe,CHAR_PLUS:LAe,CHAR_QUESTION_MARK:HJ,CHAR_RIGHT_CURLY_BRACE:zAe,CHAR_RIGHT_PARENTHESES:GJ,CHAR_RIGHT_SQUARE_BRACKET:UAe}=hp(),ZJ=t=>t===WJ||t===yp,VJ=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},qAe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,b=!1,_=!1,S=!1,x=!1,w=!1,O=0,T,A,D={value:"",depth:0,isGlob:!1},$=()=>l>=n,re=()=>c.charCodeAt(l+1),K=()=>(T=A,c.charCodeAt(++l));for(;l0&&(C=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),P=c.slice(d)):m===!0?(xe="",P=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&ZJ(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(P&&(P=BJ.removeBackslashes(P)),xe&&_===!0&&(xe=BJ.removeBackslashes(xe)));let Ir={prefix:C,input:t,start:u,base:xe,glob:P,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&(Ir.maxDepth=0,ZJ(A)||s.push(D),Ir.tokens=s),r.parts===!0||r.tokens===!0){let se;for(let Ce=0;Ce{"use strict";var _p=hp(),sn=gp(),{MAX_LENGTH:jv,POSIX_REGEX_SOURCE:BAe,REGEX_NON_SPECIAL_CHARS:HAe,REGEX_SPECIAL_CHARS_BACKREF:GAe,REPLACEMENTS:YJ}=_p,ZAe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>sn.escapeRegex(i)).join("..")}return r},zl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,XJ=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},VAe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},QJ=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(VAe(e))return e.replace(/\\(.)/g,"$1")},WAe=t=>{let e=t.map(QJ).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},KAe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=QJ(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?sn.escapeRegex(r[0]):`[${r.map(i=>sn.escapeRegex(i)).join("")}]`}*`},JAe=t=>{let e=0,r=t.trim(),n=MP(r);for(;n;)e++,r=n.body.trim(),n=MP(r);return e},YAe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:_p.DEFAULT_MAX_EXTGLOB_RECURSION,n=XJ(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||WAe(n)))return{risky:!0};for(let i of n){let o=KAe(i);if(o)return{risky:!0,safeOutput:o};if(JAe(i)>r)return{risky:!0}}return{risky:!1}},FP=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=YJ[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(jv,r.maxLength):jv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=_p.globChars(r.windows),l=_p.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:b,QMARK:_,QMARK_NO_DOT:S,STAR:x,START_ANCHOR:w}=c,O=B=>`(${a}(?:(?!${w}${B.dot?m:u}).)*?)`,T=r.dot?"":h,A=r.dot?_:S,D=r.bash===!0?O(r):x;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let $={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=sn.removePrefix(t,$),i=t.length;let re=[],K=[],xe=[],C=o,P,Ir=()=>$.index===i-1,se=$.peek=(B=1)=>t[$.index+B],Ce=$.advance=()=>t[++$.index]||"",Kt=()=>t.slice($.index+1),dr=(B="",ht=0)=>{$.consumed+=B,$.index+=ht},Yt=B=>{$.output+=B.output!=null?B.output:B.value,dr(B.value)},co=()=>{let B=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)Ce(),$.start++,B++;return B%2===0?!1:($.negated=!0,$.start++,!0)},wi=B=>{$[B]++,xe.push(B)},Yr=B=>{$[B]--,xe.pop()},de=B=>{if(C.type==="globstar"){let ht=$.braces>0&&(B.type==="comma"||B.type==="brace"),q=B.extglob===!0||re.length&&(B.type==="pipe"||B.type==="paren");B.type!=="slash"&&B.type!=="paren"&&!ht&&!q&&($.output=$.output.slice(0,-C.output.length),C.type="star",C.value="*",C.output=D,$.output+=C.output)}if(re.length&&B.type!=="paren"&&(re[re.length-1].inner+=B.value),(B.value||B.output)&&Yt(B),C&&C.type==="text"&&B.type==="text"){C.output=(C.output||C.value)+B.value,C.value+=B.value;return}B.prev=C,s.push(B),C=B},lo=(B,ht)=>{let q={...l[ht],conditions:1,inner:""};q.prev=C,q.parens=$.parens,q.output=$.output,q.startIndex=$.index,q.tokensIndex=s.length;let Oe=(r.capture?"(":"")+q.open;wi("parens"),de({type:B,value:ht,output:$.output?"":p}),de({type:"paren",extglob:!0,value:Ce(),output:Oe}),re.push(q)},Ode=B=>{let ht=t.slice(B.startIndex,$.index+1),q=t.slice(B.startIndex+2,$.index),Oe=YAe(q,r);if((B.type==="plus"||B.type==="star")&&Oe.risky){let lt=Oe.safeOutput?(B.output?"":p)+(r.capture?`(${Oe.safeOutput})`:Oe.safeOutput):void 0,xi=s[B.tokensIndex];xi.type="text",xi.value=ht,xi.output=lt||sn.escapeRegex(ht);for(let $i=B.tokensIndex+1;$i1&&B.inner.includes("/")&&(lt=O(r)),(lt!==D||Ir()||/^\)+$/.test(Kt()))&&(ut=B.close=`)$))${lt}`),B.inner.includes("*")&&(Lt=Kt())&&/^\.[^\\/.]+$/.test(Lt)){let xi=FP(Lt,{...e,fastpaths:!1}).output;ut=B.close=`)${xi})${lt})`}B.prev.type==="bos"&&($.negatedExtglob=!0)}de({type:"paren",extglob:!0,value:P,output:ut}),Yr("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let B=!1,ht=t.replace(GAe,(q,Oe,ut,Lt,lt,xi)=>Lt==="\\"?(B=!0,q):Lt==="?"?Oe?Oe+Lt+(lt?_.repeat(lt.length):""):xi===0?A+(lt?_.repeat(lt.length):""):_.repeat(ut.length):Lt==="."?u.repeat(ut.length):Lt==="*"?Oe?Oe+Lt+(lt?D:""):D:Oe?q:`\\${q}`);return B===!0&&(r.unescape===!0?ht=ht.replace(/\\/g,""):ht=ht.replace(/\\+/g,q=>q.length%2===0?"\\\\":q?"\\":"")),ht===t&&r.contains===!0?($.output=t,$):($.output=sn.wrapOutput(ht,$,e),$)}for(;!Ir();){if(P=Ce(),P==="\0")continue;if(P==="\\"){let q=se();if(q==="/"&&r.bash!==!0||q==="."||q===";")continue;if(!q){P+="\\",de({type:"text",value:P});continue}let Oe=/^\\+/.exec(Kt()),ut=0;if(Oe&&Oe[0].length>2&&(ut=Oe[0].length,$.index+=ut,ut%2!==0&&(P+="\\")),r.unescape===!0?P=Ce():P+=Ce(),$.brackets===0){de({type:"text",value:P});continue}}if($.brackets>0&&(P!=="]"||C.value==="["||C.value==="[^")){if(r.posix!==!1&&P===":"){let q=C.value.slice(1);if(q.includes("[")&&(C.posix=!0,q.includes(":"))){let Oe=C.value.lastIndexOf("["),ut=C.value.slice(0,Oe),Lt=C.value.slice(Oe+2),lt=BAe[Lt];if(lt){C.value=ut+lt,$.backtrack=!0,Ce(),!o.output&&s.indexOf(C)===1&&(o.output=p);continue}}}(P==="["&&se()!==":"||P==="-"&&se()==="]")&&(P=`\\${P}`),P==="]"&&(C.value==="["||C.value==="[^")&&(P=`\\${P}`),r.posix===!0&&P==="!"&&C.value==="["&&(P="^"),C.value+=P,Yt({value:P});continue}if($.quotes===1&&P!=='"'){P=sn.escapeRegex(P),C.value+=P,Yt({value:P});continue}if(P==='"'){$.quotes=$.quotes===1?0:1,r.keepQuotes===!0&&de({type:"text",value:P});continue}if(P==="("){wi("parens"),de({type:"paren",value:P});continue}if(P===")"){if($.parens===0&&r.strictBrackets===!0)throw new SyntaxError(zl("opening","("));let q=re[re.length-1];if(q&&$.parens===q.parens+1){Ode(re.pop());continue}de({type:"paren",value:P,output:$.parens?")":"\\)"}),Yr("parens");continue}if(P==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(zl("closing","]"));P=`\\${P}`}else wi("brackets");de({type:"bracket",value:P});continue}if(P==="]"){if(r.nobracket===!0||C&&C.type==="bracket"&&C.value.length===1){de({type:"text",value:P,output:`\\${P}`});continue}if($.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(zl("opening","["));de({type:"text",value:P,output:`\\${P}`});continue}Yr("brackets");let q=C.value.slice(1);if(C.posix!==!0&&q[0]==="^"&&!q.includes("/")&&(P=`/${P}`),C.value+=P,Yt({value:P}),r.literalBrackets===!1||sn.hasRegexChars(q))continue;let Oe=sn.escapeRegex(C.value);if($.output=$.output.slice(0,-C.value.length),r.literalBrackets===!0){$.output+=Oe,C.value=Oe;continue}C.value=`(${a}${Oe}|${C.value})`,$.output+=C.value;continue}if(P==="{"&&r.nobrace!==!0){wi("braces");let q={type:"brace",value:P,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};K.push(q),de(q);continue}if(P==="}"){let q=K[K.length-1];if(r.nobrace===!0||!q){de({type:"text",value:P,output:P});continue}let Oe=")";if(q.dots===!0){let ut=s.slice(),Lt=[];for(let lt=ut.length-1;lt>=0&&(s.pop(),ut[lt].type!=="brace");lt--)ut[lt].type!=="dots"&&Lt.unshift(ut[lt].value);Oe=ZAe(Lt,r),$.backtrack=!0}if(q.comma!==!0&&q.dots!==!0){let ut=$.output.slice(0,q.outputIndex),Lt=$.tokens.slice(q.tokensIndex);q.value=q.output="\\{",P=Oe="\\}",$.output=ut;for(let lt of Lt)$.output+=lt.output||lt.value}de({type:"brace",value:P,output:Oe}),Yr("braces"),K.pop();continue}if(P==="|"){re.length>0&&re[re.length-1].conditions++,de({type:"text",value:P});continue}if(P===","){let q=P,Oe=K[K.length-1];Oe&&xe[xe.length-1]==="braces"&&(Oe.comma=!0,q="|"),de({type:"comma",value:P,output:q});continue}if(P==="/"){if(C.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",s.pop(),C=o;continue}de({type:"slash",value:P,output:f});continue}if(P==="."){if($.braces>0&&C.type==="dot"){C.value==="."&&(C.output=u);let q=K[K.length-1];C.type="dots",C.output+=P,C.value+=P,q.dots=!0;continue}if($.braces+$.parens===0&&C.type!=="bos"&&C.type!=="slash"){de({type:"text",value:P,output:u});continue}de({type:"dot",value:P,output:u});continue}if(P==="?"){if(!(C&&C.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){lo("qmark",P);continue}if(C&&C.type==="paren"){let Oe=se(),ut=P;(C.value==="("&&!/[!=<:]/.test(Oe)||Oe==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(ut=`\\${P}`),de({type:"text",value:P,output:ut});continue}if(r.dot!==!0&&(C.type==="slash"||C.type==="bos")){de({type:"qmark",value:P,output:S});continue}de({type:"qmark",value:P,output:_});continue}if(P==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){lo("negate",P);continue}if(r.nonegate!==!0&&$.index===0){co();continue}}if(P==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){lo("plus",P);continue}if(C&&C.value==="("||r.regex===!1){de({type:"plus",value:P,output:d});continue}if(C&&(C.type==="bracket"||C.type==="paren"||C.type==="brace")||$.parens>0){de({type:"plus",value:P});continue}de({type:"plus",value:d});continue}if(P==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){de({type:"at",extglob:!0,value:P,output:""});continue}de({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let q=HAe.exec(Kt());q&&(P+=q[0],$.index+=q[0].length),de({type:"text",value:P});continue}if(C&&(C.type==="globstar"||C.star===!0)){C.type="star",C.star=!0,C.value+=P,C.output=D,$.backtrack=!0,$.globstar=!0,dr(P);continue}let B=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(B)){lo("star",P);continue}if(C.type==="star"){if(r.noglobstar===!0){dr(P);continue}let q=C.prev,Oe=q.prev,ut=q.type==="slash"||q.type==="bos",Lt=Oe&&(Oe.type==="star"||Oe.type==="globstar");if(r.bash===!0&&(!ut||B[0]&&B[0]!=="/")){de({type:"star",value:P,output:""});continue}let lt=$.braces>0&&(q.type==="comma"||q.type==="brace"),xi=re.length&&(q.type==="pipe"||q.type==="paren");if(!ut&&q.type!=="paren"&&!lt&&!xi){de({type:"star",value:P,output:""});continue}for(;B.slice(0,3)==="/**";){let $i=t[$.index+4];if($i&&$i!=="/")break;B=B.slice(3),dr("/**",3)}if(q.type==="bos"&&Ir()){C.type="globstar",C.value+=P,C.output=O(r),$.output=C.output,$.globstar=!0,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&!Lt&&Ir()){$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=O(r)+(r.strictSlashes?")":"|$)"),C.value+=P,$.globstar=!0,$.output+=q.output+C.output,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&B[0]==="/"){let $i=B[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=`${O(r)}${f}|${f}${$i})`,C.value+=P,$.output+=q.output+C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}if(q.type==="bos"&&B[0]==="/"){C.type="globstar",C.value+=P,C.output=`(?:^|${f}|${O(r)}${f})`,$.output=C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-C.output.length),C.type="globstar",C.output=O(r),C.value+=P,$.output+=C.output,$.globstar=!0,dr(P);continue}let ht={type:"star",value:P,output:D};if(r.bash===!0){ht.output=".*?",(C.type==="bos"||C.type==="slash")&&(ht.output=T+ht.output),de(ht);continue}if(C&&(C.type==="bracket"||C.type==="paren")&&r.regex===!0){ht.output=P,de(ht);continue}($.index===$.start||C.type==="slash"||C.type==="dot")&&(C.type==="dot"?($.output+=g,C.output+=g):r.dot===!0?($.output+=b,C.output+=b):($.output+=T,C.output+=T),se()!=="*"&&($.output+=p,C.output+=p)),de(ht)}for(;$.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(zl("closing","]"));$.output=sn.escapeLast($.output,"["),Yr("brackets")}for(;$.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(zl("closing",")"));$.output=sn.escapeLast($.output,"("),Yr("parens")}for(;$.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(zl("closing","}"));$.output=sn.escapeLast($.output,"{"),Yr("braces")}if(r.strictSlashes!==!0&&(C.type==="star"||C.type==="bracket")&&de({type:"maybe_slash",value:"",output:`${f}?`}),$.backtrack===!0){$.output="";for(let B of $.tokens)$.output+=B.output!=null?B.output:B.value,B.suffix&&($.output+=B.suffix)}return $};FP.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(jv,r.maxLength):jv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=YJ[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=_p.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=T=>T.noglobstar===!0?_:`(${g}(?:(?!${p}${T.dot?c:o}).)*?)`,x=T=>{switch(T){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${S(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${S(r)}${s})?${o}${a}${_}`;default:{let A=/^(.*?)\.(\w+)$/.exec(T);if(!A)return;let D=x(A[1]);return D?D+o+A[2]:void 0}}},w=sn.removePrefix(t,b),O=x(w);return O&&r.strictSlashes!==!0&&(O+=`${s}?`),O};e8.exports=FP});var i8=v((zut,n8)=>{"use strict";var XAe=JJ(),LP=t8(),r8=gp(),QAe=hp(),eTe=t=>t&&typeof t=="object"&&!Array.isArray(t),Rt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Rt(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=eTe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?Rt.compileRe(t,e):Rt.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Rt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Rt.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};Rt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?r8.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Rt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Rt.matchBase=(t,e,r)=>(e instanceof RegExp?e:Rt.makeRe(e,r)).test(r8.basename(t));Rt.isMatch=(t,e,r)=>Rt(e,r)(t);Rt.parse=(t,e)=>Array.isArray(t)?t.map(r=>Rt.parse(r,e)):LP(t,{...e,fastpaths:!1});Rt.scan=(t,e)=>XAe(t,e);Rt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Rt.toRegex(a,e);return n===!0&&(c.state=t),c};Rt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=LP.fastpaths(t,e)),i.output||(i=LP(t,e)),Rt.compileRe(i,e,r,n)};Rt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Rt.constants=QAe;n8.exports=Rt});var c8=v((Uut,a8)=>{"use strict";var o8=i8(),tTe=gp();function s8(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:tTe.isWindows()}),o8(t,e,r)}Object.assign(s8,o8);a8.exports=s8});import{readdir as rTe,readdirSync as nTe,realpath as iTe,realpathSync as oTe,stat as sTe,statSync as aTe}from"fs";import{isAbsolute as cTe,posix as Ha,resolve as lTe}from"path";import{fileURLToPath as uTe}from"url";function pTe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&fTe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>Ha.relative(t,n)||".":n=>Ha.relative(t,`${e}/${n}`)||"."}function gTe(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=Ha.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function f8(t){var e;let r=Ul.default.scan(t,yTe);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function xTe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Ul.default.scan(t);return r.isGlob||r.negated}function bp(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function p8(t){return typeof t=="string"?[t]:t??[]}function zP(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=wTe(o);s=cTe(s.replace(kTe,""))?Ha.relative(a,s):Ha.normalize(s);let c=(i=$Te.exec(s))===null||i===void 0?void 0:i[0],l=f8(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?Ha.join(o,...d):o}return s}function ETe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(zP(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(zP(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(zP(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function ATe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=ETe(t,e,n);t.debug&&bp("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(u8,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Ul.default)(i.match,f),m=(0,Ul.default)(i.ignore,f),h=pTe(i.match,f),g=l8(r,d,o),b=o?g:l8(r,d,!0),_=(w,O)=>{let T=b(O,!0);return T!=="."&&!h(T)||m(T)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let x=new jJ({filters:[a?(w,O)=>{let T=g(w,O),A=p(T)&&!m(T);return A&&bp(`matched ${T}`),A}:(w,O)=>{let T=g(w,O);return p(T)&&!m(T)}],exclude:a?(w,O)=>{let T=_(w,O);return bp(`${T?"skipped":"crawling"} ${O}`),T}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:S,signal:t.signal}).crawl(d);return t.debug&&bp("internal properties:",{...n,root:d}),[x,r!==d&&!o&&gTe(r,d)]}function TTe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function RTe(t){let e={...OTe,...t};return e.cwd=(e.cwd instanceof URL?uTe(e.cwd):lTe(e.cwd)).replace(u8,"/"),e.ignore=p8(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||rTe,readdirSync:e.fs.readdirSync||nTe,realpath:e.fs.realpath||iTe,realpathSync:e.fs.realpathSync||oTe,stat:e.fs.stat||sTe,statSync:e.fs.statSync||aTe}),e.debug&&bp("globbing with options:",e),e}function ITe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=dTe(t)||typeof t=="string",i=p8((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=RTe(n?e:t);return i.length>0?ATe(o,i):[]}function ys(t,e){let[r,n]=ITe(t,e);return r?TTe(r.sync(),n):[]}var Ul,dTe,u8,d8,fTe,mTe,hTe,yTe,_Te,bTe,vTe,STe,wTe,$Te,kTe,OTe,vp=y(()=>{MJ();Ul=St(c8(),1),dTe=Array.isArray,u8=/\\/g,d8=process.platform==="win32",fTe=/^(\/?\.\.)+$/;mTe=/^[A-Z]:\/$/i,hTe=d8?t=>mTe.test(t):t=>t==="/";yTe={parts:!0};_Te=/(?t.replace(_Te,"\\$&"),STe=t=>t.replace(bTe,"\\$&"),wTe=d8?STe:vTe;$Te=/^(\/?\.\.)+/,kTe=/\\(?=[()[\]{}!*+?@|])/g;OTe={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as Sp,readFileSync as PTe,readdirSync as CTe,statSync as m8}from"node:fs";import{join as Ga}from"node:path";function DTe(t){let{cwd:e="."}=t,r,n;try{let c=H(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=ji(e,n),o=[],{layers:s,forbiddenImports:a}=UP(r);return(s.size>0||a.length>0)&&!Sp(Ga(e,i.mainRoot))?[{detector:wp,severity:"info",path:`${i.mainRoot}/`,message:`architecture layers declared but ${i.mainRoot}/ not found \u2014 layer checks skipped (flat layout not yet supported)`}]:(s.size>0&&(NTe(e,i,s,o),jTe(e,i,s,o)),a.length>0&&MTe(e,i,a,o),o)}function UP(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function NTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of CTe(o)){let a=Ga(o,s);m8(a).isDirectory()&&(r.has(s)||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function jTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of r){let a=Ga(o,s);Sp(a)&&m8(a).isDirectory()||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function MTe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Ga(t,i,s.from);if(!Sp(a))continue;let c=ys([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Ga(a,l),d;try{d=PTe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];FTe(p,s.to,e.importStyle)&&n.push({detector:wp,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function FTe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var wp,h8,qP=y(()=>{"use strict";vp();Be();Ba();wp="ARCHITECTURE_FROM_SPEC";h8={name:wp,run:DTe}});import{existsSync as LTe,readFileSync as zTe}from"node:fs";import{join as UTe}from"node:path";function BTe(t){let{cwd:e="."}=t,r=UTe(e,"spec/capabilities.yaml");if(!LTe(r))return[];let n;try{let u=zTe(r,"utf8"),d=g8.default.parse(u);if(!d||typeof d!="object")return[];n=d}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o,s=!1;try{let u=H(e);o=new Set(u.features.map(d=>d.id)),s=u.project.onboarding_seeded===!0}catch{return[]}let a=[],c=new Set,l=s&&o.size{"use strict";g8=St(Qt(),1);Be();Mv="CAPABILITIES_FEATURE_MAPPING",qTe=8;y8={name:Mv,run:BTe}});import{existsSync as HTe,readFileSync as GTe}from"node:fs";import{join as ZTe}from"node:path";function VTe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")}function WTe(t){let{cwd:e="."}=t;return ge(e,BP,r=>KTe(r,e))}function KTe(t,e){let r=ji(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=ZTe(e,o);if(!HTe(s))continue;let a=GTe(s,"utf8");VTe(a)||n.push({detector:BP,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var BP,b8,v8=y(()=>{"use strict";Ba();wt();BP="CONVENTION_DRIFT";b8={name:BP,run:WTe}});import{existsSync as HP,readFileSync as S8}from"node:fs";import{join as Fv}from"node:path";function JTe(t){return JSON.parse(t).total?.lines?.pct??0}function w8(t){let e=/]*\bline-rate="([0-9]*\.?[0-9]+)"/.exec(t);return e?Number(e[1])*100:null}function QTe(t,e){if(!wv(dt(t).gates.coverage?.cmd))return null;let r;try{r=xv(t,e)}catch(c){return[{detector:xo,severity:"error",message:c.message}]}let n=0,i=0,o=0,s=[];for(let c of r){let l=SP.find(d=>HP(Fv(c.dir,d)));if(!l){s.push(c.path);continue}let u=w8(S8(Fv(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:xo,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=x8(n,i);return a0?[{detector:xo,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function eOe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let a=QTe(e,t.focusModules);if(a)return a}let r;try{r=H(e).project?.language}catch{}let n=ji(e,r),i=dt(e).language==="kotlin"?SP.find(a=>HP(Fv(e,a)))??iJ(e):n.coverageSummary,o=Fv(e,i);if(!HP(o))return[{detector:xo,severity:"info",message:`${i} not present \u2014 run stage_2.2 first`}];let s;try{let a=S8(o,"utf8");s=n.coverageFormat==="jacoco-xml"?YTe(a):n.coverageFormat==="cobertura-xml"?XTe(a):JTe(a)}catch(a){return[{detector:xo,severity:"warn",message:`${i} unparseable: ${a.message}`}]}return s===null?n.coverageFormat==="cobertura-xml"?[]:[{detector:xo,severity:"warn",message:`${i} contained no line-coverage counter`}]:s>=Lv?[]:[{detector:xo,severity:"warn",message:`line coverage ${s.toFixed(1)}% < floor ${Lv}%`}]}var xo,Lv,$8,k8=y(()=>{"use strict";Be();Ev();Ba();$v();on();xo="COVERAGE_DROP",Lv=70;$8={name:xo,run:eOe}});import{existsSync as tOe}from"node:fs";import{join as rOe}from"node:path";function iOe(t){let{cwd:e="."}=t;return ge(e,zv,r=>oOe(r,e))}function oOe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);if(!r){if(n.length===0)return[];let i=t.project.onboarding_seeded===!0&&t.features.length{"use strict";wt();zv="DELIVERABLE_INTEGRITY",nOe=8;E8={name:zv,run:iOe}});function sOe(t){let e=new Set((t.features??[]).map(n=>n.id)),r=[];for(let n of t.project?.smoke??[]){let i=n.feature;if(i===void 0||e.has(i))continue;let o=(n.run??[]).join(" ")||`kind:${n.kind}`;r.push({detector:Uv,severity:"warn",path:"spec.yaml",message:`smoke probe '${o}' binds feature ${i}, which is not in the spec \u2014 a dangling binding is annotation drift (the bound feature was renamed, archived, or never existed). Fix the id or drop the binding.`})}return r}function aOe(t){let e=sOe(t),r=(t.features??[]).filter(o=>o.status==="done");return r.length===0||!!!t.project?.deliverable||(t.project?.smoke??[]).length>0?e:[...e,{detector:Uv,severity:"warn",path:"spec.yaml",message:`${r.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function cOe(t){let{cwd:e="."}=t;return ge(e,Uv,r=>aOe(r))}var Uv,T8,O8=y(()=>{"use strict";wt();Uv="SMOKE_PROBE_DEMAND";T8={name:Uv,run:cOe}});function lOe(t){let{cwd:e="."}=t;return ge(e,qv,r=>uOe(r,e))}function uOe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=as(e);if(n===null)return[{detector:qv,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=q_(n,e,o);s.state!=="fresh"&&i.push({detector:qv,severity:"warn",path:"spec/attestation.yaml",message:s.state==="unattested"?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:s.module?`${o.id}'s module ${s.module} changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var qv,Bv,GP=y(()=>{"use strict";gl();wt();qv="STALE_ATTESTATION";Bv={name:qv,run:lOe}});function dOe(t){let{cwd:e="."}=t,r;try{r=H(e)}catch{return[]}return fOe(r)}function fOe(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:R8,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var R8,Hv,ZP=y(()=>{"use strict";Be();R8="DEPENDENCY_CYCLE";Hv={name:R8,run:dOe}});import{appendFileSync as pOe,existsSync as I8,mkdirSync as mOe,readFileSync as hOe}from"node:fs";import{dirname as gOe,join as yOe}from"node:path";function P8(t){return yOe(t,_Oe,bOe)}function C8(t){return VP.add(t),()=>VP.delete(t)}function Za(t,e){let r=P8(t),n=gOe(r);I8(n)||mOe(n,{recursive:!0}),pOe(r,`${JSON.stringify(e)} -`,"utf8");for(let i of VP)try{i(t,e)}catch{}}function Rn(t){let e=P8(t);if(!I8(e))return[];let r=hOe(e,"utf8").trim();return r.length===0?[]:r.split(` -`).filter(n=>n.length>0).map(n=>JSON.parse(n))}var _Oe,bOe,VP,ri=y(()=>{"use strict";_Oe=".cladding",bOe="audit.log.jsonl";VP=new Set});import{existsSync as vOe}from"node:fs";import{join as SOe}from"node:path";function wOe(t){let{cwd:e="."}=t,r=Rn(e);if(r.length===0)return[{detector:WP,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=[];for(let i of r)i.artifact&&(vOe(SOe(e,i.artifact))||n.push({detector:WP,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var WP,D8,N8=y(()=>{"use strict";ri();WP="EVIDENCE_MISMATCH";D8={name:WP,run:wOe}});import{existsSync as xOe,readFileSync as $Oe}from"node:fs";import{join as kOe}from"node:path";function EOe(t){let e=kOe(t,L8);if(!xOe(e))return null;try{let n=((0,F8.parse)($Oe(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*M8(t,e){for(let r of t??[])r.startsWith(j8)&&(yield{ref:r,name:r.slice(j8.length),field:e})}function AOe(t){let{cwd:e="."}=t,r=EOe(e);if(r===null)return[];let n;try{n=H(e)}catch(o){return[{detector:KP,severity:"info",message:`spec.yaml not loaded: ${o.message}`}]}let i=[];for(let o of n.features)for(let s of o.acceptance_criteria??[]){let a=[...M8(s.evidence_refs,"evidence_refs"),...M8(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:KP,severity:"warn",path:L8,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var F8,KP,j8,L8,z8,U8=y(()=>{"use strict";F8=St(Qt(),1);Be();KP="FIXTURE_REFERENCE_INVALID",j8="fixture:",L8="conformance/fixtures.yaml";z8={name:KP,run:AOe}});import{existsSync as ql,readFileSync as JP}from"node:fs";import{join as Va}from"node:path";function TOe(t){return ys(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec|spec-first-window)\.ts$/.test(r)).length}function xp(t){if(!ql(t))return null;try{return JSON.parse(JP(t,"utf8"))}catch{return null}}function OOe(t,e){let r=Va(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(JP(r,"utf8"))}catch(c){e.push({detector:$o,severity:"info",message:`plugin.json not loaded: ${c.message}`});return}let i=n.ironclad?.current?.detectors;if(!i)return;let o=i.match(/^(\d+)\/(\d+)$/);if(!o){e.push({detector:$o,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=TOe(t);s!==a&&e.push({detector:$o,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function ROe(t,e){for(let r of q8){let n=Va(t,r.path);if(!ql(n))continue;let i=xp(n);if(!i){e.push({detector:$o,severity:"warn",message:`${r.host}: ${r.path} could not be parsed as JSON`});continue}for(let o of r.required)(i[o]===void 0||i[o]===null||i[o]==="")&&e.push({detector:$o,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function IOe(t,e){let r=xp(Va(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of q8){let s=Va(t,o.path);if(!ql(s))continue;let a=xp(s);a?.version&&a.version!==n&&e.push({detector:$o,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=Va(t,".claude-plugin","marketplace.json");if(ql(i)){let o=xp(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:$o,severity:"error",message:`marketplace: .claude-plugin/marketplace.json plugin '${s.name??"?"}' version='${s.version}' but package.json version='${n}' \u2014 the catalog advertises a stale version; bump it in lockstep`})}}function POe(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function COe(t,e){let r=Va(t,"src","cli","clad.ts"),n=Va(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!ql(r)||!ql(n))return;let i=POe(JP(r,"utf8"));if(i.length===0)return;let s=xp(n)?.ironclad?.current?.["stages-implemented"];if(!Array.isArray(s))return;let a=new Set(i),c=new Set(s),l=i.filter(f=>!c.has(f)),u=s.filter(f=>!a.has(f));if(l.length===0&&u.length===0)return;let d=[l.length?`missing [${l.join(", ")}]`:"",u.length?`unexpected [${u.join(", ")}]`:""].filter(Boolean).join("; ");e.push({detector:$o,severity:"error",message:`plugins/claude-code/.claude-plugin/plugin.json stages-implemented disagrees with TIER_STAGES.all (src/cli/clad.ts): ${d} \u2014 run \`npm run build:plugin\` to re-derive`})}function DOe(t){let{cwd:e="."}=t,r=[];return OOe(e,r),COe(e,r),ROe(e,r),IOe(e,r),r}var $o,q8,B8,H8=y(()=>{"use strict";vp();$o="HARNESS_INTEGRITY",q8=[{host:"claude-code",path:"plugins/claude-code/.claude-plugin/plugin.json",required:["name","version"]},{host:"codex",path:"plugins/codex/.codex-plugin/plugin.json",required:["name","version","description"]},{host:"gemini-cli",path:"plugins/gemini-cli/gemini-extension.json",required:["name","version"]}];B8={name:$o,run:DOe}});import{existsSync as NOe,readFileSync as jOe}from"node:fs";import{join as MOe}from"node:path";function LOe(t){let{cwd:e="."}=t;return ge(e,Gv,r=>UOe(r,e))}function zOe(t){let e=MOe(t,"spec/capabilities.yaml");if(!NOe(e))return!1;try{let r=G8.default.parse(jOe(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function UOe(t,e){let r=t.features.length;if(r{"use strict";G8=St(Qt(),1);wt();Gv="HOLLOW_GOVERNANCE",FOe=8;Z8={name:Gv,run:LOe}});import{existsSync as W8,readFileSync as K8}from"node:fs";import{join as J8}from"node:path";function Y8(t,e){let r=t.match(e);if(!r)return null;try{let n=JSON.parse(r[1]),i={};for(let[o,s]of Object.entries(n))typeof s=="string"&&(i[o]=s);return i}catch{return null}}function HOe(t){switch(t){case"fail":case"wiring-fail":return 0;case"wiring-ok":case"wiring-only":return 1;case"verified":return 2;default:return null}}function GOe(t){switch(t){case"wiring-only":return 1;case"verified":return 2;default:return null}}function ZOe(t){let e=J8(t,"README.md"),r=J8(t,"docs","dogfood","matrix.md");if(!W8(e)||!W8(r))return[];let n=Y8(K8(e,"utf8"),qOe),i=Y8(K8(r,"utf8"),BOe);if(!n||!i)return[];let o=[];for(let[s,a]of Object.entries(n)){let c=GOe(a);if(c===null)continue;let l=i[s]??"not-run",u=HOe(l);u!==null&&c>u&&o.push({detector:X8,severity:"warn",path:"README.md",message:`README host-claims: '${s}' claims '${a}' but the newest matrix evidence is '${l}' \u2014 the claim exceeds the evidence. Re-run \`clad doctor --hosts\` (with consent) or lower the README claim for '${s}'.`})}return o}function VOe(t){let{cwd:e="."}=t;return ZOe(e)}var X8,qOe,BOe,Q8,e5=y(()=>{"use strict";X8="HOST_CLAIM_DRIFT",qOe=//,BOe=//;Q8={name:X8,run:VOe}});function WOe(t){let{cwd:e="."}=t,r;try{r=H(e)}catch{return[]}let n=[];return t5(r.features.map(i=>i.id),"feature","spec/features/",n),t5((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function t5(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:r5,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var r5,n5,i5=y(()=>{"use strict";Be();r5="ID_COLLISION";n5={name:r5,run:WOe}});import{existsSync as $p,readFileSync as YP,readdirSync as XP,statSync as KOe,writeFileSync as s5}from"node:fs";import{join as ko}from"node:path";function o5(t){if(!$p(t))return 0;try{return XP(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function JOe(t){if(!$p(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=XP(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=ko(n,o),a;try{a=KOe(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function YOe(t){let e=ko(t,"spec","capabilities.yaml");if(!$p(e))return 0;try{let r=Zv.default.parse(YP(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function _s(t="."){let e=o5(ko(t,"spec","features")),r=o5(ko(t,"spec","scenarios")),n=YOe(t),i=JOe(ko(t,"tests"));return{features:e,scenarios:r,capabilities:n,test_files:i}}function Bl(t,e){let r=ko(t,"spec.yaml");if(!$p(r))return;let n=YP(r,"utf8"),i=XOe(n,e);i!==n&&s5(r,i)}function XOe(t,e){let r=t.includes(`\r + if (condition) { yield value; }`)}});import{Buffer as zxe}from"node:buffer";import{StringDecoder as Uxe}from"node:string_decoder";var ev,qxe,Bxe,Hxe,yI=y(()=>{nn();ev=(t,e,r)=>{if(r)return;if(t)return{transform:qxe.bind(void 0,new TextEncoder)};let n=new Uxe(e);return{transform:Bxe.bind(void 0,n),final:Hxe.bind(void 0,n)}},qxe=function*(t,e){zxe.isBuffer(e)?yield _o(e):typeof e=="string"?yield t.encode(e):yield e},Bxe=function*(t,e){yield qt(e)?t.write(e):e},Hxe=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as JW}from"node:util";var _I,tv,YW,Gxe,XW,Zxe,QW=y(()=>{_I=JW(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),tv=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Zxe}=e[r];for await(let i of n(t))yield*tv(i,e,r+1)},YW=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Gxe(r,Number(e),t)},Gxe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*tv(n,r,e+1)},XW=JW(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Zxe=function*(t){yield t}});var bI,e3,Ma,op,Vxe,Wxe,vI=y(()=>{bI=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},e3=(t,e)=>[...e.flatMap(r=>[...Ma(r,t,0)]),...op(t)],Ma=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Wxe}=e[r];for(let i of n(t))yield*Ma(i,e,r+1)},op=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Vxe(r,Number(e),t)},Vxe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ma(n,r,e+1)},Wxe=function*(t){yield t}});import{Transform as Kxe,getDefaultHighWaterMark as t3}from"node:stream";var SI,rv,r3,nv=y(()=>{Sr();Qb();KW();yI();QW();vI();SI=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=r3(t,s,o),l=ja(e),u=ja(r),d=l?_I.bind(void 0,tv,a):bI.bind(void 0,Ma),f=l||u?_I.bind(void 0,YW,a):bI.bind(void 0,op),p=l||u?XW.bind(void 0,a):void 0;return{stream:new Kxe({writableObjectMode:n,writableHighWaterMark:t3(n),readableObjectMode:i,readableHighWaterMark:t3(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},rv=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=r3(s,r,a);t=e3(c,t)}return t},r3=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:ZW(n,a)},ev(r,s,n),Xb(r,o,n,c),{transform:t,final:e},{transform:VW(i,a)},GW({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var n3,Jxe,Yxe,Xxe,Qxe,i3=y(()=>{nv();nn();Sr();n3=(t,e)=>{for(let r of Jxe(t))Yxe(t,r,e)},Jxe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Yxe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ps[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>Xxe(a,n));r.input=Bf(s)},Xxe=(t,e)=>{let r=rv(t,e,"utf8",!0);return Qxe(r),Bf(r)},Qxe=t=>{let e=t.find(r=>typeof r!="string"&&!qt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var iv,e0e,t0e,o3,s3,r0e,a3,wI=y(()=>{Pa();Sr();kl();ls();iv=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&$l(r,n)&&!on.has(e)&&e0e(n)&&(t.some(({type:i,value:o})=>i==="native"&&t0e.has(o))||t.every(({type:i})=>On.has(i))),e0e=t=>t===1||t===2,t0e=new Set(["pipe","overlapped"]),o3=async(t,e,r,n)=>{for await(let i of t)r0e(e)||a3(i,r,n)},s3=(t,e,r)=>{for(let n of t)a3(n,e,r)},r0e=t=>t._readableState.pipes.length>0,a3=(t,e,r)=>{let n=nb(t);Pi({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as n0e,appendFileSync as i0e}from"node:fs";var c3,o0e,s0e,a0e,c0e,l0e,l3=y(()=>{wI();nv();Qb();nn();Sr();Na();c3=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>o0e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},o0e=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=VV(t,o,d),p=_o(f),{stdioItems:m,objectMode:h}=e[r],g=s0e([p],m,c,n),{serializedResult:b,finalResult:_=b}=a0e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});c0e({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&l0e(b,m,i),S}catch(x){return n.error=x,S}},s0e=(t,e,r,n)=>{try{return rv(t,e,r,!1)}catch(i){return n.error=i,t}},a0e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Bf(t)};let s=MG(t,r);return n[o]?{serializedResult:s,finalResult:gI(s,!i[o],e)}:{serializedResult:s}},c0e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!iv({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=gI(t,!1,s);try{s3(a,e,n)}catch(c){r.error??=c}},l0e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>Kb.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?i0e(n,t):(r.add(o),n0e(n,t))}}});var u3,d3=y(()=>{nn();ip();u3=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,xo(e,r,"all")]:Array.isArray(e)?[xo(t,r,"all"),...e]:qt(t)&&qt(e)?dR([t,e]):`${t}${e}`}});import{once as xI}from"node:events";var f3,u0e,p3,m3,d0e,$I,kI=y(()=>{Ra();f3=async(t,e)=>{let[r,n]=await u0e(t);return e.isForcefullyTerminated??=!1,[r,n]},u0e=async t=>{let[e,r]=await Promise.allSettled([xI(t,"spawn"),xI(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?p3(t):r.value},p3=async t=>{try{return await xI(t,"exit")}catch{return p3(t)}},m3=async t=>{let[e,r]=await t;if(!d0e(e,r)&&$I(e,r))throw new ei;return[e,r]},d0e=(t,e)=>t===void 0&&e===void 0,$I=(t,e)=>t!==0||e!==null});var h3,f0e,g3=y(()=>{Ra();Na();kI();h3=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=f0e(t,e,r),s=o?.code==="ETIMEDOUT",a=ZV(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},f0e=(t,e,r)=>t!==void 0?t:$I(e,r)?new ei:void 0});import{spawnSync as p0e}from"node:child_process";var y3,m0e,h0e,g0e,ov,y0e,_0e,b0e,v0e,_3=y(()=>{vR();WR();KR();np();Zb();qW();ip();i3();l3();Na();d3();g3();y3=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=m0e(t,e,r),d=y0e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return jl(d,c,l)},m0e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=sb(t,e,r),a=h0e(r),{file:c,commandArguments:l,options:u}=Cb(t,e,a);g0e(u);let d=zW(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},h0e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,g0e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&ov("ipcInput"),t&&ov("ipc: true"),r&&ov("detached: true"),n&&ov("cancelSignal")},ov=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},y0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=_0e({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=h3(c,r),{output:m,error:h=l}=c3({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>xo(_,r,S)),b=xo(u3(m,r),r,"all");return v0e({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},_0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{n3(o,r);let a=b0e(r);return p0e(...Db(t,e,a))}catch(a){return Nl({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},b0e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Hb(e)}),v0e=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?Gb({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):rp({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as EI,on as S0e}from"node:events";var b3,w0e,x0e,$0e,k0e,v3=y(()=>{Rl();Yf();Jf();b3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(Tl({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Eb(t)}),w0e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),w0e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{bb(e,i);let o=fs(t,e,r),s=new AbortController;try{return await Promise.race([x0e(o,n,s),$0e(o,r,s),k0e(o,r,s)])}catch(a){throw Ol(t),a}finally{s.abort(),vb(e,i)}},x0e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await EI(t,"message",{signal:r});return n}for await(let[n]of S0e(t,"message",{signal:r}))if(e(n))return n},$0e=async(t,e,{signal:r})=>{await EI(t,"disconnect",{signal:r}),I9(e)},k0e=async(t,e,{signal:r})=>{let[n]=await EI(t,"strict:error",{signal:r});throw hb(n,e)}});import{once as w3,on as E0e}from"node:events";var x3,AI,A0e,T0e,O0e,S3,TI=y(()=>{Rl();Yf();Jf();x3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>AI({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),AI=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{Tl({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Eb(t)}),bb(e,o);let s=fs(t,e,r),a=new AbortController,c={};return A0e(t,s,a),T0e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),O0e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},A0e=async(t,e,r)=>{try{await w3(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},T0e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await w3(t,"strict:error",{signal:r.signal});n.error=hb(i,e),r.abort()}catch{}},O0e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of E0e(r,"message",{signal:o.signal}))S3(s),yield c}catch{S3(s)}finally{o.abort(),vb(e,a),n||Ol(t),i&&await t}},S3=({error:t})=>{if(t)throw t}});import $3 from"node:process";var k3,E3,A3,OI=y(()=>{Ib();v3();TI();$b();k3=(t,{ipc:e})=>{Object.assign(t,A3(t,!1,e))},E3=()=>{let t=$3,e=!0,r=$3.channel!==void 0;return{...A3(t,e,r),getCancelSignal:oV.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},A3=(t,e,r)=>({sendMessage:Rb.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:b3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:x3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as R0e}from"node:child_process";import{PassThrough as I0e,Readable as P0e,Writable as C0e,Duplex as D0e}from"node:stream";var T3,N0e,sp,j0e,M0e,F0e,L0e,O3=y(()=>{Yb();np();Zb();T3=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{pI(n);let a=new R0e;N0e(a,n),Object.assign(a,{readable:j0e,writable:M0e,duplex:F0e});let c=Nl({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=L0e(c,s,i);return{subprocess:a,promise:l}},N0e=(t,e)=>{let r=sp(),n=sp(),i=sp(),o=Array.from({length:e.length-3},sp),s=sp(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},sp=()=>{let t=new I0e;return t.end(),t},j0e=()=>new P0e({read(){}}),M0e=()=>new C0e({write(){}}),F0e=()=>new D0e({read(){},write(){}}),L0e=async(t,e,r)=>jl(t,e,r)});import{createReadStream as R3,createWriteStream as I3}from"node:fs";import{Buffer as z0e}from"node:buffer";import{Readable as ap,Writable as U0e,Duplex as q0e}from"node:stream";var C3,cp,P3,B0e,D3=y(()=>{nv();Yb();Sr();C3=(t,e)=>Jb(B0e,t,e,!1),cp=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ps[t]}.`)},P3={fileNumber:cp,generator:SI,asyncGenerator:SI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:q0e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},B0e={input:{...P3,fileUrl:({value:t})=>({stream:R3(t)}),filePath:({value:{file:t}})=>({stream:R3(t)}),webStream:({value:t})=>({stream:ap.fromWeb(t)}),iterable:({value:t})=>({stream:ap.from(t)}),asyncIterable:({value:t})=>({stream:ap.from(t)}),string:({value:t})=>({stream:ap.from(t)}),uint8Array:({value:t})=>({stream:ap.from(z0e.from(t))})},output:{...P3,fileUrl:({value:t})=>({stream:I3(t)}),filePath:({value:{file:t,append:e}})=>({stream:I3(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:U0e.fromWeb(t)}),iterable:cp,asyncIterable:cp,string:cp,uint8Array:cp}}});import{on as H0e,once as N3}from"node:events";import{PassThrough as G0e,getDefaultHighWaterMark as Z0e}from"node:stream";import{finished as F3}from"node:stream/promises";function Fa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)II(i);let e=t.some(({readableObjectMode:i})=>i),r=V0e(t,e),n=new RI({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var V0e,RI,W0e,K0e,J0e,II,Y0e,X0e,Q0e,e$e,t$e,L3,z3,PI,U3,r$e,sv,j3,M3,av=y(()=>{V0e=(t,e)=>{if(t.length===0)return Z0e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},RI=class extends G0e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(II(e),this.#t.has(e))return;this.#t.add(e),this.#n??=W0e(this,this.#t,this.#o);let r=Y0e({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(II(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},W0e=async(t,e,r)=>{sv(t,j3);let n=new AbortController;try{await Promise.race([K0e(t,n),J0e(t,e,r,n)])}finally{n.abort(),sv(t,-j3)}},K0e=async(t,{signal:e})=>{try{await F3(t,{signal:e,cleanup:!0})}catch(r){throw L3(t,r),r}},J0e=async(t,e,r,{signal:n})=>{for await(let[i]of H0e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},II=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Y0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{sv(t,M3);let a=new AbortController;try{await Promise.race([X0e(o,e,a),Q0e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),e$e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),sv(t,-M3)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?PI(t):t$e(t))},X0e=async(t,e,{signal:r})=>{try{await t,r.aborted||PI(e)}catch(n){r.aborted||L3(e,n)}},Q0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await F3(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;z3(s)?i.add(e):U3(t,s)}},e$e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await N3(t,i,{signal:o}),!t.readable)return N3(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},t$e=t=>{t.writable&&t.end()},L3=(t,e)=>{z3(e)?PI(t):U3(t,e)},z3=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",PI=t=>{(t.readable||t.writable)&&t.destroy()},U3=(t,e)=>{t.destroyed||(t.once("error",r$e),t.destroy(e))},r$e=()=>{},sv=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},j3=2,M3=1});import{finished as q3}from"node:stream/promises";var Fl,n$e,CI,i$e,DI,cv=y(()=>{bo();Fl=(t,e)=>{t.pipe(e),n$e(t,e),i$e(t,e)},n$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await q3(t,{cleanup:!0,readable:!0,writable:!1})}catch{}CI(e)}},CI=t=>{t.writable&&t.end()},i$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await q3(e,{cleanup:!0,readable:!1,writable:!0})}catch{}DI(t)}},DI=t=>{t.readable&&t.destroy()}});var B3,o$e,s$e,a$e,c$e,l$e,H3=y(()=>{av();bo();_b();Sr();cv();B3=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>On.has(c)))o$e(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!On.has(c)))a$e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Fa(o);Fl(s,i)}},o$e=(t,e,r,n)=>{r==="output"?Fl(t.stdio[n],e):Fl(e,t.stdio[n]);let i=s$e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},s$e=["stdin","stdout","stderr"],a$e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;c$e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},c$e=(t,{signal:e})=>{Qn(t)&&Ia(t,l$e,e)},l$e=2});var La,G3=y(()=>{La=[];La.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&La.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&La.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var lv,NI,jI,u$e,MI,uv,d$e,FI,LI,zI,Z3,Qst,eat,V3=y(()=>{G3();lv=t=>!!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",NI=Symbol.for("signal-exit emitter"),jI=globalThis,u$e=Object.defineProperty.bind(Object),MI=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(jI[NI])return jI[NI];u$e(jI,NI,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},uv=class{},d$e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),FI=class extends uv{onExit(){return()=>{}}load(){}unload(){}},LI=class extends uv{#t=zI.platform==="win32"?"SIGINT":"SIGHUP";#r=new MI;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of La)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!lv(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of La)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,La.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return lv(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&lv(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},zI=globalThis.process,{onExit:Z3,load:Qst,unload:eat}=d$e(lv(zI)?new LI(zI):new FI)});import{addAbortListener as f$e}from"node:events";var W3,K3=y(()=>{V3();W3=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=Z3(()=>{t.kill()});f$e(n,()=>{i()})}});var Y3,p$e,m$e,J3,h$e,X3=y(()=>{uR();ob();ds();wl();Y3=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=ib(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=p$e(r,n,i),{sourceStream:d,sourceError:f}=h$e(t,l),{options:p,fileDescriptors:m}=Di.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},p$e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=m$e(t,e,...r),a=yb(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},m$e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(J3,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||cR(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=V_(r,...n);return{destination:e(J3)(i,o,s),pipeOptions:s}}if(Di.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},J3=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),h$e=(t,e)=>{try{return{sourceStream:Pl(t,e)}}catch(r){return{sourceError:r}}}});var eK,g$e,UI,Q3,qI=y(()=>{np();cv();eK=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=g$e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw UI({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},g$e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return DI(t),n;if(e!==void 0)return CI(r),e},UI=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Nl({error:t,command:Q3,escapedCommand:Q3,fileDescriptors:e,options:r,startTime:n,isSync:!1}),Q3="source.pipe(destination)"});var tK,rK=y(()=>{tK=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as y$e}from"node:stream/promises";var nK,_$e,b$e,v$e,dv,S$e,w$e,iK=y(()=>{av();_b();cv();nK=(t,e,r)=>{let n=dv.has(e)?b$e(t,e):_$e(t,e);return Ia(t,S$e,r.signal),Ia(e,w$e,r.signal),v$e(e),n},_$e=(t,e)=>{let r=Fa([t]);return Fl(r,e),dv.set(e,r),r},b$e=(t,e)=>{let r=dv.get(e);return r.add(t),r},v$e=async t=>{try{await y$e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}dv.delete(t)},dv=new WeakMap,S$e=2,w$e=1});import{aborted as x$e}from"node:util";var oK,$$e,sK=y(()=>{qI();oK=(t,e)=>t===void 0?[]:[$$e(t,e)],$$e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await x$e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw UI({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var fv,k$e,E$e,aK=y(()=>{yo();X3();qI();rK();iK();sK();fv=(t,...e)=>{if(Ot(e[0]))return fv.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Y3(t,...e),i=k$e({...n,destination:r});return i.pipe=fv.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},k$e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=E$e(t,i);eK({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=nK(e,o,d);return await Promise.race([tK(u),...oK(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},E$e=(t,e)=>Promise.allSettled([t,e])});import{on as A$e}from"node:events";import{getDefaultHighWaterMark as T$e}from"node:stream";var pv,O$e,BI,R$e,lK,HI,cK,I$e,P$e,mv=y(()=>{yI();Qb();vI();pv=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return O$e(e,s),lK({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},O$e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},BI=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;R$e(e,s,t);let a=t.readableObjectMode&&!o;return lK({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},R$e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},lK=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=A$e(t,"data",{signal:e.signal,highWaterMark:cK,highWatermark:cK});return I$e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},HI=T$e(!0),cK=HI,I$e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=P$e({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ma(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*op(a)}},P$e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[ev(t,r,!e),Xb(t,i,!n,{})].filter(Boolean)});import{setImmediate as C$e}from"node:timers/promises";var uK,D$e,N$e,j$e,GI,dK,ZI=y(()=>{Bb();nn();wI();mv();Na();ip();uK=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=D$e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([N$e(t),d]);return}let f=mI(c,r),p=BI({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([j$e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},D$e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!iv({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=BI({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await o3(a,t,r,o)},N$e=async t=>{await C$e(),t.readableFlowing===null&&t.resume()},j$e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await Lb(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await zb(r,{maxBuffer:o})):await qb(r,{maxBuffer:o})}catch(a){return dK(BV({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},GI=async t=>{try{return await t}catch(e){return dK(e)}},dK=({bufferedData:t})=>NG(t)?new Uint8Array(t):t});import{finished as M$e}from"node:stream/promises";var lp,F$e,L$e,z$e,U$e,q$e,VI,hv,fK,gv=y(()=>{lp=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=F$e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],M$e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||U$e(a,e,r,n)}finally{s.abort()}},F$e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&L$e(t,r,n),n},L$e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{z$e(e,r),n.call(t,...i)}},z$e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},U$e=(t,e,r,n)=>{if(!q$e(t,e,r,n))throw t},q$e=(t,e,r,n=!0)=>r.propagating?fK(t)||hv(t):(r.propagating=!0,VI(r,e)===n?fK(t):hv(t)),VI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",hv=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",fK=t=>t?.code==="EPIPE"});var pK,WI,KI=y(()=>{ZI();gv();pK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>WI({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),WI=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=lp(t,e,l);if(VI(l,e)){await u;return}let[d]=await Promise.all([uK({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var mK,hK,B$e,H$e,JI=y(()=>{av();KI();mK=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Fa([t,e].filter(Boolean)):void 0,hK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>WI({...B$e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:H$e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),B$e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},H$e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var gK,yK,_K=y(()=>{kl();ls();gK=t=>$l(t,"ipc"),yK=(t,e)=>{let r=nb(t);Pi({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var bK,vK,SK=y(()=>{Na();_K();So();TI();bK=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=gK(o),a=vo(e,"ipc"),c=vo(r,"ipc");for await(let l of AI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(HV(t,i,c),i.push(l)),s&&yK(l,o);return i},vK=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as G$e}from"node:events";var wK,Z$e,V$e,W$e,xK=y(()=>{Da();BR();DR();qR();bo();Sr();ZI();SK();GR();JI();KI();kI();gv();wK=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:b})=>{let _=f3(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=pK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=hK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),O=[],T=bK({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),A=Z$e(h,t,S),D=V$e(m,S);try{return await Promise.race([Promise.all([{},m3(_),Promise.all(x),w,T,hV(t,d),...A,...D]),g,W$e(t,b),...uV(t,o,f,b),...R9({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...cV({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch($){return f.terminationReason??="other",Promise.all([{error:$},_,Promise.all(x.map(ie=>GI(ie))),GI(w),vK(T,O),Promise.allSettled(A),Promise.allSettled(D)])}},Z$e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:lp(n,i,r)),V$e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>ri(o,{checkOpen:!1})&&!Qn(o)).map(({type:i,value:o,stream:s=o})=>lp(s,n,e,{isSameDirection:On.has(i),stopOnExit:i==="native"}))),W$e=async(t,{signal:e})=>{let[r]=await G$e(t,"error",{signal:e});throw r}});var $K,up,Ll,yv=y(()=>{Il();$K=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),up=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Ci();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Ll=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as kK}from"node:stream/promises";var YI,EK,XI,QI,_v,bv,eP=y(()=>{gv();YI=async t=>{if(t!==void 0)try{await XI(t)}catch{}},EK=async t=>{if(t!==void 0)try{await QI(t)}catch{}},XI=async t=>{await kK(t,{cleanup:!0,readable:!1,writable:!0})},QI=async t=>{await kK(t,{cleanup:!0,readable:!0,writable:!1})},_v=async(t,e)=>{if(await t,e)throw e},bv=(t,e,r)=>{r&&!hv(r)?t.destroy(r):e&&t.destroy()}});import{Readable as K$e}from"node:stream";import{callbackify as J$e}from"node:util";var AK,tP,rP,nP,Y$e,iP,oP,TK,sP=y(()=>{Pa();ds();mv();Il();yv();eP();AK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||on.has(r),{subprocessStdout:a,waitReadableDestroy:c}=tP(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=rP(a,s),{read:f,onStdoutDataDone:p}=nP({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new K$e({read:f,destroy:J$e(oP.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return iP({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},tP=(t,e,r)=>{let n=Pl(t,e),i=up(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},rP=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:HI},nP=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Ci(),s=pv({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){Y$e(this,s,o)},onStdoutDataDone:o}},Y$e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},iP=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await QI(t),await n,await YI(i),await e,r.readable&&r.push(null)}catch(o){await YI(i),TK(r,o)}},oP=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Ll(r,e)&&(TK(t,n),await _v(e,n))},TK=(t,e)=>{bv(t,t.readable,e)}});import{Writable as X$e}from"node:stream";import{callbackify as OK}from"node:util";var RK,aP,cP,Q$e,eke,lP,uP,IK,dP=y(()=>{ds();yv();eP();RK=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=aP(t,r,e),s=new X$e({...cP(n,t,i),destroy:OK(uP.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return lP(n,s),s},aP=(t,e,r)=>{let n=yb(t,e),i=up(r,n,"writableFinal"),o=up(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},cP=(t,e,r)=>({write:Q$e.bind(void 0,t),final:OK(eke.bind(void 0,t,e,r))}),Q$e=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},eke=async(t,e,r)=>{await Ll(r,e)&&(t.writable&&t.end(),await e)},lP=async(t,e,r)=>{try{await XI(t),e.writable&&e.end()}catch(n){await EK(r),IK(e,n)}},uP=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Ll(r,e),await Ll(n,e)&&(IK(t,i),await _v(e,i))},IK=(t,e)=>{bv(t,t.writable,e)}});import{Duplex as tke}from"node:stream";import{callbackify as rke}from"node:util";var PK,nke,CK=y(()=>{Pa();sP();dP();PK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||on.has(r),{subprocessStdout:c,waitReadableDestroy:l}=tP(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=aP(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=rP(c,a),{read:g,onStdoutDataDone:b}=nP({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new tke({read:g,...cP(u,t,d),destroy:rke(nke.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return iP({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),lP(u,_,c),_},nke=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([oP({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),uP({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var fP,ike,DK=y(()=>{Pa();ds();mv();fP=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||on.has(e),s=Pl(t,r),a=pv({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return ike(a,s,t)},ike=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var NK,jK=y(()=>{yv();sP();dP();CK();DK();NK=(t,{encoding:e})=>{let r=$K();t.readable=AK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=RK.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=PK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=fP.bind(void 0,t,e),t[Symbol.asyncIterator]=fP.bind(void 0,t,e,{})}});var MK,oke,ske,FK=y(()=>{MK=(t,e)=>{for(let[r,n]of ske){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},oke=(async()=>{})().constructor.prototype,ske=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(oke,t)])});import{setMaxListeners as ake}from"node:events";import{spawn as cke}from"node:child_process";var LK,lke,uke,dke,fke,pke,zK=y(()=>{Bb();vR();WR();ds();KR();OI();np();Zb();O3();D3();ip();H3();pb();K3();aK();JI();xK();jK();Il();FK();LK=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=lke(t,e,r),{subprocess:f,promise:p}=dke({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=fv.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),MK(f,p),Di.set(f,{options:u,fileDescriptors:d}),f},lke=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=sb(t,e,r),{file:a,commandArguments:c,options:l}=Cb(t,e,r),u=uke(l),d=C3(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},uke=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},dke=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=cke(...Db(t,e,r))}catch(m){return T3({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;ake(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];B3(c,a,l),W3(c,r,l);let d={},f=Ci();c.kill=T9.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=mK(c,r),NK(c,r),k3(c,r);let p=fke({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},fke=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await wK({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map((x,w)=>xo(x,e,w)),_=xo(h,e,"all"),S=pke({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return jl(S,n,e)},pke=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?rp({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Ni,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):Gb({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var vv,mke,hke,UK=y(()=>{yo();So();vv=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,mke(n,t[n],i)]));return{...t,...r}},mke=(t,e,r)=>hke.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,hke=new Set(["env",...hR])});var ms,gke,yke,qK=y(()=>{yo();uR();BG();_3();zK();UK();ms=(t,e,r,n)=>{let i=(s,a,c)=>ms(s,a,r,c),o=(...s)=>gke({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},gke=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Ot(o))return i(t,vv(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=yke({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?y3(a,c,l):LK(a,c,l,i)},yke=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=UG(e)?qG(e,r):[e,...r],[s,a,c]=V_(...o),l=vv(vv(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var BK,HK,GK,_ke,bke,ZK=y(()=>{BK=({file:t,commandArguments:e})=>GK(t,e),HK=({file:t,commandArguments:e})=>({...GK(t,e),isSync:!0}),GK=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=_ke(t);return{file:r,commandArguments:n}},_ke=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(bke)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},bke=/ +/g});var VK,WK,vke,KK,Ske,JK,YK=y(()=>{VK=(t,e,r)=>{t.sync=e(vke,r),t.s=t.sync},WK=({options:t})=>KK(t),vke=({options:t})=>({...KK(t),isSync:!0}),KK=t=>({options:{...Ske(t),...t}}),Ske=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},JK={preferLocal:!0}});var Blt,We,Hlt,Glt,Zlt,Vlt,Wlt,Klt,Jlt,Ylt,Mr=y(()=>{qK();ZK();HR();YK();OI();Blt=ms(()=>({})),We=ms(()=>({isSync:!0})),Hlt=ms(BK),Glt=ms(HK),Zlt=ms(fV),Vlt=ms(WK,{},JK,VK),{sendMessage:Wlt,getOneMessage:Klt,getEachMessage:Jlt,getCancelSignal:Ylt}=E3()});import{existsSync as Sv,statSync as wke}from"node:fs";import{dirname as pP,extname as xke,isAbsolute as XK,join as mP,relative as hP,resolve as wv,sep as $ke}from"node:path";function xv(t){return t==="./gradlew"||t==="gradle"}function kke(t){return(Sv(mP(t,"build.gradle.kts"))||Sv(mP(t,"build.gradle")))&&Sv(mP(t,"gradle.properties"))}function Eke(t,e){let n=hP(t,e).split($ke).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function hs(t,e){return t===":"?`:${e}`:`${t}:${e}`}function Ake(t,e){let r=wv(t,e),n=r;Sv(r)?wke(r).isFile()&&(n=pP(r)):xke(r)!==""&&(n=pP(r));let i=hP(t,n);if(i.startsWith("..")||XK(i))return null;let o=n;for(;;){if(kke(o))return o;if(wv(o)===wv(t))return null;let s=pP(o);if(s===o)return null;let a=hP(t,s);if(a.startsWith("..")||XK(a))return null;o=s}}function $v(t,e){let r=wv(t),n=new Map,i=[];for(let o of e){let s=Ake(r,o);if(!s){i.push(o);continue}let a=Eke(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var kv=y(()=>{"use strict"});import{existsSync as yP,readFileSync as Tke}from"node:fs";import{join as zl}from"node:path";function Ul(t="."){let e=zl(t,".cladding","config.yaml");if(!yP(e))return gP;try{let n=(0,QK.parse)(Tke(e,"utf8"))?.gate;if(!n)return gP;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of Oke){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return gP}}function eJ(t="."){let e=Ul(t).testReport,r=e?[e,..._P]:_P;return[...new Set(r.map(n=>zl(t,n)))]}function tJ(t="."){let e=Ul(t).testReport;if(e){let r=zl(t,e);return yP(r)?r:null}return _P.map(r=>zl(t,r)).find(r=>yP(r))??null}function rJ(t,e){let r=[],n=!1;for(let i of t){let o=Rke.exec(i);if(o){n=!0;for(let s of e)r.push(hs(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var QK,Oke,gP,_P,Rke,dp=y(()=>{"use strict";QK=St(er(),1);kv();Oke=["type","lint","test","coverage"],gP={scope:"feature"},_P=["test-report.junit.xml",zl("coverage","junit.xml"),zl(".cladding","test-report.junit.xml")];Rke=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as vP,readFileSync as nJ,readdirSync as Ike,statSync as Pke}from"node:fs";import{join as Ev}from"node:path";function xP(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=Ev(t,e);if(vP(r))try{if(iJ.test(nJ(r,"utf8")))return!0}catch{}}return!1}function oJ(t){try{return vP(t)&&iJ.test(nJ(t,"utf8"))}catch{return!1}}function sJ(t,e=0){if(e>4||!vP(t))return!1;let r;try{r=Ike(t)}catch{return!1}for(let n of r){let i=Ev(t,n),o=!1;try{o=Pke(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(sJ(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&oJ(i))return!0}return!1}function Nke(t){if(xP(t))return!0;for(let e of Cke)if(oJ(Ev(t,e)))return!0;for(let e of Dke)if(sJ(Ev(t,e)))return!0;return!1}function aJ(t="."){let e=Ul(t).coverage;return e||(Nke(t)?"kover":"jacoco")}function cJ(t="."){return SP[aJ(t)]}function lJ(t="."){return bP[aJ(t)]}var SP,bP,wP,iJ,Cke,Dke,Av=y(()=>{"use strict";dp();SP={kover:"koverXmlReport",jacoco:"jacocoTestReport"},bP={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},wP=[bP.kover,bP.jacoco],iJ=/kover/i;Cke=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],Dke=["buildSrc","build-logic"]});import{existsSync as pp,readFileSync as dJ,readdirSync as fJ}from"node:fs";import{join as gs}from"node:path";function kP(t){return pp(gs(t,"gradlew"))?"./gradlew":"gradle"}function jke(t){let e=kP(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[cJ(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function Mke(t){let e=!1;try{e=/(^|\n)\s*flutter\s*:|sdk:\s*flutter/.test(dJ(gs(t,"pubspec.yaml"),"utf8"))}catch{}let r={cmd:"dart",args:["format","--output=none","--set-exit-if-changed","."]},n={cmd:"gitleaks",args:["detect","--no-banner"]};return e?{type:{cmd:"flutter",args:["analyze"]},lint:r,test:{cmd:"flutter",args:["test"]},coverage:{cmd:"flutter",args:["test","--coverage"]},secret:n}:{type:{cmd:"dart",args:["analyze"]},lint:r,test:{cmd:"dart",args:["test"]},coverage:{cmd:"dart",args:["test","--coverage=coverage"]},secret:n}}function Lke(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function qke(t,e){for(let r of e)if(pp(gs(t,r)))return r}function Bke(t,e){try{return fJ(t).find(n=>n.endsWith(e))}catch{return}}function Zke(t){try{return JSON.parse(dJ(gs(t,"package.json"),"utf8"))}catch{return{}}}function fp(t,e){let r=t.scripts?.[e];return typeof r=="string"&&r.trim().length>0?r.trim():void 0}function uJ(t,e){return[t.dependencies,t.devDependencies,t.optionalDependencies,t.peerDependencies].some(r=>r?.[e]!==void 0)}function Vke(t,e,r){if(fp(r,"lint"))return{cmd:"npm",args:["run","--silent","lint"]};for(let n of Hke)if(n.configs.some(i=>pp(gs(t,i))))return n.gate;if(Gke.some(n=>pp(gs(t,n)))||r.eslintConfig!==void 0)return e}function Kke(t,e){return Wke.some(r=>pp(gs(t,r)))?!0:e.jest!==void 0}function Jke(t){if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?vitest(?:\s+run)?$/i.test(t))return"vitest";if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?jest$/i.test(t))return"jest"}function $P(t,e){let r={...t};return e==="lint"?delete r.lint:delete r.coverage,r}function Yke(t,e){let r=Zke(t),n=e.lint?Vke(t,e.lint,r):void 0,i=n?{...e,lint:n}:$P(e,"lint"),o=fp(r,"test"),s=o?Jke(o):void 0;return o&&!s?(i=$P(i,"coverage"),{...i,test:{cmd:"npm",args:["test"]},...fp(r,"coverage")?{coverage:{cmd:"npm",args:["run","--silent","coverage"]}}:{}}):s==="jest"||!o&&Kke(t,r)?{...i,test:{cmd:"npx",args:[...Mi,"jest"]},coverage:{cmd:"npx",args:[...Mi,"jest","--coverage"]}}:(s==="vitest"&&!fp(r,"coverage")&&!uJ(r,"@vitest/coverage-v8")&&!uJ(r,"@vitest/coverage-istanbul")?i=$P(i,"coverage"):s==="vitest"&&fp(r,"coverage")&&(i={...i,coverage:{cmd:"npm",args:["run","--silent","coverage"]}}),i)}function dt(t="."){for(let e of zke){let r;for(let o of e.manifests)if(o.startsWith(".")?r=Bke(t,o):r=qke(t,[o]),r)break;if(!r||e.requiresSource&&!Lke(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"?Yke(t,n):n;return{language:e.language,manifest:r,gates:i}}return Uke}var Mi,Fke,zke,Uke,Hke,Gke,Wke,sn=y(()=>{"use strict";Av();Mi=["--offline","--no-install"];Fke=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);zke=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:[...Mi,"tsc","--noEmit"]},lint:{cmd:"npx",args:[...Mi,"eslint","."]},test:{cmd:"npx",args:[...Mi,"vitest","run"]},coverage:{cmd:"npx",args:[...Mi,"vitest","run","--coverage"]},secret:{cmd:"npx",args:[...Mi,"secretlint","**/*"]},arch:{cmd:"npx",args:[...Mi,"madge","--circular","--extensions","ts,tsx,js,jsx","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:jke},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"swift",manifests:["Package.swift"],gates:{type:{cmd:"swift",args:["build"]},lint:{cmd:"swiftlint",args:["lint"]},test:{cmd:"swift",args:["test"]},coverage:{cmd:"swift",args:["test","--enable-code-coverage"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dart",manifests:["pubspec.yaml"],gates:Mke}],Uke={language:"unknown",manifest:"",gates:{}};Hke=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:[...Mi,"biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:[...Mi,"oxlint"]}}],Gke=["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts",".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"];Wke=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs","jest.config.json"]});import{existsSync as Xke,readFileSync as Qke}from"node:fs";import{join as eEe}from"node:path";function za(t){return t.code==="ENOENT"}function Tv(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return pJ.test(o)||pJ.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function Nt(t,e,r,n=[]){if(za(r))return{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`};let i=`${String(r.stderr??"")} +${String(r.stdout??"")}`,o=/ENOTCACHED|ENOTFOUND|EAI_AGAIN|canceled due to missing packages|could not determine executable/i.test(i),a=n.find(l=>l!=="--"&&!l.startsWith("-"))?.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=r.exitCode===127&&a!==void 0&&new RegExp(`(?:^|[\\s:])${a}: (?:command )?not found\\b`,"i").test(i);return e==="npx"&&(o||c)?{stage:t,pass:!1,exitCode:2,stderr:"setup gap: 'npx' could not resolve the configured tool without installing it; the inferred tool is not installed or unavailable offline"}:null}function Yt(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function ql(t,e){let r=eEe(t,"package.json");if(!Xke(r))return!1;try{return!!JSON.parse(Qke(r,"utf8")).scripts?.[e]}catch{return!1}}var pJ,Rn=y(()=>{"use strict";pJ=/config (is |file )?not found|no such file|ENOENT|ENOTCACHED|ENOTFOUND|EAI_AGAIN|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function tEe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.arch;if(!n)return[{detector:Ov,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=We(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Ov,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:Tv(i,Ov,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var Ov,Ua,Rv=y(()=>{"use strict";Mr();sn();Rn();Ov="ARCHITECTURE_VIOLATION";Ua={name:Ov,subprocess:!0,run:tEe}});function rEe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.secret;if(!n)return[{detector:Iv,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=We(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Iv,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:Tv(i,Iv,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var Iv,qa,Pv=y(()=>{"use strict";Mr();sn();Rn();Iv="HARDCODED_SECRET";qa={name:Iv,subprocess:!0,run:rEe}});import{existsSync as EP,readdirSync as mJ}from"node:fs";import{join as Cv}from"node:path";function iEe(t,e){let r=Cv(t,e.path);if(!EP(r))return!0;if(e.isDirectory)try{return mJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function oEe(t){let{cwd:e="."}=t,r=[];for(let i of nEe)iEe(e,i)&&r.push({detector:mp,severity:i.severity,path:i.path,message:`${i.path} is absent \u2014 cladding scaffold incomplete (${i.purpose}). Run \`clad init --intent ""\` to populate it.`});let n=Cv(e,"spec.yaml");if(EP(n)){let i=cEe(n),o=i?null:sEe(e);if(i)r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present but unreadable (${i}) \u2014 cladding is governing nothing. Fix the SSoT root, then \`clad sync\` to validate.`});else if(o)r.push({detector:mp,severity:"error",path:o.path,message:`spec shard '${o.path}' is present but unparseable (${o.reason}) \u2014 loadSpec throws on it, so every spec-gated detector silently passes. Fix it, then \`clad sync\`.`});else{let s=aEe(e);s&&r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present and parses, but the assembled spec does not load (${s}) \u2014 every spec-gated detector then degrades to non-blocking info, so the gate would pass GREEN on an unloadable SSoT. Fix it, then \`clad sync\` to validate.`})}}return r}function sEe(t){for(let e of["spec/features","spec/scenarios"]){let r=Cv(t,e);if(!EP(r))continue;let n;try{n=mJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{Oi(Cv(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function aEe(t){try{return B(t),null}catch(e){return e.message}}function cEe(t){let e;try{e=Oi(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var mp,nEe,hJ,gJ=y(()=>{"use strict";Ue();M_();mp="ABSENCE_OF_GOVERNANCE",nEe=[{path:"spec.yaml",severity:"error",purpose:"SSoT root \u2014 every spec-gated detector needs it"},{path:"spec/architecture.yaml",severity:"warn",purpose:"architecture invariants (layers + forbidden_imports)"},{path:"spec/capabilities.yaml",severity:"warn",purpose:"capability \u2194 feature traceability"},{path:"docs/project-context.md",severity:"warn",purpose:"intent narrative + decision history"},{path:"docs/conventions.md",severity:"info",purpose:"project style guide (recommended)"},{path:"spec/scenarios",severity:"info",purpose:"user-journey scenarios (recommended)",isDirectory:!0}];hJ={name:mp,run:oEe}});function Dv(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function AP(t,e){let r=e?.trim()??"";if(!t)return r.length>0?"condition is present but ears pattern is not declared":null;if(t==="ubiquitous")return r.length>0?`ears='ubiquitous' but condition is present ('${r.slice(0,40)}\u2026')`:null;if(t==="complex"){if(r.length===0)return"ears='complex' requires a 'while' precondition and a 'when' trigger \u2014 empty";let i=Dv(r)==="while",o=uEe.test(r);return i?o?null:"ears='complex' requires a 'when' trigger clause after the 'while' precondition \u2014 none found":`ears='complex' requires the condition to start with 'while' (precondition) \u2014 got '${Dv(r)}'`}let n=lEe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:Dv(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${Dv(r)}'`:null}function dEe(t,e){let r=AP(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function yJ(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...dEe(r,n));return e}var lEe,uEe,TP=y(()=>{"use strict";lEe={event:"when",state:"while",optional:"where",unwanted:"if"},uEe=/\bwhen\b/i});function ge(t,e,r){let n;try{n=B(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var wt=y(()=>{"use strict";Ue()});function fEe(t){let{cwd:e="."}=t;return ge(e,Nv,pEe)}function pEe(t){let e=[];for(let r of t.features)for(let n of r.acceptance_criteria??[]){let i=!!n.text?.trim(),o=!!(n.condition?.trim()||n.action?.trim()||n.response?.trim());!i&&!o&&e.push({detector:Nv,severity:"error",message:`${r.id}.${n.id} has neither rendered text nor any EARS field (condition/action/response) \u2014 structurally empty AC`})}for(let r of yJ(t.features))e.push({detector:Nv,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var Nv,_J,bJ=y(()=>{"use strict";TP();wt();Nv="AC_DRIFT";_J={name:Nv,run:fEe}});function Fi(t=".",e){let n=(e??"").trim().toLowerCase()||dt(t).language;return SJ[n]??vJ}var mEe,hEe,gEe,vJ,yEe,_Ee,SJ,bEe,wJ,Ba=y(()=>{"use strict";sn();mEe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,hEe=/^[ \t]*import\s+([\w.]+)/gm,gEe=/^[ \t]*(?:from|import)\s+([\w.]+)/gm,vJ={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:mEe,importStyle:"relative"},yEe={ext:"kt",extensions:[".kt",".kts"],sourceRoots:["src/main/kotlin","src/test/kotlin"],mainRoot:"src/main/kotlin",testGlobs:["src/test/kotlin/**/*Test.kt","src/test/kotlin/**/*Tests.kt"],coverageSummary:"build/reports/jacoco/test/jacocoTestReport.xml",coverageFormat:"jacoco-xml",importMatcher:hEe,importStyle:"dotted"},_Ee={ext:"py",extensions:[".py"],sourceRoots:["."],mainRoot:"src",testGlobs:["tests/test_*.py","tests/**/test_*.py","tests/**/*_test.py"],coverageSummary:"coverage.xml",coverageFormat:"cobertura-xml",importMatcher:gEe,importStyle:"dotted"},SJ={typescript:vJ,kotlin:yEe,python:_Ee},bEe=[".js",".jsx",".mts",".cts",".rs",".go",".java",".rb",".php",".cs",".fs",".ex",".exs"],wJ=new Set([...Object.values(SJ).flatMap(t=>t?.extensions??[]),...bEe].map(t=>t.toLowerCase()))});import{existsSync as vEe,readFileSync as SEe,readdirSync as wEe,statSync as xEe}from"node:fs";import{join as $J,relative as xJ}from"node:path";function $Ee(t,e){if(!vEe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=wEe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=$J(i,s),c;try{c=xEe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function kEe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function AEe(t){return EEe.test(t)}function TEe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=Fi(e,r.project?.language),o=i.sourceRoots.flatMap(a=>$Ee($J(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=SEe(a,"utf8")}catch{continue}let l=c.split(` +`);for(let u=0;u{"use strict";Ue();Ba();kJ="AI_HINTS_FORBIDDEN_PATTERN";EEe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;EJ={name:kJ,run:TEe}});function OEe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:TJ,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var TJ,OJ,RJ=y(()=>{"use strict";Ue();TJ="AC_DUPLICATE_WITHIN_FEATURE";OJ={name:TJ,run:OEe}});import{createRequire as REe}from"module";import{basename as IEe,dirname as RP,normalize as PEe,relative as CEe,resolve as DEe,sep as CJ}from"path";import*as NEe from"fs";function jEe(t){let e=PEe(t);return e.length>1&&e[e.length-1]===CJ&&(e=e.substring(0,e.length-1)),e}function DJ(t,e){return t.replace(MEe,e)}function LEe(t){return t==="/"||FEe.test(t)}function OP(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=DEe(t)),(n||o)&&(t=jEe(t)),t===".")return"";let s=t[t.length-1]!==i;return DJ(s?t+i:t,i)}function NJ(t,e){return e+t}function zEe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:DJ(CEe(t,n),e.pathSeparator)+e.pathSeparator+r}}function UEe(t){return t}function qEe(t,e,r){return e+t+r}function BEe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?zEe(t,e):n?NJ:UEe}function HEe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function GEe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function KEe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?GEe(t):HEe(t):n&&n.length?VEe:ZEe:WEe}function tAe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?eAe:r&&r.length?n?JEe:YEe:n?XEe:QEe}function iAe(t){return t.group?nAe:rAe}function aAe(t){return t.group?oAe:sAe}function uAe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?lAe:cAe}function jJ(t,e,r){if(r.options.useRealPaths)return dAe(e,r);let n=RP(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=RP(n)}return r.symlinks.set(t,e),i>1}function dAe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function jv(t,e,r,n){e(t&&!n?t:null,r)}function vAe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?fAe:gAe:n?e?pAe:bAe:i?e?hAe:_Ae:e?mAe:yAe}function xAe(t){return t?wAe:SAe}function AAe(t,e){return new Promise((r,n)=>{LJ(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function LJ(t,e,r){new FJ(t,e,r).start()}function TAe(t,e){return new FJ(t,e).start()}var IJ,MEe,FEe,ZEe,VEe,WEe,JEe,YEe,XEe,QEe,eAe,rAe,nAe,oAe,sAe,cAe,lAe,fAe,pAe,mAe,hAe,gAe,yAe,_Ae,bAe,MJ,SAe,wAe,$Ae,kAe,EAe,FJ,PJ,zJ,UJ,qJ=y(()=>{IJ=REe(import.meta.url);MEe=/[\\/]/g;FEe=/^[a-z]:[\\/]$/i;ZEe=(t,e)=>{e.push(t||".")},VEe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},WEe=()=>{};JEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},YEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},XEe=(t,e,r,n)=>{r.files++},QEe=(t,e)=>{e.push(t)},eAe=()=>{};rAe=t=>t,nAe=()=>[""].slice(0,0);oAe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},sAe=()=>{};cAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&jJ(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},lAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&jJ(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};fAe=t=>t.counts,pAe=t=>t.groups,mAe=t=>t.paths,hAe=t=>t.paths.slice(0,t.options.maxFiles),gAe=(t,e,r)=>(jv(e,r,t.counts,t.options.suppressErrors),null),yAe=(t,e,r)=>(jv(e,r,t.paths,t.options.suppressErrors),null),_Ae=(t,e,r)=>(jv(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),bAe=(t,e,r)=>(jv(e,r,t.groups,t.options.suppressErrors),null);MJ={withFileTypes:!0},SAe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",MJ,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},wAe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",MJ)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};$Ae=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},kAe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},EAe=class{aborted=!1;abort(){this.aborted=!0}},FJ=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=vAe(e,this.isSynchronous),this.root=OP(t,e),this.state={root:LEe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new kAe,options:e,queue:new $Ae((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new EAe,fs:e.fs||NEe},this.joinPath=BEe(this.root,e),this.pushDirectory=KEe(this.root,e),this.pushFile=tAe(e),this.getArray=iAe(e),this.groupFiles=aAe(e),this.resolveSymlink=uAe(e,this.isSynchronous),this.walkDirectory=xAe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(b.isDirectory()){if(_=OP(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let S=IEe(_),x=OP(RP(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};PJ=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return AAe(this.root,this.options)}withCallback(t){LJ(this.root,this.options,t)}sync(){return TAe(this.root,this.options)}},zJ=null;try{IJ.resolve("picomatch"),zJ=IJ("picomatch")}catch{}UJ=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:CJ,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new PJ(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new PJ(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||zJ;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var hp=v((edt,VJ)=>{"use strict";var BJ="[^\\\\/]",OAe="(?=.)",HJ="[^/]",IP="(?:\\/|$)",GJ="(?:^|\\/)",PP=`\\.{1,2}${IP}`,RAe="(?!\\.)",IAe=`(?!${GJ}${PP})`,PAe=`(?!\\.{0,1}${IP})`,CAe=`(?!${PP})`,DAe="[^.\\/]",NAe=`${HJ}*?`,jAe="/",ZJ={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:OAe,QMARK:HJ,END_ANCHOR:IP,DOTS_SLASH:PP,NO_DOT:RAe,NO_DOTS:IAe,NO_DOT_SLASH:PAe,NO_DOTS_SLASH:CAe,QMARK_NO_DOT:DAe,STAR:NAe,START_ANCHOR:GJ,SEP:jAe},MAe={...ZJ,SLASH_LITERAL:"[\\\\/]",QMARK:BJ,STAR:`${BJ}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},FAe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};VJ.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:FAe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?MAe:ZJ}}});var gp=v(Fr=>{"use strict";var{REGEX_BACKSLASH:LAe,REGEX_REMOVE_BACKSLASH:zAe,REGEX_SPECIAL_CHARS:UAe,REGEX_SPECIAL_CHARS_GLOBAL:qAe}=hp();Fr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Fr.hasRegexChars=t=>UAe.test(t);Fr.isRegexChar=t=>t.length===1&&Fr.hasRegexChars(t);Fr.escapeRegex=t=>t.replace(qAe,"\\$1");Fr.toPosixSlashes=t=>t.replace(LAe,"/");Fr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Fr.removeBackslashes=t=>t.replace(zAe,e=>e==="\\"?"":e);Fr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Fr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Fr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Fr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Fr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var t8=v((rdt,e8)=>{"use strict";var WJ=gp(),{CHAR_ASTERISK:CP,CHAR_AT:BAe,CHAR_BACKWARD_SLASH:yp,CHAR_COMMA:HAe,CHAR_DOT:DP,CHAR_EXCLAMATION_MARK:NP,CHAR_FORWARD_SLASH:QJ,CHAR_LEFT_CURLY_BRACE:jP,CHAR_LEFT_PARENTHESES:MP,CHAR_LEFT_SQUARE_BRACKET:GAe,CHAR_PLUS:ZAe,CHAR_QUESTION_MARK:KJ,CHAR_RIGHT_CURLY_BRACE:VAe,CHAR_RIGHT_PARENTHESES:JJ,CHAR_RIGHT_SQUARE_BRACKET:WAe}=hp(),YJ=t=>t===QJ||t===yp,XJ=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},KAe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,b=!1,_=!1,S=!1,x=!1,w=!1,O=0,T,A,D={value:"",depth:0,isGlob:!1},$=()=>l>=n,ie=()=>c.charCodeAt(l+1),K=()=>(T=A,c.charCodeAt(++l));for(;l0&&(C=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),P=c.slice(d)):m===!0?(xe="",P=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&YJ(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(P&&(P=WJ.removeBackslashes(P)),xe&&_===!0&&(xe=WJ.removeBackslashes(xe)));let Ir={prefix:C,input:t,start:u,base:xe,glob:P,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&(Ir.maxDepth=0,YJ(A)||s.push(D),Ir.tokens=s),r.parts===!0||r.tokens===!0){let se;for(let Ce=0;Ce{"use strict";var _p=hp(),an=gp(),{MAX_LENGTH:Mv,POSIX_REGEX_SOURCE:JAe,REGEX_NON_SPECIAL_CHARS:YAe,REGEX_SPECIAL_CHARS_BACKREF:XAe,REPLACEMENTS:r8}=_p,QAe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>an.escapeRegex(i)).join("..")}return r},Bl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,n8=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},eTe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},i8=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(eTe(e))return e.replace(/\\(.)/g,"$1")},tTe=t=>{let e=t.map(i8).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},rTe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=i8(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?an.escapeRegex(r[0]):`[${r.map(i=>an.escapeRegex(i)).join("")}]`}*`},nTe=t=>{let e=0,r=t.trim(),n=FP(r);for(;n;)e++,r=n.body.trim(),n=FP(r);return e},iTe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:_p.DEFAULT_MAX_EXTGLOB_RECURSION,n=n8(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||tTe(n)))return{risky:!0};for(let i of n){let o=rTe(i);if(o)return{risky:!0,safeOutput:o};if(nTe(i)>r)return{risky:!0}}return{risky:!1}},LP=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=r8[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Mv,r.maxLength):Mv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=_p.globChars(r.windows),l=_p.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:b,QMARK:_,QMARK_NO_DOT:S,STAR:x,START_ANCHOR:w}=c,O=H=>`(${a}(?:(?!${w}${H.dot?m:u}).)*?)`,T=r.dot?"":h,A=r.dot?_:S,D=r.bash===!0?O(r):x;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let $={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=an.removePrefix(t,$),i=t.length;let ie=[],K=[],xe=[],C=o,P,Ir=()=>$.index===i-1,se=$.peek=(H=1)=>t[$.index+H],Ce=$.advance=()=>t[++$.index]||"",Kt=()=>t.slice($.index+1),dr=(H="",ht=0)=>{$.consumed+=H,$.index+=ht},Xt=H=>{$.output+=H.output!=null?H.output:H.value,dr(H.value)},lo=()=>{let H=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)Ce(),$.start++,H++;return H%2===0?!1:($.negated=!0,$.start++,!0)},$i=H=>{$[H]++,xe.push(H)},Xr=H=>{$[H]--,xe.pop()},de=H=>{if(C.type==="globstar"){let ht=$.braces>0&&(H.type==="comma"||H.type==="brace"),q=H.extglob===!0||ie.length&&(H.type==="pipe"||H.type==="paren");H.type!=="slash"&&H.type!=="paren"&&!ht&&!q&&($.output=$.output.slice(0,-C.output.length),C.type="star",C.value="*",C.output=D,$.output+=C.output)}if(ie.length&&H.type!=="paren"&&(ie[ie.length-1].inner+=H.value),(H.value||H.output)&&Xt(H),C&&C.type==="text"&&H.type==="text"){C.output=(C.output||C.value)+H.value,C.value+=H.value;return}H.prev=C,s.push(H),C=H},uo=(H,ht)=>{let q={...l[ht],conditions:1,inner:""};q.prev=C,q.parens=$.parens,q.output=$.output,q.startIndex=$.index,q.tokensIndex=s.length;let Oe=(r.capture?"(":"")+q.open;$i("parens"),de({type:H,value:ht,output:$.output?"":p}),de({type:"paren",extglob:!0,value:Ce(),output:Oe}),ie.push(q)},jde=H=>{let ht=t.slice(H.startIndex,$.index+1),q=t.slice(H.startIndex+2,$.index),Oe=iTe(q,r);if((H.type==="plus"||H.type==="star")&&Oe.risky){let lt=Oe.safeOutput?(H.output?"":p)+(r.capture?`(${Oe.safeOutput})`:Oe.safeOutput):void 0,ki=s[H.tokensIndex];ki.type="text",ki.value=ht,ki.output=lt||an.escapeRegex(ht);for(let Ei=H.tokensIndex+1;Ei1&&H.inner.includes("/")&&(lt=O(r)),(lt!==D||Ir()||/^\)+$/.test(Kt()))&&(ut=H.close=`)$))${lt}`),H.inner.includes("*")&&(zt=Kt())&&/^\.[^\\/.]+$/.test(zt)){let ki=LP(zt,{...e,fastpaths:!1}).output;ut=H.close=`)${ki})${lt})`}H.prev.type==="bos"&&($.negatedExtglob=!0)}de({type:"paren",extglob:!0,value:P,output:ut}),Xr("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let H=!1,ht=t.replace(XAe,(q,Oe,ut,zt,lt,ki)=>zt==="\\"?(H=!0,q):zt==="?"?Oe?Oe+zt+(lt?_.repeat(lt.length):""):ki===0?A+(lt?_.repeat(lt.length):""):_.repeat(ut.length):zt==="."?u.repeat(ut.length):zt==="*"?Oe?Oe+zt+(lt?D:""):D:Oe?q:`\\${q}`);return H===!0&&(r.unescape===!0?ht=ht.replace(/\\/g,""):ht=ht.replace(/\\+/g,q=>q.length%2===0?"\\\\":q?"\\":"")),ht===t&&r.contains===!0?($.output=t,$):($.output=an.wrapOutput(ht,$,e),$)}for(;!Ir();){if(P=Ce(),P==="\0")continue;if(P==="\\"){let q=se();if(q==="/"&&r.bash!==!0||q==="."||q===";")continue;if(!q){P+="\\",de({type:"text",value:P});continue}let Oe=/^\\+/.exec(Kt()),ut=0;if(Oe&&Oe[0].length>2&&(ut=Oe[0].length,$.index+=ut,ut%2!==0&&(P+="\\")),r.unescape===!0?P=Ce():P+=Ce(),$.brackets===0){de({type:"text",value:P});continue}}if($.brackets>0&&(P!=="]"||C.value==="["||C.value==="[^")){if(r.posix!==!1&&P===":"){let q=C.value.slice(1);if(q.includes("[")&&(C.posix=!0,q.includes(":"))){let Oe=C.value.lastIndexOf("["),ut=C.value.slice(0,Oe),zt=C.value.slice(Oe+2),lt=JAe[zt];if(lt){C.value=ut+lt,$.backtrack=!0,Ce(),!o.output&&s.indexOf(C)===1&&(o.output=p);continue}}}(P==="["&&se()!==":"||P==="-"&&se()==="]")&&(P=`\\${P}`),P==="]"&&(C.value==="["||C.value==="[^")&&(P=`\\${P}`),r.posix===!0&&P==="!"&&C.value==="["&&(P="^"),C.value+=P,Xt({value:P});continue}if($.quotes===1&&P!=='"'){P=an.escapeRegex(P),C.value+=P,Xt({value:P});continue}if(P==='"'){$.quotes=$.quotes===1?0:1,r.keepQuotes===!0&&de({type:"text",value:P});continue}if(P==="("){$i("parens"),de({type:"paren",value:P});continue}if(P===")"){if($.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Bl("opening","("));let q=ie[ie.length-1];if(q&&$.parens===q.parens+1){jde(ie.pop());continue}de({type:"paren",value:P,output:$.parens?")":"\\)"}),Xr("parens");continue}if(P==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Bl("closing","]"));P=`\\${P}`}else $i("brackets");de({type:"bracket",value:P});continue}if(P==="]"){if(r.nobracket===!0||C&&C.type==="bracket"&&C.value.length===1){de({type:"text",value:P,output:`\\${P}`});continue}if($.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Bl("opening","["));de({type:"text",value:P,output:`\\${P}`});continue}Xr("brackets");let q=C.value.slice(1);if(C.posix!==!0&&q[0]==="^"&&!q.includes("/")&&(P=`/${P}`),C.value+=P,Xt({value:P}),r.literalBrackets===!1||an.hasRegexChars(q))continue;let Oe=an.escapeRegex(C.value);if($.output=$.output.slice(0,-C.value.length),r.literalBrackets===!0){$.output+=Oe,C.value=Oe;continue}C.value=`(${a}${Oe}|${C.value})`,$.output+=C.value;continue}if(P==="{"&&r.nobrace!==!0){$i("braces");let q={type:"brace",value:P,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};K.push(q),de(q);continue}if(P==="}"){let q=K[K.length-1];if(r.nobrace===!0||!q){de({type:"text",value:P,output:P});continue}let Oe=")";if(q.dots===!0){let ut=s.slice(),zt=[];for(let lt=ut.length-1;lt>=0&&(s.pop(),ut[lt].type!=="brace");lt--)ut[lt].type!=="dots"&&zt.unshift(ut[lt].value);Oe=QAe(zt,r),$.backtrack=!0}if(q.comma!==!0&&q.dots!==!0){let ut=$.output.slice(0,q.outputIndex),zt=$.tokens.slice(q.tokensIndex);q.value=q.output="\\{",P=Oe="\\}",$.output=ut;for(let lt of zt)$.output+=lt.output||lt.value}de({type:"brace",value:P,output:Oe}),Xr("braces"),K.pop();continue}if(P==="|"){ie.length>0&&ie[ie.length-1].conditions++,de({type:"text",value:P});continue}if(P===","){let q=P,Oe=K[K.length-1];Oe&&xe[xe.length-1]==="braces"&&(Oe.comma=!0,q="|"),de({type:"comma",value:P,output:q});continue}if(P==="/"){if(C.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",s.pop(),C=o;continue}de({type:"slash",value:P,output:f});continue}if(P==="."){if($.braces>0&&C.type==="dot"){C.value==="."&&(C.output=u);let q=K[K.length-1];C.type="dots",C.output+=P,C.value+=P,q.dots=!0;continue}if($.braces+$.parens===0&&C.type!=="bos"&&C.type!=="slash"){de({type:"text",value:P,output:u});continue}de({type:"dot",value:P,output:u});continue}if(P==="?"){if(!(C&&C.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("qmark",P);continue}if(C&&C.type==="paren"){let Oe=se(),ut=P;(C.value==="("&&!/[!=<:]/.test(Oe)||Oe==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(ut=`\\${P}`),de({type:"text",value:P,output:ut});continue}if(r.dot!==!0&&(C.type==="slash"||C.type==="bos")){de({type:"qmark",value:P,output:S});continue}de({type:"qmark",value:P,output:_});continue}if(P==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){uo("negate",P);continue}if(r.nonegate!==!0&&$.index===0){lo();continue}}if(P==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("plus",P);continue}if(C&&C.value==="("||r.regex===!1){de({type:"plus",value:P,output:d});continue}if(C&&(C.type==="bracket"||C.type==="paren"||C.type==="brace")||$.parens>0){de({type:"plus",value:P});continue}de({type:"plus",value:d});continue}if(P==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){de({type:"at",extglob:!0,value:P,output:""});continue}de({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let q=YAe.exec(Kt());q&&(P+=q[0],$.index+=q[0].length),de({type:"text",value:P});continue}if(C&&(C.type==="globstar"||C.star===!0)){C.type="star",C.star=!0,C.value+=P,C.output=D,$.backtrack=!0,$.globstar=!0,dr(P);continue}let H=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(H)){uo("star",P);continue}if(C.type==="star"){if(r.noglobstar===!0){dr(P);continue}let q=C.prev,Oe=q.prev,ut=q.type==="slash"||q.type==="bos",zt=Oe&&(Oe.type==="star"||Oe.type==="globstar");if(r.bash===!0&&(!ut||H[0]&&H[0]!=="/")){de({type:"star",value:P,output:""});continue}let lt=$.braces>0&&(q.type==="comma"||q.type==="brace"),ki=ie.length&&(q.type==="pipe"||q.type==="paren");if(!ut&&q.type!=="paren"&&!lt&&!ki){de({type:"star",value:P,output:""});continue}for(;H.slice(0,3)==="/**";){let Ei=t[$.index+4];if(Ei&&Ei!=="/")break;H=H.slice(3),dr("/**",3)}if(q.type==="bos"&&Ir()){C.type="globstar",C.value+=P,C.output=O(r),$.output=C.output,$.globstar=!0,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&!zt&&Ir()){$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=O(r)+(r.strictSlashes?")":"|$)"),C.value+=P,$.globstar=!0,$.output+=q.output+C.output,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&H[0]==="/"){let Ei=H[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=`${O(r)}${f}|${f}${Ei})`,C.value+=P,$.output+=q.output+C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}if(q.type==="bos"&&H[0]==="/"){C.type="globstar",C.value+=P,C.output=`(?:^|${f}|${O(r)}${f})`,$.output=C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-C.output.length),C.type="globstar",C.output=O(r),C.value+=P,$.output+=C.output,$.globstar=!0,dr(P);continue}let ht={type:"star",value:P,output:D};if(r.bash===!0){ht.output=".*?",(C.type==="bos"||C.type==="slash")&&(ht.output=T+ht.output),de(ht);continue}if(C&&(C.type==="bracket"||C.type==="paren")&&r.regex===!0){ht.output=P,de(ht);continue}($.index===$.start||C.type==="slash"||C.type==="dot")&&(C.type==="dot"?($.output+=g,C.output+=g):r.dot===!0?($.output+=b,C.output+=b):($.output+=T,C.output+=T),se()!=="*"&&($.output+=p,C.output+=p)),de(ht)}for(;$.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Bl("closing","]"));$.output=an.escapeLast($.output,"["),Xr("brackets")}for(;$.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Bl("closing",")"));$.output=an.escapeLast($.output,"("),Xr("parens")}for(;$.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Bl("closing","}"));$.output=an.escapeLast($.output,"{"),Xr("braces")}if(r.strictSlashes!==!0&&(C.type==="star"||C.type==="bracket")&&de({type:"maybe_slash",value:"",output:`${f}?`}),$.backtrack===!0){$.output="";for(let H of $.tokens)$.output+=H.output!=null?H.output:H.value,H.suffix&&($.output+=H.suffix)}return $};LP.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Mv,r.maxLength):Mv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=r8[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=_p.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=T=>T.noglobstar===!0?_:`(${g}(?:(?!${p}${T.dot?c:o}).)*?)`,x=T=>{switch(T){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${S(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${S(r)}${s})?${o}${a}${_}`;default:{let A=/^(.*?)\.(\w+)$/.exec(T);if(!A)return;let D=x(A[1]);return D?D+o+A[2]:void 0}}},w=an.removePrefix(t,b),O=x(w);return O&&r.strictSlashes!==!0&&(O+=`${s}?`),O};o8.exports=LP});var l8=v((idt,c8)=>{"use strict";var oTe=t8(),zP=s8(),a8=gp(),sTe=hp(),aTe=t=>t&&typeof t=="object"&&!Array.isArray(t),Rt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Rt(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=aTe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?Rt.compileRe(t,e):Rt.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Rt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Rt.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};Rt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?a8.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Rt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Rt.matchBase=(t,e,r)=>(e instanceof RegExp?e:Rt.makeRe(e,r)).test(a8.basename(t));Rt.isMatch=(t,e,r)=>Rt(e,r)(t);Rt.parse=(t,e)=>Array.isArray(t)?t.map(r=>Rt.parse(r,e)):zP(t,{...e,fastpaths:!1});Rt.scan=(t,e)=>oTe(t,e);Rt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Rt.toRegex(a,e);return n===!0&&(c.state=t),c};Rt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=zP.fastpaths(t,e)),i.output||(i=zP(t,e)),Rt.compileRe(i,e,r,n)};Rt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Rt.constants=sTe;c8.exports=Rt});var p8=v((odt,f8)=>{"use strict";var u8=l8(),cTe=gp();function d8(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:cTe.isWindows()}),u8(t,e,r)}Object.assign(d8,u8);f8.exports=d8});import{readdir as lTe,readdirSync as uTe,realpath as dTe,realpathSync as fTe,stat as pTe,statSync as mTe}from"fs";import{isAbsolute as hTe,posix as Ha,resolve as gTe}from"path";import{fileURLToPath as yTe}from"url";function vTe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&bTe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>Ha.relative(t,n)||".":n=>Ha.relative(t,`${e}/${n}`)||"."}function xTe(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=Ha.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function y8(t){var e;let r=Hl.default.scan(t,$Te);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function RTe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Hl.default.scan(t);return r.isGlob||r.negated}function bp(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function _8(t){return typeof t=="string"?[t]:t??[]}function UP(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=OTe(o);s=hTe(s.replace(PTe,""))?Ha.relative(a,s):Ha.normalize(s);let c=(i=ITe.exec(s))===null||i===void 0?void 0:i[0],l=y8(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?Ha.join(o,...d):o}return s}function CTe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(UP(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(UP(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(UP(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function DTe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=CTe(t,e,n);t.debug&&bp("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(h8,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Hl.default)(i.match,f),m=(0,Hl.default)(i.ignore,f),h=vTe(i.match,f),g=m8(r,d,o),b=o?g:m8(r,d,!0),_=(w,O)=>{let T=b(O,!0);return T!=="."&&!h(T)||m(T)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let x=new UJ({filters:[a?(w,O)=>{let T=g(w,O),A=p(T)&&!m(T);return A&&bp(`matched ${T}`),A}:(w,O)=>{let T=g(w,O);return p(T)&&!m(T)}],exclude:a?(w,O)=>{let T=_(w,O);return bp(`${T?"skipped":"crawling"} ${O}`),T}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:S,signal:t.signal}).crawl(d);return t.debug&&bp("internal properties:",{...n,root:d}),[x,r!==d&&!o&&xTe(r,d)]}function NTe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function MTe(t){let e={...jTe,...t};return e.cwd=(e.cwd instanceof URL?yTe(e.cwd):gTe(e.cwd)).replace(h8,"/"),e.ignore=_8(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||lTe,readdirSync:e.fs.readdirSync||uTe,realpath:e.fs.realpath||dTe,realpathSync:e.fs.realpathSync||fTe,stat:e.fs.stat||pTe,statSync:e.fs.statSync||mTe}),e.debug&&bp("globbing with options:",e),e}function FTe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=_Te(t)||typeof t=="string",i=_8((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=MTe(n?e:t);return i.length>0?DTe(o,i):[]}function ys(t,e){let[r,n]=FTe(t,e);return r?NTe(r.sync(),n):[]}var Hl,_Te,h8,g8,bTe,STe,wTe,$Te,kTe,ETe,ATe,TTe,OTe,ITe,PTe,jTe,vp=y(()=>{qJ();Hl=St(p8(),1),_Te=Array.isArray,h8=/\\/g,g8=process.platform==="win32",bTe=/^(\/?\.\.)+$/;STe=/^[A-Z]:\/$/i,wTe=g8?t=>STe.test(t):t=>t==="/";$Te={parts:!0};kTe=/(?t.replace(kTe,"\\$&"),TTe=t=>t.replace(ETe,"\\$&"),OTe=g8?TTe:ATe;ITe=/^(\/?\.\.)+/,PTe=/\\(?=[()[\]{}!*+?@|])/g;jTe={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as Sp,readFileSync as LTe,readdirSync as zTe,statSync as b8}from"node:fs";import{join as Ga}from"node:path";function UTe(t){let{cwd:e="."}=t,r,n;try{let c=B(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=Fi(e,n),o=[],{layers:s,forbiddenImports:a}=qP(r);return(s.size>0||a.length>0)&&!Sp(Ga(e,i.mainRoot))?[{detector:wp,severity:"info",path:`${i.mainRoot}/`,message:`architecture layers declared but ${i.mainRoot}/ not found \u2014 layer checks skipped (flat layout not yet supported)`}]:(s.size>0&&(qTe(e,i,s,o),BTe(e,i,s,o)),a.length>0&&HTe(e,i,a,o),o)}function qP(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function qTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of zTe(o)){let a=Ga(o,s);b8(a).isDirectory()&&(r.has(s)||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function BTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of r){let a=Ga(o,s);Sp(a)&&b8(a).isDirectory()||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function HTe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Ga(t,i,s.from);if(!Sp(a))continue;let c=ys([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Ga(a,l),d;try{d=LTe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];GTe(p,s.to,e.importStyle)&&n.push({detector:wp,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function GTe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var wp,v8,BP=y(()=>{"use strict";vp();Ue();Ba();wp="ARCHITECTURE_FROM_SPEC";v8={name:wp,run:UTe}});import{existsSync as ZTe,readFileSync as VTe}from"node:fs";import{join as WTe}from"node:path";function JTe(t){let{cwd:e="."}=t,r=WTe(e,"spec/capabilities.yaml");if(!ZTe(r))return[];let n;try{let u=VTe(r,"utf8"),d=S8.default.parse(u);if(!d||typeof d!="object")return[];n=d}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o,s=!1;try{let u=B(e);o=new Set(u.features.map(d=>d.id)),s=u.project.onboarding_seeded===!0}catch{return[]}let a=[],c=new Set,l=s&&o.size{"use strict";S8=St(er(),1);Ue();Fv="CAPABILITIES_FEATURE_MAPPING",KTe=8;w8={name:Fv,run:JTe}});import{existsSync as YTe,readFileSync as XTe}from"node:fs";import{join as QTe}from"node:path";function eOe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("#")||e.startsWith('"""')||e.startsWith("'''")}function tOe(t){let{cwd:e="."}=t;return ge(e,HP,r=>rOe(r,e))}function rOe(t,e){let r=Fi(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=QTe(e,o);if(!YTe(s))continue;let a=XTe(s,"utf8");eOe(a)||n.push({detector:HP,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var HP,$8,k8=y(()=>{"use strict";Ba();wt();HP="CONVENTION_DRIFT";$8={name:HP,run:tOe}});import{existsSync as GP,readFileSync as E8}from"node:fs";import{join as Lv}from"node:path";function nOe(t){return JSON.parse(t).total?.lines?.pct??0}function A8(t){let e=/]*\bline-rate="([0-9]*\.?[0-9]+)"/.exec(t);return e?Number(e[1])*100:null}function sOe(t,e){if(!xv(dt(t).gates.coverage?.cmd))return null;let r;try{r=$v(t,e)}catch(c){return[{detector:$o,severity:"error",message:c.message}]}let n=0,i=0,o=0,s=[];for(let c of r){let l=wP.find(d=>GP(Lv(c.dir,d)));if(!l){s.push(c.path);continue}let u=A8(E8(Lv(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:$o,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=T8(n,i);return a0?[{detector:$o,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function aOe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let a=sOe(e,t.focusModules);if(a)return a}let r;try{r=B(e).project?.language}catch{}let n=Fi(e,r),i=dt(e).language==="kotlin"?wP.find(a=>GP(Lv(e,a)))??lJ(e):n.coverageSummary,o=Lv(e,i);if(!GP(o))return[{detector:$o,severity:"info",message:`${i} not present \u2014 run stage_2.2 first`}];let s;try{let a=E8(o,"utf8");s=n.coverageFormat==="jacoco-xml"?iOe(a):n.coverageFormat==="cobertura-xml"?oOe(a):nOe(a)}catch(a){return[{detector:$o,severity:"warn",message:`${i} unparseable: ${a.message}`}]}return s===null?n.coverageFormat==="cobertura-xml"?[]:[{detector:$o,severity:"warn",message:`${i} contained no line-coverage counter`}]:s>=zv?[]:[{detector:$o,severity:"warn",message:`line coverage ${s.toFixed(1)}% < floor ${zv}%`}]}var $o,zv,O8,R8=y(()=>{"use strict";Ue();Av();Ba();kv();sn();$o="COVERAGE_DROP",zv=70;O8={name:$o,run:aOe}});import{existsSync as cOe}from"node:fs";import{join as lOe}from"node:path";function dOe(t){let{cwd:e="."}=t;return ge(e,Uv,r=>fOe(r,e))}function fOe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);if(!r){if(n.length===0)return[];let i=t.project.onboarding_seeded===!0&&t.features.length{"use strict";wt();Uv="DELIVERABLE_INTEGRITY",uOe=8;I8={name:Uv,run:dOe}});function pOe(t){let e=new Set((t.features??[]).map(n=>n.id)),r=[];for(let n of t.project?.smoke??[]){let i=n.feature;if(i===void 0||e.has(i))continue;let o=(n.run??[]).join(" ")||`kind:${n.kind}`;r.push({detector:qv,severity:"warn",path:"spec.yaml",message:`smoke probe '${o}' binds feature ${i}, which is not in the spec \u2014 a dangling binding is annotation drift (the bound feature was renamed, archived, or never existed). Fix the id or drop the binding.`})}return r}function mOe(t){let e=pOe(t),r=(t.features??[]).filter(o=>o.status==="done");return r.length===0||!!!t.project?.deliverable||(t.project?.smoke??[]).length>0?e:[...e,{detector:qv,severity:"warn",path:"spec.yaml",message:`${r.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function hOe(t){let{cwd:e="."}=t;return ge(e,qv,r=>mOe(r))}var qv,C8,D8=y(()=>{"use strict";wt();qv="SMOKE_PROBE_DEMAND";C8={name:qv,run:hOe}});function gOe(t){let{cwd:e="."}=t;return ge(e,Bv,r=>yOe(r,e))}function yOe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=as(e);if(n===null)return[{detector:Bv,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=B_(n,e,o);s.state!=="fresh"&&i.push({detector:Bv,severity:"warn",path:"spec/attestation.yaml",message:s.state==="unattested"?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:s.module?`${o.id}'s module ${s.module} changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var Bv,Hv,ZP=y(()=>{"use strict";bl();wt();Bv="STALE_ATTESTATION";Hv={name:Bv,run:gOe}});function _Oe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}return bOe(r)}function bOe(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:N8,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var N8,Gv,VP=y(()=>{"use strict";Ue();N8="DEPENDENCY_CYCLE";Gv={name:N8,run:_Oe}});import{appendFileSync as vOe,existsSync as j8,mkdirSync as SOe,readFileSync as wOe}from"node:fs";import{dirname as xOe,join as $Oe}from"node:path";function M8(t){return $Oe(t,kOe,EOe)}function F8(t){return WP.add(t),()=>WP.delete(t)}function Za(t,e){let r=M8(t),n=xOe(r);j8(n)||SOe(n,{recursive:!0}),vOe(r,`${JSON.stringify(e)} +`,"utf8");for(let i of WP)try{i(t,e)}catch{}}function In(t){let e=M8(t);if(!j8(e))return[];let r=wOe(e,"utf8").trim();return r.length===0?[]:r.split(` +`).filter(n=>n.length>0).map(n=>JSON.parse(n))}var kOe,EOe,WP,ni=y(()=>{"use strict";kOe=".cladding",EOe="audit.log.jsonl";WP=new Set});import{existsSync as AOe}from"node:fs";import{join as TOe}from"node:path";function OOe(t){let{cwd:e="."}=t,r=In(e);if(r.length===0)return[{detector:KP,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=[];for(let i of r)i.artifact&&(AOe(TOe(e,i.artifact))||n.push({detector:KP,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var KP,L8,z8=y(()=>{"use strict";ni();KP="EVIDENCE_MISMATCH";L8={name:KP,run:OOe}});import{existsSync as ROe,readFileSync as IOe}from"node:fs";import{join as POe}from"node:path";function COe(t){let e=POe(t,H8);if(!ROe(e))return null;try{let n=((0,B8.parse)(IOe(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*q8(t,e){for(let r of t??[])r.startsWith(U8)&&(yield{ref:r,name:r.slice(U8.length),field:e})}function DOe(t){let{cwd:e="."}=t,r=COe(e);if(r===null)return[];let n;try{n=B(e)}catch(o){return[{detector:JP,severity:"info",message:`spec.yaml not loaded: ${o.message}`}]}let i=[];for(let o of n.features)for(let s of o.acceptance_criteria??[]){let a=[...q8(s.evidence_refs,"evidence_refs"),...q8(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:JP,severity:"warn",path:H8,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var B8,JP,U8,H8,G8,Z8=y(()=>{"use strict";B8=St(er(),1);Ue();JP="FIXTURE_REFERENCE_INVALID",U8="fixture:",H8="conformance/fixtures.yaml";G8={name:JP,run:DOe}});import{existsSync as Gl,readFileSync as YP}from"node:fs";import{join as Va}from"node:path";function NOe(t){return ys(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec|spec-first-window)\.ts$/.test(r)).length}function xp(t){if(!Gl(t))return null;try{return JSON.parse(YP(t,"utf8"))}catch{return null}}function jOe(t,e){let r=Va(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(YP(r,"utf8"))}catch(c){e.push({detector:ko,severity:"info",message:`plugin.json not loaded: ${c.message}`});return}let i=n.ironclad?.current?.detectors;if(!i)return;let o=i.match(/^(\d+)\/(\d+)$/);if(!o){e.push({detector:ko,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=NOe(t);s!==a&&e.push({detector:ko,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function MOe(t,e){for(let r of V8){let n=Va(t,r.path);if(!Gl(n))continue;let i=xp(n);if(!i){e.push({detector:ko,severity:"warn",message:`${r.host}: ${r.path} could not be parsed as JSON`});continue}for(let o of r.required)(i[o]===void 0||i[o]===null||i[o]==="")&&e.push({detector:ko,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function FOe(t,e){let r=xp(Va(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of V8){let s=Va(t,o.path);if(!Gl(s))continue;let a=xp(s);a?.version&&a.version!==n&&e.push({detector:ko,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=Va(t,".claude-plugin","marketplace.json");if(Gl(i)){let o=xp(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:ko,severity:"error",message:`marketplace: .claude-plugin/marketplace.json plugin '${s.name??"?"}' version='${s.version}' but package.json version='${n}' \u2014 the catalog advertises a stale version; bump it in lockstep`})}}function LOe(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function zOe(t,e){let r=Va(t,"src","cli","clad.ts"),n=Va(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!Gl(r)||!Gl(n))return;let i=LOe(YP(r,"utf8"));if(i.length===0)return;let s=xp(n)?.ironclad?.current?.["stages-implemented"];if(!Array.isArray(s))return;let a=new Set(i),c=new Set(s),l=i.filter(f=>!c.has(f)),u=s.filter(f=>!a.has(f));if(l.length===0&&u.length===0)return;let d=[l.length?`missing [${l.join(", ")}]`:"",u.length?`unexpected [${u.join(", ")}]`:""].filter(Boolean).join("; ");e.push({detector:ko,severity:"error",message:`plugins/claude-code/.claude-plugin/plugin.json stages-implemented disagrees with TIER_STAGES.all (src/cli/clad.ts): ${d} \u2014 run \`npm run build:plugin\` to re-derive`})}function UOe(t){let{cwd:e="."}=t,r=[];return jOe(e,r),zOe(e,r),MOe(e,r),FOe(e,r),r}var ko,V8,W8,K8=y(()=>{"use strict";vp();ko="HARNESS_INTEGRITY",V8=[{host:"claude-code",path:"plugins/claude-code/.claude-plugin/plugin.json",required:["name","version"]},{host:"codex",path:"plugins/codex/.codex-plugin/plugin.json",required:["name","version","description"]},{host:"gemini-cli",path:"plugins/gemini-cli/gemini-extension.json",required:["name","version"]}];W8={name:ko,run:UOe}});import{existsSync as qOe,readFileSync as BOe}from"node:fs";import{join as HOe}from"node:path";function ZOe(t){let{cwd:e="."}=t;return ge(e,Zv,r=>WOe(r,e))}function VOe(t){let e=HOe(t,"spec/capabilities.yaml");if(!qOe(e))return!1;try{let r=J8.default.parse(BOe(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function WOe(t,e){let r=t.features.length;if(r{"use strict";J8=St(er(),1);wt();Zv="HOLLOW_GOVERNANCE",GOe=8;Y8={name:Zv,run:ZOe}});import{existsSync as Q8,readFileSync as e5}from"node:fs";import{join as t5}from"node:path";function r5(t,e){let r=t.match(e);if(!r)return null;try{let n=JSON.parse(r[1]),i={};for(let[o,s]of Object.entries(n))typeof s=="string"&&(i[o]=s);return i}catch{return null}}function YOe(t){switch(t){case"fail":case"wiring-fail":return 0;case"wiring-ok":case"wiring-only":return 1;case"verified":return 2;default:return null}}function XOe(t){switch(t){case"wiring-only":return 1;case"verified":return 2;default:return null}}function QOe(t){let e=t5(t,"README.md"),r=t5(t,"docs","dogfood","matrix.md");if(!Q8(e)||!Q8(r))return[];let n=r5(e5(e,"utf8"),KOe),i=r5(e5(r,"utf8"),JOe);if(!n||!i)return[];let o=[];for(let[s,a]of Object.entries(n)){let c=XOe(a);if(c===null)continue;let l=i[s]??"not-run",u=YOe(l);u!==null&&c>u&&o.push({detector:n5,severity:"warn",path:"README.md",message:`README host-claims: '${s}' claims '${a}' but the newest matrix evidence is '${l}' \u2014 the claim exceeds the evidence. Re-run \`clad doctor --hosts\` (with consent) or lower the README claim for '${s}'.`})}return o}function eRe(t){let{cwd:e="."}=t;return QOe(e)}var n5,KOe,JOe,i5,o5=y(()=>{"use strict";n5="HOST_CLAIM_DRIFT",KOe=//,JOe=//;i5={name:n5,run:eRe}});function tRe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=[];return s5(r.features.map(i=>i.id),"feature","spec/features/",n),s5((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function s5(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:a5,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var a5,c5,l5=y(()=>{"use strict";Ue();a5="ID_COLLISION";c5={name:a5,run:tRe}});import{existsSync as $p,readFileSync as XP,readdirSync as QP,statSync as rRe,writeFileSync as d5}from"node:fs";import{join as Eo}from"node:path";function u5(t){if(!$p(t))return 0;try{return QP(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function nRe(t){if(!$p(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=QP(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=Eo(n,o),a;try{a=rRe(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function iRe(t){let e=Eo(t,"spec","capabilities.yaml");if(!$p(e))return 0;try{let r=Vv.default.parse(XP(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function _s(t="."){let e=u5(Eo(t,"spec","features")),r=u5(Eo(t,"spec","scenarios")),n=iRe(t),i=nRe(Eo(t,"tests"));return{features:e,scenarios:r,capabilities:n,test_files:i}}function Zl(t,e){let r=Eo(t,"spec.yaml");if(!$p(r))return;let n=XP(r,"utf8"),i=oRe(n,e);i!==n&&d5(r,i)}function oRe(t,e){let r=t.includes(`\r `)?`\r `:` `,n=t.split(/\r?\n/),i=n.findIndex(d=>/^inventory:\s*$/.test(d)),o=["# Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand.","inventory:",` features: ${e.features??0}`,` scenarios: ${e.scenarios??0}`,` capabilities: ${e.capabilities??0}`,` test_files: ${e.test_files??0}`],s=d=>r===`\r @@ -270,51 +270,51 @@ ${o.join(` `)}let a=i;a>0&&/Auto-maintained by `clad sync`/.test(n[a-1])&&(a-=1);let c=i+1;for(;ci+1);)c++;let l=n.slice(0,a),u=n.slice(c);for(;l.length>0&&l[l.length-1].trim()==="";)l.pop();return l.push(""),s([...l,...o,"",...u.filter((d,f)=>!(f===0&&d.trim()===""))].join(` `).replace(/\n{3,}/g,` -`))}function Wa(t="."){let e=ko(t,"spec","features");if(!$p(e))return!1;let r=[];for(let i of XP(e).sort())if(!(!i.endsWith(".yaml")&&!i.endsWith(".yml")))try{let o=(0,Zv.parse)(YP(ko(e,i),"utf8"));if(!o?.id)continue;let s=o.slug??i.replace(/\.(ya?ml)$/,"");r.push(` ${o.id}: {slug: ${s}, status: ${o.status??"planned"}, modules: ${(o.modules??[]).length}}`)}catch{continue}r.sort();let n="# Cladding \xB7 Tier C \u2014 generated feature index (`clad sync`). Do not edit by hand.\n# One line per feature \u2192 1-file lookup + line-independent merges\n# (suggested .gitattributes: `spec/index.yaml merge=union`).\nfeatures:\n"+r.join(` +`))}function Wa(t="."){let e=Eo(t,"spec","features");if(!$p(e))return!1;let r=[];for(let i of QP(e).sort())if(!(!i.endsWith(".yaml")&&!i.endsWith(".yml")))try{let o=(0,Vv.parse)(XP(Eo(e,i),"utf8"));if(!o?.id)continue;let s=o.slug??i.replace(/\.(ya?ml)$/,"");r.push(` ${o.id}: {slug: ${s}, status: ${o.status??"planned"}, modules: ${(o.modules??[]).length}}`)}catch{continue}r.sort();let n="# Cladding \xB7 Tier C \u2014 generated feature index (`clad sync`). Do not edit by hand.\n# One line per feature \u2192 1-file lookup + line-independent merges\n# (suggested .gitattributes: `spec/index.yaml merge=union`).\nfeatures:\n"+r.join(` `)+` -`;return s5(ko(t,"spec","index.yaml"),n,"utf8"),!0}var Zv,kp=y(()=>{"use strict";Zv=St(Qt(),1)});import{existsSync as a5,readFileSync as c5,readdirSync as QOe}from"node:fs";import{join as QP}from"node:path";function eRe(t){let{cwd:e="."}=t,r;try{r=H(e)}catch{return[]}let n=_s(e),i=r.inventory;if(!i){let s=l5.filter(([c])=>(n[c]??0)>0);if(s.length===0)return eC(e);let a=s.map(([c,l])=>`${n[c]??0} ${l}`).join(", ");return[...eC(e),{detector:Ep,severity:"warn",path:"spec.yaml",message:`spec.yaml has no inventory: block, but the project has ${a} on disk \u2014 run \`clad sync\` to record the inventory so anyone reading spec.yaml sees its real scale.`}]}let o=[];for(let[s,a]of l5){let c=i[s]??0,l=n[s]??0;c!==l&&o.push({detector:Ep,severity:"error",path:"spec.yaml",message:`spec.yaml inventory.${s} declares ${c} but the project has ${l} ${a} on disk \u2014 run \`clad sync\` (a stale inventory hides created/deleted shards from anyone reading spec.yaml).`})}return o.push(...eC(e)),o}function eC(t){let e=QP(t,"spec","index.yaml"),r=QP(t,"spec","features");if(!a5(e)||!a5(r))return[];let n=new Map;try{for(let l of c5(e,"utf8").split(` -`)){let u=l.match(/^ (F-[\w-]+):.*\bstatus:\s*['"]?([\w-]+)['"]?/);if(u){n.set(u[1],u[2]);continue}let d=l.match(/^ (F-[\w-]+):/);d&&n.set(d[1],"planned")}}catch{return[]}let i=new Map;try{for(let l of QOe(r)){if(!l.endsWith(".yaml")&&!l.endsWith(".yml"))continue;let u=c5(QP(r,l),"utf8"),d=u.match(/^id:\s*['"]?(F-[\w-]+)['"]?/m);if(!d)continue;let f=u.match(/^status:\s*['"]?([\w-]+)['"]?/m);i.set(d[1],f?f[1]:"planned")}}catch{return[]}let o=[],s=[...i.keys()].filter(l=>!n.has(l)).sort(),a=[...n.keys()].filter(l=>!i.has(l)).sort();if(s.length>0||a.length>0){let l=[];s.length>0&&l.push(`missing from index: ${s.join(", ")}`),a.length>0&&l.push(`in index but not on disk: ${a.join(", ")}`),o.push({detector:Ep,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml disagrees with spec/features/ (${l.join("; ")}) \u2014 run \`clad sync\` to regenerate (a stale index silently misleads agents that trust it for lookup).`})}let c=[...i.keys()].filter(l=>n.has(l)&&n.get(l)!==i.get(l)).sort().map(l=>`${l} (index: ${n.get(l)}, shard: ${i.get(l)})`);return c.length>0&&o.push({detector:Ep,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml status disagrees with spec/features/ for ${c.join("; ")} \u2014 run \`clad sync\` to regenerate (a stale status silently misleads agents that trust the index).`}),o}var Ep,l5,u5,d5=y(()=>{"use strict";kp();Be();Ep="INVENTORY_DRIFT",l5=[["features","feature shard(s)"],["scenarios","scenario shard(s)"],["capabilities","capabilit(ies)"],["test_files","test file(s)"]];u5={name:Ep,run:eRe}});import{existsSync as tRe,readFileSync as rRe}from"node:fs";import{join as nRe}from"node:path";function oRe(t){let{cwd:e="."}=t,r=nRe(e,"src","spec","schema.json"),n=[];if(tRe(r)){let i;try{i=JSON.parse(rRe(r,"utf8"))}catch(o){n.push({detector:Ap,severity:"error",message:`spec/schema.json unreadable or invalid JSON: ${o.message}`})}if(i)for(let o of iRe)i.required?.includes(o)||n.push({detector:Ap,severity:"error",message:`spec/schema.json does not require root key '${o}'`}),i.properties?.[o]||n.push({detector:Ap,severity:"error",message:`spec/schema.json does not declare property '${o}'`})}try{let i=H(e);i.schema!==f5&&n.push({detector:Ap,severity:"error",message:`spec.yaml schema='${i.schema}' but supported version is '${f5}'`})}catch{}return n}var Ap,iRe,f5,p5,m5=y(()=>{"use strict";Be();Ap="META_INTEGRITY",iRe=["schema","project","features"],f5="0.1";p5={name:Ap,run:oRe}});function sRe(t){let{cwd:e="."}=t,r;try{r=H(e)}catch{return[]}let n=[];return h5(r.features.map(i=>({id:i.id,slug:i.slug})),"features",n),h5((r.scenarios??[]).map(i=>({id:i.id,slug:i.slug})),"scenarios",n),n}function h5(t,e,r){let n=new Map;for(let i of t){if(!i.slug)continue;let o=n.get(i.slug);o?r.push({detector:g5,severity:"error",message:`slug '${i.slug}' is used by both ${o} and ${i.id} in ${e}/ \u2014 two items in the same namespace cannot share a slug; pick a different slug for one`}):n.set(i.slug,i.id)}}var g5,y5,_5=y(()=>{"use strict";Be();g5="SLUG_CONFLICT";y5={name:g5,run:sRe}});function Hl(t){return t==="planned"||t==="in_progress"}var Vv=y(()=>{"use strict"});import{existsSync as aRe}from"node:fs";import{join as cRe}from"node:path";function lRe(t){let{cwd:e="."}=t;return ge(e,Wv,r=>uRe(r,e))}function uRe(t,e){let r=[];for(let n of t.features)for(let i of n.modules??[]){let o=cRe(e,i);aRe(o)||r.push(dRe(n.id,i,n.status))}return r}function dRe(t,e,r){return Hl(r)?{detector:Wv,severity:"info",path:e,message:`feature ${t}'s module '${e}' is not built yet \u2014 the normal state between authoring the spec entry and implementing it`}:{detector:Wv,severity:"error",path:e,message:`feature ${t} declares module '${e}' but the file does not exist`}}var Wv,Kv,tC=y(()=>{"use strict";Vv();wt();Wv="MISSING_IMPLEMENTATION";Kv={name:Wv,run:lRe}});function fRe(t){let{cwd:e="."}=t;return ge(e,rC,pRe)}function pRe(t){let e=[];for(let r of t.features)if(r.status==="done")for(let n of r.acceptance_criteria??[]){let o=(n.test_refs??[]).filter(c=>!c.startsWith("derived:")).length>0,s=(n.evidence_refs?.length??0)>0,a=!o&&!s&&(n.test_refs?.length??0)>0;!o&&!s&&e.push({detector:rC,severity:"error",message:`${r.id}.${n.id} declares no test_refs or evidence_refs \u2014 AC is unverified`+(a?" (a 'derived:' candidate exists \u2014 confirm it by removing the prefix, or author a real ref)":"")})}return e}var rC,Jv,nC=y(()=>{"use strict";wt();rC="MISSING_TESTS";Jv={name:rC,run:fRe}});import{existsSync as mRe,readFileSync as hRe}from"node:fs";import{join as b5}from"node:path";function v5(t){if(mRe(t))try{return JSON.parse(hRe(t,"utf8"))}catch{return}}function bRe(t){let{cwd:e="."}=t,r=v5(b5(e,gRe)),n=v5(b5(e,yRe));if(!r||!n)return[{detector:iC,severity:"info",message:"perf baseline or current missing \u2014 run stage_3.2 with --record first"}];let i=[];for(let[o,s]of Object.entries(r.metrics??{})){let a=n.metrics?.[o];if(!a||typeof s.value!="number"||typeof a.value!="number"||s.value===0)continue;let c=(a.value-s.value)/s.value*100;c>_Re&&i.push({detector:iC,severity:"warn",message:`${o} regressed ${c.toFixed(1)}% (baseline ${s.value}${s.unit??""} \u2192 current ${a.value}${a.unit??""})`})}return i}var iC,gRe,yRe,_Re,S5,w5=y(()=>{"use strict";iC="PERFORMANCE_DRIFT",gRe="perf/baseline.json",yRe="perf/current.json",_Re=10;S5={name:iC,run:bRe}});import{existsSync as vRe}from"node:fs";import{join as SRe}from"node:path";function xRe(t){let{cwd:e="."}=t;return ge(e,oC,r=>kRe(r,e))}function $Re(t,e){return(t.modules??[]).some(r=>vRe(SRe(e,r)))}function kRe(t,e){let r=[];for(let s of t.features)s.status!=="planned"&&s.status!=="in_progress"||$Re(s,e)||r.push(s.id);let n=wRe;if(r.length<=n)return[];let i=r.slice(0,x5).join(", "),o=r.length>x5?", \u2026":"";return[{detector:oC,severity:"warn",message:`${r.length} planned/in_progress features have NO code on disk (> ${n} tolerated) \u2014 the spec has raced ahead of the code. Work one feature end-to-end before authoring the next (docs/feature-cycle.md). Stalled: ${i}${o}`}]}var oC,wRe,x5,$5,k5=y(()=>{"use strict";wt();oC="PLANNED_BACKLOG",wRe=5,x5=8;$5={name:oC,run:xRe}});import{existsSync as ERe,readFileSync as ARe}from"node:fs";import{join as TRe}from"node:path";function IRe(t){let{cwd:e="."}=t;return ge(e,sC,r=>PRe(r,e))}function PRe(t,e){if(t.features.lengthn.includes(i))?[{detector:sC,severity:"warn",path:"docs/project-context.md",message:`${t.features.length} features but docs/project-context.md is still the unrefined init template (it still carries the placeholder prompts) \u2014 the Why/What/Purpose narrative was never filled in. Fill it in with \`clad clarify\` or by hand.`}]:[]}var sC,ORe,RRe,E5,A5=y(()=>{"use strict";wt();sC="PROJECT_CONTEXT_DRIFT",ORe=8,RRe=["Refine by hand or re-run with LLM available","What gap or pain led to this project","What does success look like"];E5={name:sC,run:IRe}});function T5(t,e,r){return e?e.filter(n=>!t.has(n)).map(n=>({detector:Yv,severity:"error",message:`${r} references unknown id '${n}'`})):[]}function CRe(t){let{cwd:e="."}=t;return ge(e,Yv,DRe)}function DRe(t){let e=new Set(t.features.map(n=>n.id)),r=[];for(let n of t.features)r.push(...T5(e,n.depends_on,`feature ${n.id}.depends_on`)),n.superseded_by&&!e.has(n.superseded_by)&&r.push({detector:Yv,severity:"error",message:`feature ${n.id}.superseded_by references unknown id '${n.superseded_by}'`});for(let n of t.scenarios??[])r.push(...T5(e,n.features,`scenario ${n.id}.features`));return r}var Yv,Xv,aC=y(()=>{"use strict";wt();Yv="REFERENCE_INTEGRITY";Xv={name:Yv,run:CRe}});function Tp(t=""){return new RegExp(NRe,t)}var NRe,cC=y(()=>{"use strict";NRe=String.raw`\bF-(?:\d{3,}|[0-9a-f]{6,8})\b`});import{existsSync as jRe,readdirSync as MRe,readFileSync as FRe,statSync as LRe,writeFileSync as zRe}from"node:fs";import{dirname as URe,join as Op,normalize as qRe,relative as BRe}from"node:path";function WRe(t){let e=[];for(let r of t.matchAll(VRe))if(!r[1].trim().startsWith("ignore"))for(let n of r[1].match(Tp("g"))??[])e.push(n);return[...new Set(e)].sort()}function KRe(t){return t.replace(/```[\s\S]*?```/g," ").replace(/~~~[\s\S]*?~~~/g," ").replace(/`[^`\n]*`/g," ")}function O5(t){return t.split("\\").join("/")}function JRe(t){return HRe.some(e=>t===e||t.startsWith(`${e}/`))}function YRe(t){let e=Op(t,"docs");if(!jRe(e))return[];let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=MRe(i)}catch{continue}for(let s of o){if(s.startsWith("."))continue;let a=Op(i,s),c;try{c=LRe(a)}catch{continue}let l=O5(BRe(t,a));c.isDirectory()?n.push(a):s.endsWith(".md")&&r.push(l)}}return r.sort()}function XRe(t,e){if(/^[a-z]+:/i.test(e))return null;let r=qRe(Op(URe(t),e));return O5(r)}function Rp(t="."){let e=[];for(let r of YRe(t)){let n;try{n=FRe(Op(t,r),"utf8")}catch{continue}let i=KRe(n),o=WRe(i);if(JRe(r)){if(o.length===0)continue;e.push({doc:r,features:o,doc_links:[]});continue}let a=n.includes(GRe)?[]:i.match(Tp("g"))??[],c=[...new Set([...a,...o])].sort(),l=new Set;for(let u of i.matchAll(ZRe)){let d=XRe(r,u[1]);d&&l.add(d)}e.push({doc:r,features:c,doc_links:[...l].sort()})}return{docs:e}}function R5(t="."){let e=Rp(t);if(e.docs.length===0)return!1;let r=["# Cladding \xB7 Tier C \u2014 generated doc\u2192spec / doc\u2192doc link index (`clad sync`). Do not edit by hand.","# Source of truth is the docs themselves; DOC_LINK_INTEGRITY validates resolution.",'schema: "0.1"',"docs:"];for(let n of e.docs)n.features.length===0&&n.doc_links.length===0||(r.push(` ${JSON.stringify(n.doc)}:`),n.features.length>0&&r.push(` features: [${n.features.join(", ")}]`),n.doc_links.length>0&&r.push(` doc_links: [${n.doc_links.map(i=>JSON.stringify(i)).join(", ")}]`));return zRe(Op(t,"spec","_doc-links.yaml"),`${r.join(` +`;return d5(Eo(t,"spec","index.yaml"),n,"utf8"),!0}var Vv,kp=y(()=>{"use strict";Vv=St(er(),1)});import{existsSync as f5,readFileSync as p5,readdirSync as sRe}from"node:fs";import{join as eC}from"node:path";function aRe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=_s(e),i=r.inventory;if(!i){let s=m5.filter(([c])=>(n[c]??0)>0);if(s.length===0)return tC(e);let a=s.map(([c,l])=>`${n[c]??0} ${l}`).join(", ");return[...tC(e),{detector:Ep,severity:"warn",path:"spec.yaml",message:`spec.yaml has no inventory: block, but the project has ${a} on disk \u2014 run \`clad sync\` to record the inventory so anyone reading spec.yaml sees its real scale.`}]}let o=[];for(let[s,a]of m5){let c=i[s]??0,l=n[s]??0;c!==l&&o.push({detector:Ep,severity:"error",path:"spec.yaml",message:`spec.yaml inventory.${s} declares ${c} but the project has ${l} ${a} on disk \u2014 run \`clad sync\` (a stale inventory hides created/deleted shards from anyone reading spec.yaml).`})}return o.push(...tC(e)),o}function tC(t){let e=eC(t,"spec","index.yaml"),r=eC(t,"spec","features");if(!f5(e)||!f5(r))return[];let n=new Map;try{for(let l of p5(e,"utf8").split(` +`)){let u=l.match(/^ (F-[\w-]+):.*\bstatus:\s*['"]?([\w-]+)['"]?/);if(u){n.set(u[1],u[2]);continue}let d=l.match(/^ (F-[\w-]+):/);d&&n.set(d[1],"planned")}}catch{return[]}let i=new Map;try{for(let l of sRe(r)){if(!l.endsWith(".yaml")&&!l.endsWith(".yml"))continue;let u=p5(eC(r,l),"utf8"),d=u.match(/^id:\s*['"]?(F-[\w-]+)['"]?/m);if(!d)continue;let f=u.match(/^status:\s*['"]?([\w-]+)['"]?/m);i.set(d[1],f?f[1]:"planned")}}catch{return[]}let o=[],s=[...i.keys()].filter(l=>!n.has(l)).sort(),a=[...n.keys()].filter(l=>!i.has(l)).sort();if(s.length>0||a.length>0){let l=[];s.length>0&&l.push(`missing from index: ${s.join(", ")}`),a.length>0&&l.push(`in index but not on disk: ${a.join(", ")}`),o.push({detector:Ep,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml disagrees with spec/features/ (${l.join("; ")}) \u2014 run \`clad sync\` to regenerate (a stale index silently misleads agents that trust it for lookup).`})}let c=[...i.keys()].filter(l=>n.has(l)&&n.get(l)!==i.get(l)).sort().map(l=>`${l} (index: ${n.get(l)}, shard: ${i.get(l)})`);return c.length>0&&o.push({detector:Ep,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml status disagrees with spec/features/ for ${c.join("; ")} \u2014 run \`clad sync\` to regenerate (a stale status silently misleads agents that trust the index).`}),o}var Ep,m5,h5,g5=y(()=>{"use strict";kp();Ue();Ep="INVENTORY_DRIFT",m5=[["features","feature shard(s)"],["scenarios","scenario shard(s)"],["capabilities","capabilit(ies)"],["test_files","test file(s)"]];h5={name:Ep,run:aRe}});import{existsSync as cRe,readFileSync as lRe}from"node:fs";import{join as uRe}from"node:path";function fRe(t){let{cwd:e="."}=t,r=uRe(e,"src","spec","schema.json"),n=[];if(cRe(r)){let i;try{i=JSON.parse(lRe(r,"utf8"))}catch(o){n.push({detector:Ap,severity:"error",message:`spec/schema.json unreadable or invalid JSON: ${o.message}`})}if(i)for(let o of dRe)i.required?.includes(o)||n.push({detector:Ap,severity:"error",message:`spec/schema.json does not require root key '${o}'`}),i.properties?.[o]||n.push({detector:Ap,severity:"error",message:`spec/schema.json does not declare property '${o}'`})}try{let i=B(e);i.schema!==y5&&n.push({detector:Ap,severity:"error",message:`spec.yaml schema='${i.schema}' but supported version is '${y5}'`})}catch{}return n}var Ap,dRe,y5,_5,b5=y(()=>{"use strict";Ue();Ap="META_INTEGRITY",dRe=["schema","project","features"],y5="0.1";_5={name:Ap,run:fRe}});function pRe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=[];return v5(r.features.map(i=>({id:i.id,slug:i.slug})),"features",n),v5((r.scenarios??[]).map(i=>({id:i.id,slug:i.slug})),"scenarios",n),n}function v5(t,e,r){let n=new Map;for(let i of t){if(!i.slug)continue;let o=n.get(i.slug);o?r.push({detector:S5,severity:"error",message:`slug '${i.slug}' is used by both ${o} and ${i.id} in ${e}/ \u2014 two items in the same namespace cannot share a slug; pick a different slug for one`}):n.set(i.slug,i.id)}}var S5,w5,x5=y(()=>{"use strict";Ue();S5="SLUG_CONFLICT";w5={name:S5,run:pRe}});function Vl(t){return t==="planned"||t==="in_progress"}var Wv=y(()=>{"use strict"});import{existsSync as mRe}from"node:fs";import{join as hRe}from"node:path";function gRe(t){let{cwd:e="."}=t;return ge(e,Kv,r=>yRe(r,e))}function yRe(t,e){let r=[];for(let n of t.features)for(let i of n.modules??[]){let o=hRe(e,i);mRe(o)||r.push(_Re(n.id,i,n.status))}return r}function _Re(t,e,r){return Vl(r)?{detector:Kv,severity:"info",path:e,message:`feature ${t}'s module '${e}' is not built yet \u2014 the normal state between authoring the spec entry and implementing it`}:{detector:Kv,severity:"error",path:e,message:`feature ${t} declares module '${e}' but the file does not exist`}}var Kv,Jv,rC=y(()=>{"use strict";Wv();wt();Kv="MISSING_IMPLEMENTATION";Jv={name:Kv,run:gRe}});function bRe(t){let{cwd:e="."}=t;return ge(e,nC,vRe)}function vRe(t){let e=[];for(let r of t.features)if(r.status==="done")for(let n of r.acceptance_criteria??[]){let o=(n.test_refs??[]).filter(c=>!c.startsWith("derived:")).length>0,s=(n.evidence_refs?.length??0)>0,a=!o&&!s&&(n.test_refs?.length??0)>0;!o&&!s&&e.push({detector:nC,severity:"error",message:`${r.id}.${n.id} declares no test_refs or evidence_refs \u2014 AC is unverified`+(a?" (a 'derived:' candidate exists \u2014 confirm it by removing the prefix, or author a real ref)":"")})}return e}var nC,Yv,iC=y(()=>{"use strict";wt();nC="MISSING_TESTS";Yv={name:nC,run:bRe}});import{existsSync as SRe,readFileSync as wRe}from"node:fs";import{join as $5}from"node:path";function k5(t){if(SRe(t))try{return JSON.parse(wRe(t,"utf8"))}catch{return}}function ERe(t){let{cwd:e="."}=t,r=k5($5(e,xRe)),n=k5($5(e,$Re));if(!r||!n)return[{detector:oC,severity:"info",message:"perf baseline or current missing \u2014 run stage_3.2 with --record first"}];let i=[];for(let[o,s]of Object.entries(r.metrics??{})){let a=n.metrics?.[o];if(!a||typeof s.value!="number"||typeof a.value!="number"||s.value===0)continue;let c=(a.value-s.value)/s.value*100;c>kRe&&i.push({detector:oC,severity:"warn",message:`${o} regressed ${c.toFixed(1)}% (baseline ${s.value}${s.unit??""} \u2192 current ${a.value}${a.unit??""})`})}return i}var oC,xRe,$Re,kRe,E5,A5=y(()=>{"use strict";oC="PERFORMANCE_DRIFT",xRe="perf/baseline.json",$Re="perf/current.json",kRe=10;E5={name:oC,run:ERe}});import{existsSync as ARe}from"node:fs";import{join as TRe}from"node:path";function RRe(t){let{cwd:e="."}=t;return ge(e,sC,r=>PRe(r,e))}function IRe(t,e){return(t.modules??[]).some(r=>ARe(TRe(e,r)))}function PRe(t,e){let r=[];for(let s of t.features)s.status!=="planned"&&s.status!=="in_progress"||IRe(s,e)||r.push(s.id);let n=ORe;if(r.length<=n)return[];let i=r.slice(0,T5).join(", "),o=r.length>T5?", \u2026":"";return[{detector:sC,severity:"warn",message:`${r.length} planned/in_progress features have NO code on disk (> ${n} tolerated) \u2014 the spec has raced ahead of the code. Work one feature end-to-end before authoring the next (docs/feature-cycle.md). Stalled: ${i}${o}`}]}var sC,ORe,T5,O5,R5=y(()=>{"use strict";wt();sC="PLANNED_BACKLOG",ORe=5,T5=8;O5={name:sC,run:RRe}});import{existsSync as CRe,readFileSync as DRe}from"node:fs";import{join as NRe}from"node:path";function FRe(t){let{cwd:e="."}=t;return ge(e,aC,r=>LRe(r,e))}function LRe(t,e){if(t.features.lengthn.includes(i))?[{detector:aC,severity:"warn",path:"docs/project-context.md",message:`${t.features.length} features but docs/project-context.md is still the unrefined init template (it still carries the placeholder prompts) \u2014 the Why/What/Purpose narrative was never filled in. Fill it in with \`clad clarify\` or by hand.`}]:[]}var aC,jRe,MRe,I5,P5=y(()=>{"use strict";wt();aC="PROJECT_CONTEXT_DRIFT",jRe=8,MRe=["Refine by hand or re-run with LLM available","What gap or pain led to this project","What does success look like"];I5={name:aC,run:FRe}});function C5(t,e,r){return e?e.filter(n=>!t.has(n)).map(n=>({detector:Xv,severity:"error",message:`${r} references unknown id '${n}'`})):[]}function zRe(t){let{cwd:e="."}=t;return ge(e,Xv,URe)}function URe(t){let e=new Set(t.features.map(n=>n.id)),r=[];for(let n of t.features)r.push(...C5(e,n.depends_on,`feature ${n.id}.depends_on`)),n.superseded_by&&!e.has(n.superseded_by)&&r.push({detector:Xv,severity:"error",message:`feature ${n.id}.superseded_by references unknown id '${n.superseded_by}'`});for(let n of t.scenarios??[])r.push(...C5(e,n.features,`scenario ${n.id}.features`));return r}var Xv,Qv,cC=y(()=>{"use strict";wt();Xv="REFERENCE_INTEGRITY";Qv={name:Xv,run:zRe}});function Tp(t=""){return new RegExp(qRe,t)}var qRe,lC=y(()=>{"use strict";qRe=String.raw`\bF-(?:\d{3,}|[0-9a-f]{6,8})\b`});import{existsSync as BRe,readdirSync as HRe,readFileSync as GRe,statSync as ZRe,writeFileSync as VRe}from"node:fs";import{dirname as WRe,join as Op,normalize as KRe,relative as JRe}from"node:path";function tIe(t){let e=[];for(let r of t.matchAll(eIe))if(!r[1].trim().startsWith("ignore"))for(let n of r[1].match(Tp("g"))??[])e.push(n);return[...new Set(e)].sort()}function rIe(t){return t.replace(/```[\s\S]*?```/g," ").replace(/~~~[\s\S]*?~~~/g," ").replace(/`[^`\n]*`/g," ")}function D5(t){return t.split("\\").join("/")}function nIe(t){return YRe.some(e=>t===e||t.startsWith(`${e}/`))}function iIe(t){let e=Op(t,"docs");if(!BRe(e))return[];let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=HRe(i)}catch{continue}for(let s of o){if(s.startsWith("."))continue;let a=Op(i,s),c;try{c=ZRe(a)}catch{continue}let l=D5(JRe(t,a));c.isDirectory()?n.push(a):s.endsWith(".md")&&r.push(l)}}return r.sort()}function oIe(t,e){if(/^[a-z]+:/i.test(e))return null;let r=KRe(Op(WRe(t),e));return D5(r)}function Rp(t="."){let e=[];for(let r of iIe(t)){let n;try{n=GRe(Op(t,r),"utf8")}catch{continue}let i=rIe(n),o=tIe(i);if(nIe(r)){if(o.length===0)continue;e.push({doc:r,features:o,doc_links:[]});continue}let a=n.includes(XRe)?[]:i.match(Tp("g"))??[],c=[...new Set([...a,...o])].sort(),l=new Set;for(let u of i.matchAll(QRe)){let d=oIe(r,u[1]);d&&l.add(d)}e.push({doc:r,features:c,doc_links:[...l].sort()})}return{docs:e}}function N5(t="."){let e=Rp(t);if(e.docs.length===0)return!1;let r=["# Cladding \xB7 Tier C \u2014 generated doc\u2192spec / doc\u2192doc link index (`clad sync`). Do not edit by hand.","# Source of truth is the docs themselves; DOC_LINK_INTEGRITY validates resolution.",'schema: "0.1"',"docs:"];for(let n of e.docs)n.features.length===0&&n.doc_links.length===0||(r.push(` ${JSON.stringify(n.doc)}:`),n.features.length>0&&r.push(` features: [${n.features.join(", ")}]`),n.doc_links.length>0&&r.push(` doc_links: [${n.doc_links.map(i=>JSON.stringify(i)).join(", ")}]`));return VRe(Op(t,"spec","_doc-links.yaml"),`${r.join(` `)} -`,"utf8"),!0}var HRe,GRe,ZRe,VRe,Qv=y(()=>{"use strict";cC();HRe=["docs/ab-evaluation","docs/ab-evaluation-extended","docs/dogfood","docs/benchmarks"],GRe="clad-doc-links: ignore",ZRe=/\]\(\s*([^)\s]+?\.md)(?:#[^)]*)?\s*\)/g,VRe=/clad-doc-links:[ \t]*([^\n>]*)/g});import{existsSync as QRe}from"node:fs";import{join as eIe}from"node:path";function tIe(t){let{cwd:e="."}=t;return ge(e,eS,r=>rIe(r,e))}function rIe(t,e){let r=new Set((t.features??[]).map(i=>i.id)),n=[];for(let i of Rp(e).docs){for(let o of i.doc_links)QRe(eIe(e,o))||n.push({detector:eS,severity:"error",path:i.doc,message:`doc '${i.doc}' links to missing file '${o}'`});for(let o of i.features)r.has(o)||n.push({detector:eS,severity:"warn",path:i.doc,message:`doc '${i.doc}' references unknown feature '${o}' \u2014 archived/renamed? If it is an illustrative example, add a \`clad-doc-links: ignore\` marker to the doc.`})}return n}var eS,tS,lC=y(()=>{"use strict";Qv();wt();eS="DOC_LINK_INTEGRITY";tS={name:eS,run:tIe}});function nIe(t){let{cwd:e="."}=t;return ge(e,Ip,r=>iIe(r))}function iIe(t){let e=[],r=t.features.length,n=t.scenarios??[],i=r>=I5,o=t.project.onboarding_seeded===!0&&!i;r>=I5&&n.length===0&&e.push({detector:Ip,severity:"warn",path:"spec/scenarios/",message:`${r} features but no scenarios declared \u2014 cross-feature user-journey flows are not captured. Author at least one with \`clad_create_scenario\`.`});for(let a of n)(a.features??[]).length===0&&e.push({detector:Ip,severity:o?"info":"warn",path:"spec/scenarios/",message:o?`scenario ${a.id} binds no features yet \u2014 retained as future onboarding intent; bind it when a matching feature lands.`:`scenario ${a.id} binds no features (features: []) \u2014 a scenario must cover at least one feature's flow, or it should be removed.`});let s=new Map(t.features.filter(a=>typeof a.slug=="string"&&a.slug.length>0).map(a=>[a.slug,a.id]));for(let a of n){if(!a.flow)continue;let c=new Set(a.features??[]),l=new Map;for(let u of a.flow.matchAll(/\(([^)]+)\)/g))for(let d of u[1].split(/[,/·]/)){let f=d.trim(),p=s.get(f);p&&!c.has(p)&&l.set(f,p)}if(l.size>0){let u=[...l].map(([d,f])=>`${d} (${f})`).join(", ");e.push({detector:Ip,severity:"warn",path:"spec/scenarios/",message:`scenario ${a.id} flow references ${u} but features[] does not bind ${l.size===1?"it":"them"} \u2014 bind every feature the flow walks, or trim the flow so coverage is not under-stated.`})}}return e}var Ip,I5,P5,C5=y(()=>{"use strict";wt();Ip="SCENARIO_COVERAGE",I5=8;P5={name:Ip,run:nIe}});import{createHash as oIe}from"node:crypto";function sIe(t){return!Number.isFinite(t)||t<=0?0:t>=1?1:t}function Pp(t,e=0){if(t.oracle_policy){let r=t.oracle_policy;return{mandateActive:!0,reportOnly:!1,exhaustive:!1,alwaysEars:new Set(r.always_ears??D5),sample:sIe(r.sample??0)}}return t.require_oracles===!0?{mandateActive:!0,reportOnly:!1,exhaustive:!0,alwaysEars:new Set,sample:1}:t.require_oracles===void 0&&e>=8?{mandateActive:!0,reportOnly:!0,exhaustive:!1,alwaysEars:new Set(D5),sample:0}:{mandateActive:!1,reportOnly:!1,exhaustive:!1,alwaysEars:new Set,sample:0}}function Cp(t){return(t.features??[]).filter(e=>e.status==="done").length}function aIe(t,e){return e<=0?!1:e>=1?!0:parseInt(oIe("sha256").update(t).digest("hex").slice(0,8),16)%1e40})}return r}var D5,rS=y(()=>{"use strict";D5=["unwanted"]});import{chmodSync as cIe,existsSync as j5,readFileSync as lIe,readdirSync as uIe,statSync as M5,unlinkSync as dIe,utimesSync as fIe,writeFileSync as pIe}from"node:fs";import{join as F5}from"node:path";import L5 from"node:process";function mIe(t){return KK(t).map(e=>{try{let r=M5(e);return r.isFile()?{path:e,body:lIe(e),mode:r.mode,atime:r.atime,mtime:r.mtime}:{path:e,nonFile:!0}}catch(r){if(r.code==="ENOENT")return{path:e};throw r}})}function hIe(t){let e=[];for(let r of t)if(!r.nonFile)try{if(r.body===void 0){if(!j5(r.path))continue;if(!M5(r.path).isFile()){e.push(`${r.path}: scoped oracle run created a non-file report candidate`);continue}dIe(r.path);continue}pIe(r.path,r.body),r.mode!==void 0&&cIe(r.path,r.mode),r.atime&&r.mtime&&fIe(r.path,r.atime,r.mtime)}catch(n){e.push(`${r.path}: ${n.message}`)}return e}function gIe(t){let e=!1,r=n=>{for(let i of uIe(n,{withFileTypes:!0})){if(e)return;let o=F5(n,i.name);i.isDirectory()?r(o):(/\.(test|spec)\.[cm]?[jt]sx?$/.test(i.name)||/_test\.py$/.test(i.name))&&(e=!0)}};try{r(t)}catch{}return e}function uC(t={}){let{cwd:e="."}=t,r=F5(e,bs);if(!j5(r)||!gIe(r))return{stage:Ka,pass:!1,exitCode:2,stderr:`no spec-conformance oracles under ${bs}/ \u2014 skipped`};let n=dt(e),i=n.gates.test;if(!i?.cmd||!i.args)return{stage:Ka,pass:!1,exitCode:2,stderr:`no test runner registered for language '${n.language}'`};let o;try{o=mIe(e)}catch(d){return{stage:Ka,pass:!1,exitCode:1,stderr:`could not preserve the full test report before the scoped oracle run: ${d.message}`}}let s,a,c=[...i.args,bs];try{s=Ye(i.cmd,c,{cwd:e,reject:!1})}catch(d){a=d}let l=hIe(o);if(l.length>0)return{stage:Ka,pass:!1,exitCode:1,stderr:`could not restore the full test report after the scoped oracle run: ${l.join("; ")}`};if(a||!s)return{stage:Ka,pass:!1,exitCode:1,stderr:`oracle runner failed to start: ${a?.message??"unknown error"}`};let u=qt(Ka,i.cmd,s,c);return u||tr(Ka,s)}var Ka,bs,yIe,dC=y(()=>{"use strict";Mr();on();dp();On();Ka="stage_2.3",bs="tests/oracle";yIe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${L5.argv[1]}`;if(yIe){let t=uC();console.log(JSON.stringify(t)),L5.exit(t.exitCode)}});import{existsSync as _Ie}from"node:fs";import{join as bIe}from"node:path";function vIe(t){let{cwd:e="."}=t;return ge(e,ni,r=>SIe(r,e))}function SIe(t,e){let r=[],n=Pp(t.project,Cp(t)),i=n.reportOnly?"info":"error",o=n.mandateActive?Rn(e):[],s=o.filter(l=>l.kind==="oracle"),a=new Set(["agent:developer","agent:specialists"]),c=l=>o.find(u=>u.featureId===l&&a.has(u.stage))?.identity.name;for(let l of t.features)if(l.status==="done")for(let u of l.acceptance_criteria??[]){let d=u.oracle_refs??[];if(Dp(n,l.id,u)&&d.length===0){let f=n.exhaustive?"project.require_oracles is set":u.ears&&n.alwaysEars.has(u.ears)?`oracle_policy.always_ears includes '${u.ears}'`:"selected by oracle_policy.sample";r.push({detector:ni,severity:i,message:`${l.id}.${u.id} done AC lacks a spec-conformance oracle (${f}; declare oracle_refs under ${bs}/)`+(n.reportOnly?" [report-only \u2014 the graduated default enforces in 0.7]":"")})}for(let f of d){if(!_Ie(bIe(e,f))){r.push({detector:ni,severity:"error",path:f,message:`${l.id}.${u.id} oracle_ref '${f}' resolves to nothing on disk`});continue}if(f.startsWith(`${bs}/`)||r.push({detector:ni,severity:"warn",path:f,message:`${l.id}.${u.id} oracle_ref '${f}' lives outside ${bs}/ \u2014 stage_2.3 only runs ${bs}/, so this oracle will not execute`}),!n.mandateActive)continue;let p=s.find(g=>g.featureId===l.id&&g.acId===u.id&&g.artifact===f);if(!p){r.push({detector:ni,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' has no authoring-provenance record \u2014 author it via 'clad oracle' (or clad_author_oracle) so impl-blindness can be verified`});continue}let m=c(l.id);m&&p.identity.name===m?r.push({detector:ni,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' is NOT impl-blind: authored by the implementer ('${m}')`}):m||r.push({detector:ni,severity:"info",message:`${l.id}.${u.id} oracle author\u2260implementer not verified \u2014 no implementer identity recorded (no clad run history to compare)`});let h=(p.readManifest??[]).filter(g=>(l.modules??[]).includes(g));h.length>0&&r.push({detector:ni,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' is NOT impl-blind: author read implementation file(s) the feature owns (${h.join(", ")})`}),p.blind===!1&&r.push({detector:ni,severity:"info",message:`${l.id}.${u.id} oracle '${f}' provenance is self-reported (host-protocol), not cladding-controlled \u2014 manifest checked, blindness unproven`})}}if(n.mandateActive&&!n.exhaustive){let l=t.features.filter(u=>u.status==="done").flatMap(u=>u.acceptance_criteria??[]).filter(u=>!u.ears).length;l>0&&r.push({detector:ni,severity:"info",message:`${l} done AC(s) carry no EARS tag and are invisible to the risk-weighted oracle mandate \u2014 tag them (ubiquitous/event/state/optional/unwanted/complex) for the mandate to mean anything.`})}return r}var ni,z5,U5=y(()=>{"use strict";ri();rS();dC();wt();ni="SPEC_CONFORMANCE";z5={name:ni,run:vIe}});function wIe(t){let{cwd:e="."}=t,r=Rn(e);if(r.length===0)return[{detector:fC,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=Date.now(),i=[];for(let o of r){let s=Date.parse(o.identity.timestamp);if(Number.isNaN(s))continue;let a=(n-s)/(1e3*60*60*24);a>q5&&i.push({detector:fC,severity:"warn",message:`evidence ${o.id} is ${Math.round(a)} days old (floor ${q5})`})}return i}var fC,q5,B5,H5=y(()=>{"use strict";ri();fC="STALE_EVIDENCE",q5=90;B5={name:fC,run:wIe}});import{existsSync as G5}from"node:fs";import{join as Z5}from"node:path";function xIe(t){let{cwd:e="."}=t;return ge(e,Gl,r=>$Ie(r,e))}function $Ie(t,e){let r=[];for(let n of t.features){if(n.archived_at&&n.status!=="archived"&&r.push({detector:Gl,severity:"warn",message:`feature ${n.id} has archived_at but status='${n.status}' (expected 'archived')`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:`archived_at already set but status is '${n.status}'`}}}),n.superseded_by&&!n.archived_at&&r.push({detector:Gl,severity:"warn",message:`feature ${n.id} has superseded_by but no archived_at`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:`superseded by ${n.superseded_by} but missing archived_at`}}}),n.status==="archived"){let i=(n.modules??[]).filter(o=>G5(Z5(e,o)));i.length>0&&r.push({detector:Gl,severity:"warn",message:`feature ${n.id} is archived but ${i.length} module(s) still exist: ${i.join(", ")}`})}Hl(n.status)&&(n.modules?.length??0)>0&&!(n.modules??[]).some(i=>G5(Z5(e,i)))&&r.push({detector:Gl,severity:"info",message:`feature ${n.id} (status='${n.status}') declares ${n.modules?.length??0} module(s) that aren't built yet \u2014 the normal state while implementing (not stale)`})}return r}var Gl,nS,pC=y(()=>{"use strict";Vv();wt();Gl="STALE_SPECIFICATION";nS={name:Gl,run:xIe}});import{existsSync as V5,statSync as W5}from"node:fs";import{join as K5}from"node:path";function EIe(t,e){let r=0;for(let n of e){let i=K5(t,n);if(!V5(i))continue;let o=W5(i).mtimeMs;o>r&&(r=o)}return r}function AIe(t){let{cwd:e="."}=t;return ge(e,mC,r=>TIe(r,e))}function TIe(t,e){let r=ji(e,t.project?.language),n=t.features.flatMap(a=>a.modules??[]),i=EIe(e,n);if(i===0)return[];let o=ys([...r.testGlobs],{cwd:e,dot:!1});if(o.length===0)return[];let s=[];for(let a of o){let c=K5(e,a);if(!V5(c))continue;let l=W5(c).mtimeMs,u=(i-l)/(1e3*60*60*24);u>kIe&&s.push({detector:mC,severity:"warn",path:a,message:`${a} is ${Math.round(u)} days older than newest source module`})}return s}var mC,kIe,iS,hC=y(()=>{"use strict";vp();Ba();wt();mC="STALE_TESTS",kIe=30;iS={name:mC,run:AIe}});import{existsSync as OIe}from"node:fs";import{join as RIe}from"node:path";function IIe(t){let{cwd:e="."}=t;return ge(e,Np,r=>PIe(r,e))}function PIe(t,e){let r=[];for(let n of t.features){let i=n.modules??[],o=n.acceptance_criteria??[];if(n.status==="done"&&i.length===0&&o.length===0){r.push({detector:Np,severity:"error",message:`feature ${n.id} status='done' but declares no modules and no acceptance_criteria \u2014 nothing to verify (hollow completion)`});continue}if(i.length===0)continue;let s=i.filter(a=>!OIe(RIe(e,a)));s.length!==0&&(n.status==="done"?r.push({detector:Np,severity:"error",message:`feature ${n.id} status='done' but ${s.length}/${i.length} module(s) missing: ${s.join(", ")}`}):n.status==="in_progress"&&s.length===i.length&&r.push({detector:Np,severity:Hl(n.status)?"info":"warn",message:`feature ${n.id} is in progress and none of its declared modules are built yet \u2014 the normal state while implementing`}))}return r}var Np,oS,gC=y(()=>{"use strict";Vv();wt();Np="STATUS_DRIFT";oS={name:Np,run:IIe}});function CIe(t){let{cwd:e="."}=t;return ge(e,sS,r=>DIe(r,e))}function DIe(t,e){let r=dt(e).language;return r==="unknown"?[{detector:sS,severity:"info",message:"no manifest matched \u2014 language cannot be cross-checked"}]:t.project.language===r?[]:[{detector:sS,severity:"warn",message:`spec.project.language='${t.project.language}' but the manifest chain detects '${r}'`}]}var sS,J5,Y5=y(()=>{"use strict";on();wt();sS="TECH_STACK_MISMATCH";J5={name:sS,run:CIe}});function FIe(t){if((t.features??[]).length`${i}/${o}/**/*.${n}`)}function LIe(t){let{cwd:e="."}=t;return ge(e,yC,r=>zIe(r,e))}function zIe(t,e){let r=new Set;for(let o of t.features)for(let s of o.modules??[])r.add(s);let n=ys([...FIe(t)],{cwd:e,dot:!1}),i=[];for(let o of n)r.has(o)||i.push({detector:yC,severity:"error",path:o,message:`file '${o}' is not claimed by any feature in spec.yaml`});return i}var yC,X5,NIe,jIe,MIe,aS,_C=y(()=>{"use strict";vp();qP();wt();yC="UNMAPPED_ARTIFACT",X5=["src/stages/**/*.ts","src/spec/**/*.ts"],NIe={typescript:"ts",javascript:"js",python:"py",rust:"rs",go:"go",kotlin:"kt"},jIe={kotlin:"src/main/kotlin"},MIe=8;aS={name:yC,run:LIe}});import{existsSync as Q5}from"node:fs";import{join as eY}from"node:path";function qIe(t){return UIe.some(e=>t.startsWith(e))}function BIe(t){let{cwd:e="."}=t;return ge(e,bC,r=>HIe(r,e))}function HIe(t,e){let r=[];for(let n of t.features)if(n.status==="done")for(let i of n.acceptance_criteria??[])for(let o of i.test_refs??[]){if(qIe(o))continue;let s=o.split("#",1)[0];Q5(eY(e,o))||s&&Q5(eY(e,s))||r.push({detector:bC,severity:"error",path:o,message:`${n.id}.${i.id} test_ref '${o}' resolves to nothing on disk \u2014 a test_ref must be a real file path (e.g. 'tests/x.test.ts', optionally with a '#' anchor) or a 'self-dogfood: +`}function Nx(t){return`${JSON.stringify(t,null,2)} +`}function nte(t){let e=new Map(t.nodes.map(s=>[s.id,s])),r=new Map,n=new Map;for(let s of t.edges)(r.get(s.from)??r.set(s.from,[]).get(s.from)).push({other:s.to,kind:s.kind}),(n.get(s.to)??n.set(s.to,[]).get(s.to)).push({other:s.from,kind:s.kind});let i=s=>{let a=e.get(s);return a?`[[${Qee(a)}|${a.label.replace(/[[\]|]/g," ")}]]`:`[[${s.replace(/[[\]|]/g," ")}]]`},o=new Map;for(let s of t.nodes){let a=["---",`kind: ${s.kind}`,...s.tier?[`tier: ${s.tier}`]:[],...s.status?[`status: ${s.status}`]:[],`id: ${JSON.stringify(s.id)}`,"---",`# ${s.label}`,""],c=(r.get(s.id)??[]).slice().sort(ete);if(c.length>0){a.push("## Links");for(let u of c)a.push(`- ${u.kind} \u2192 ${i(u.other)}`);a.push("")}let l=(n.get(s.id)??[]).slice().sort(ete);if(l.length>0){a.push("## Backlinks");for(let u of l)a.push(`- ${i(u.other)} \u2192 ${u.kind}`);a.push("")}o.set(`${s.kind}/${Qee(s)}.md`,`${a.join(` +`)}`)}return o}function ete(t,e){return t.kind.localeCompare(e.kind)||t.other.localeCompare(e.other)}import{readFileSync as qUe}from"node:fs";import{dirname as BUe,join as $j}from"node:path";import{fileURLToPath as HUe}from"node:url";var kj=BUe(HUe(import.meta.url));function ite(t){for(let e of[$j(kj,"viewer",t),$j(kj,"..","graph","viewer",t),$j(kj,"..","..","dist","viewer",t)])try{return qUe(e,"utf8")}catch{}throw new Error(`cladding: viewer asset not found: ${t}`)}function ote(t){return JSON.stringify(t).replace(/0?` `:"";return` @@ -895,55 +895,57 @@ ${n.report.remainingQuestions} question(s) left. continue with \`clad clarify ${n} -`}ZP();lC();tC();nC();aC();GP();hC();gC();_C();vC();Km();cC();Be();var RUe=[Jv,cS,Kv,aS,Xv,tS,Hv,oS,iS,Bv];function IUe(t,e){if(t.path){let n=t.path.split("#")[0].trim(),i=[Ue.module(n),Ue.test(n),Ue.doc(n)].filter(o=>e.has(o));if(i.length>0)return i}let r=Tp().exec(t.message??"");return r&&e.has(Ue.feature(r[0]))?[Ue.feature(r[0])]:[]}function Nx(t,e="."){let r=new Set(t.nodes.map(o=>o.id)),n={};try{Ea(e,H(e))}catch{}try{for(let o of RUe){let s=[];try{s=o.run({cwd:e})}catch{continue}for(let a of s)if(!(a.severity!=="error"&&a.severity!=="warn"))for(let c of IUe(a,r)){let l=n[c]??(n[c]={severity:"warn",count:0,detectors:new Set});l.count+=1,l.detectors.add(a.detector),a.severity==="error"&&(l.severity="error")}}}finally{Ea(e,null)}let i={};for(let o of Object.keys(n).sort()){let s=n[o];i[o]={severity:s.severity,count:s.count,detectors:[...s.detectors].sort()}}return i}$j();Be();Oi();var CUe=new Set(["mermaid","dot","json","obsidian","html"]);function Qee(t={}){try{let e=t.format??"mermaid";if(!CUe.has(e)){L("fail","graph",`unknown --format '${e}' \u2014 use mermaid | dot | json | obsidian | html`),process.exit(1);return}let r=e,n=H(),i=bc(n,".");if(t.focus){let s=Ox(n,i,t.focus);if(s.length===0){L("fail","graph",`no node matches '${t.focus}' \u2014 try a feature id (F-\u2026), slug, or module path`),process.exit(1);return}let a=t.depth!==void 0?Number(t.depth):1/0;if(Number.isNaN(a)||a<0){L("fail","graph",`--depth must be a non-negative number, got '${t.depth}'`),process.exit(1);return}i=Tx(i,s,a)}if(r==="obsidian"){let s=t.out??".cladding/graph",a=Kee(i);for(let[c,l]of a){let u=PUe(s,c);kj(Aj(u),{recursive:!0}),Ej(u,l,"utf8")}L("pass","graph",`wrote ${a.size} note(s) to ${s} \u2014 open it as an Obsidian vault`),process.exit(0);return}if(r==="html"){if(!t.out){L("fail","graph","--format html requires --out (a single self-contained .html file)"),process.exit(1);return}let s=Dx(i,Nx(i,"."));kj(Aj(t.out),{recursive:!0}),Ej(t.out,s,"utf8"),L("pass","graph",`wrote a self-contained viewer to ${t.out} \u2014 open it in a browser (offline)`),process.exit(0);return}let o=r==="dot"?Wee(i):r==="json"?Cx(i):Vee(i);t.out?(kj(Aj(t.out),{recursive:!0}),Ej(t.out,o,"utf8"),L("pass","graph",`wrote ${r} graph to ${t.out}`),process.exit(0)):process.stdout.write(o,()=>process.exit(0))}catch(e){L("fail","graph",e.message),process.exit(1)}}function ete(){try{let t=bc(H(),".");process.stdout.write(Xee(jx(t)),()=>process.exit(0))}catch(t){L("fail","graph",t.message),process.exit(1)}}Km();import{createServer as DUe}from"node:http";import{existsSync as NUe,watch as jUe}from"node:fs";import{join as MUe}from"node:path";Be();Oi();function FUe(t={}){let e=t.cwd??".",r=new Set,n=()=>bc(H(e),e),i=()=>{for(let u of r)try{u.write(`data: refresh +`}VP();uC();rC();iC();cC();ZP();gC();yC();bC();SC();Km();lC();Ue();var GUe=[Yv,lS,Jv,cS,Qv,rS,Gv,sS,oS,Hv];function ZUe(t,e){if(t.path){let n=t.path.split("#")[0].trim(),i=[qe.module(n),qe.test(n),qe.doc(n)].filter(o=>e.has(o));if(i.length>0)return i}let r=Tp().exec(t.message??"");return r&&e.has(qe.feature(r[0]))?[qe.feature(r[0])]:[]}function Mx(t,e="."){let r=new Set(t.nodes.map(o=>o.id)),n={};try{Ea(e,B(e))}catch{}try{for(let o of GUe){let s=[];try{s=o.run({cwd:e})}catch{continue}for(let a of s)if(!(a.severity!=="error"&&a.severity!=="warn"))for(let c of ZUe(a,r)){let l=n[c]??(n[c]={severity:"warn",count:0,detectors:new Set});l.count+=1,l.detectors.add(a.detector),a.severity==="error"&&(l.severity="error")}}}finally{Ea(e,null)}let i={};for(let o of Object.keys(n).sort()){let s=n[o];i[o]={severity:s.severity,count:s.count,detectors:[...s.detectors].sort()}}return i}Ej();Ue();Ii();var WUe=new Set(["mermaid","dot","json","obsidian","html"]);function ate(t={}){try{let e=t.format??"mermaid";if(!WUe.has(e)){L("fail","graph",`unknown --format '${e}' \u2014 use mermaid | dot | json | obsidian | html`),process.exit(1);return}let r=e,n=B(),i=wc(n,".");if(t.focus){let s=Ix(n,i,t.focus);if(s.length===0){L("fail","graph",`no node matches '${t.focus}' \u2014 try a feature id (F-\u2026), slug, or module path`),process.exit(1);return}let a=t.depth!==void 0?Number(t.depth):1/0;if(Number.isNaN(a)||a<0){L("fail","graph",`--depth must be a non-negative number, got '${t.depth}'`),process.exit(1);return}i=Rx(i,s,a)}if(r==="obsidian"){let s=t.out??".cladding/graph",a=nte(i);for(let[c,l]of a){let u=VUe(s,c);Aj(Oj(u),{recursive:!0}),Tj(u,l,"utf8")}L("pass","graph",`wrote ${a.size} note(s) to ${s} \u2014 open it as an Obsidian vault`),process.exit(0);return}if(r==="html"){if(!t.out){L("fail","graph","--format html requires --out (a single self-contained .html file)"),process.exit(1);return}let s=jx(i,Mx(i,"."));Aj(Oj(t.out),{recursive:!0}),Tj(t.out,s,"utf8"),L("pass","graph",`wrote a self-contained viewer to ${t.out} \u2014 open it in a browser (offline)`),process.exit(0);return}let o=r==="dot"?rte(i):r==="json"?Nx(i):tte(i);t.out?(Aj(Oj(t.out),{recursive:!0}),Tj(t.out,o,"utf8"),L("pass","graph",`wrote ${r} graph to ${t.out}`),process.exit(0)):process.stdout.write(o,()=>process.exit(0))}catch(e){L("fail","graph",e.message),process.exit(1)}}function cte(){try{let t=wc(B(),".");process.stdout.write(ste(Fx(t)),()=>process.exit(0))}catch(t){L("fail","graph",t.message),process.exit(1)}}Km();import{createServer as KUe}from"node:http";import{existsSync as JUe,watch as YUe}from"node:fs";import{join as XUe}from"node:path";Ue();Ii();function QUe(t={}){let e=t.cwd??".",r=new Set,n=()=>wc(B(e),e),i=()=>{for(let u of r)try{u.write(`data: refresh -`)}catch{r.delete(u)}},o=DUe((u,d)=>{let f=(u.url??"/").split("?")[0],p=(u.headers.host??"").split(":")[0];if(p&&p!=="localhost"&&p!=="127.0.0.1"&&p!=="[::1]"&&p!=="::1"){d.writeHead(403,{"Content-Type":"text/plain"}),d.end("forbidden host");return}try{if(f==="/graph.json"){let m=Cx(n());d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(m);return}if(f==="/health.json"){let m=JSON.stringify(Nx(n(),e));d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(m);return}if(f==="/events"){d.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),d.write(`: connected +`)}catch{r.delete(u)}},o=KUe((u,d)=>{let f=(u.url??"/").split("?")[0],p=(u.headers.host??"").split(":")[0];if(p&&p!=="localhost"&&p!=="127.0.0.1"&&p!=="[::1]"&&p!=="::1"){d.writeHead(403,{"Content-Type":"text/plain"}),d.end("forbidden host");return}try{if(f==="/graph.json"){let m=Nx(n());d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(m);return}if(f==="/health.json"){let m=JSON.stringify(Mx(n(),e));d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(m);return}if(f==="/events"){d.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),d.write(`: connected -`),r.add(d),u.on("close",()=>r.delete(d));return}if(f==="/"||f==="/index.html"){let m=Dx(n());d.writeHead(200,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),d.end(m);return}d.writeHead(404,{"Content-Type":"text/plain"}),d.end("not found")}catch(m){if(d.headersSent)try{d.end()}catch{}else{d.writeHead(503,{"Content-Type":"application/json","Cache-Control":"no-store"});try{d.end(JSON.stringify({error:m.message}))}catch{}}}}),s=null,a=()=>{s&&clearTimeout(s),s=setTimeout(i,400)},c=[];for(let u of["spec","docs"]){let d=MUe(e,u);if(NUe(d))try{let f=jUe(d,{recursive:!0},a);f.on("error",()=>{try{f.close()}catch{}}),c.push(f)}catch{}}let l=setInterval(()=>{for(let u of r)try{u.write(`: keep-alive +`),r.add(d),u.on("close",()=>r.delete(d));return}if(f==="/"||f==="/index.html"){let m=jx(n());d.writeHead(200,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),d.end(m);return}d.writeHead(404,{"Content-Type":"text/plain"}),d.end("not found")}catch(m){if(d.headersSent)try{d.end()}catch{}else{d.writeHead(503,{"Content-Type":"application/json","Cache-Control":"no-store"});try{d.end(JSON.stringify({error:m.message}))}catch{}}}}),s=null,a=()=>{s&&clearTimeout(s),s=setTimeout(i,400)},c=[];for(let u of["spec","docs"]){let d=XUe(e,u);if(JUe(d))try{let f=YUe(d,{recursive:!0},a);f.on("error",()=>{try{f.close()}catch{}}),c.push(f)}catch{}}let l=setInterval(()=>{for(let u of r)try{u.write(`: keep-alive -`)}catch{r.delete(u)}},3e4);return typeof l.unref=="function"&&l.unref(),new Promise((u,d)=>{o.on("error",d),o.listen(t.port??0,"127.0.0.1",()=>{let f=o.address(),p=typeof f=="object"&&f?f.port:t.port??0;u({port:p,broadcast:i,close:()=>new Promise(m=>{s&&clearTimeout(s),clearInterval(l);for(let h of c)try{h.close()}catch{}for(let h of r)try{h.end()}catch{}r.clear(),o.close(()=>m()),typeof o.closeAllConnections=="function"&&o.closeAllConnections()})})})})}async function tte(t={}){let e=t.port!==void 0?Number(t.port):3e3;try{let r=await FUe({port:e,cwd:t.cwd??"."});L("pass","graph",`live graph at http://localhost:${r.port} \u2014 edit spec/ or docs/ and the view auto-reloads (Ctrl-C to stop)`)}catch(r){L("fail","graph",r.message),process.exit(1)}}var LUe=["stage_1.1","stage_2.1","stage_2.3"];function zUe(t){return(t.features??[]).filter(e=>e.status==="done")}function UUe(t,e){let r=zUe(t);switch(e){case"stage_1.1":return!t.project?.language||r.length===0?null:`project.language is '${t.project.language}' and ${r.length} feature(s) are done, but the type checker did not run (skipped) \u2014 type safety of shipped code was never verified. Install the language toolchain; under --strict, an unverifiable 'done' is not GREEN.`;case"stage_2.1":{let n=r.filter(i=>(i.acceptance_criteria??[]).some(o=>(o.test_refs??[]).length>0)).length;return n===0?null:`${n} done feature(s) declare tests but the test runner did not run (skipped) \u2014 the implementation was never verified. Install the test framework; under --strict, an unverifiable 'done' is not GREEN.`}case"stage_2.3":{let n=r.flatMap(i=>i.acceptance_criteria??[]).filter(i=>(i.oracle_refs??[]).length>0).length;return n===0?null:`${n} done AC(s) declare oracle_refs but the conformance runner did not run (skipped) \u2014 the declared oracles never executed. Under --strict, declared-but-unrun verification is not GREEN.`}}}function rte(t,e){let r=[];for(let n of LUe){if(!e.some(s=>s.stage===n&&s.status==="skip"))continue;let o=UUe(t,n);o&&r.push({stage:n,label:"Verification",message:o})}return r}bS();import nte from"node:process";function qUe(t,e){let r=e.filter(i=>i.acId===t),n=r.filter(i=>i.identity.author==="human");return n.length===0?{acId:t,pass:!1,totalEvidence:r.length,humanEvidence:0,reason:r.length===0?"no evidence at all":`${r.length} tool/LLM evidence but 0 human \u2014 anti-self-cert guard blocks`}:{acId:t,pass:!0,totalEvidence:r.length,humanEvidence:n.length}}function Mx(t){let e=new Set;for(let n of t)n.acId&&e.add(n.acId);let r=[];for(let n of e){let i=qUe(n,t);i.pass||r.push(i)}return r}ri();var Tj="stage_4.1";function Oj(t={}){let{cwd:e="."}=t,r=Rn(e);if(r.length===0)return{stage:Tj,pass:!1,exitCode:2,stderr:"no audit log present \u2014 record evidence before running stage_4.1"};let n=Mx(r);if(n.length===0)return{stage:Tj,pass:!0,exitCode:0};let i=n.map(o=>`${o.acId}: ${o.reason}`).join("; ");return{stage:Tj,pass:!1,exitCode:1,stderr:`anti-self-cert guard: ${i}`}}var BUe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${nte.argv[1]}`;if(BUe){let t=Oj();console.log(JSON.stringify(t)),nte.exit(t.exitCode)}yl();import{randomBytes as HUe}from"node:crypto";import{unlinkSync as GUe}from"node:fs";import{tmpdir as ZUe}from"node:os";import{join as VUe,resolve as Rj}from"node:path";import WUe from"node:process";var qr=null;function ite(t){qr={cwd:Rj(t),run:null,jsonFile:null}}function ote(){return qr!==null}function ste(t,e){if(!qr||qr.cwd!==Rj(t))return null;if(qr.run)return qr.run;let r=VUe(ZUe(),`clad-shared-vitest-${WUe.pid}-${HUe(6).toString("hex")}.json`);qr.jsonFile=r;let n=e(r);return qr.run={proc:n,jsonFile:r},qr.run}function ate(t){return!qr||qr.cwd!==Rj(t)?null:qr.run}function cte(t){return t.pass&&t.exitCode===0?"reuse-pass":"fallback"}function lte(){let t=qr?.jsonFile;if(qr=null,t)try{GUe(t)}catch{}}Mr();import ute from"node:process";var Fx="stage_1.4";function Ij(t={}){let{cwd:e="."}=t,r;try{r=Ye("git",["status","--porcelain"],{cwd:e,reject:!1})}catch(i){if(i.code==="ENOENT")return{stage:Fx,pass:!1,exitCode:2,stderr:"git binary not found"};throw i}if(r.exitCode!==0){let i=(r.stderr??"").toString().trim()||"not a git repository";return{stage:Fx,pass:!1,exitCode:2,stderr:i}}let n=(r.stdout??"").toString().trim();return n.length===0?{stage:Fx,pass:!0,exitCode:0}:{stage:Fx,pass:!1,exitCode:1,stderr:`working tree dirty: -${n}`}}var KUe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${ute.argv[1]}`;if(KUe){let t=Ij();console.log(JSON.stringify(t)),ute.exit(t.exitCode)}Mr();import dte from"node:process";Jm();On();var Lx="stage_2.2";function Pj(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=No("coverage",t))}catch(c){return{stage:Lx,pass:!1,exitCode:1,stderr:c.message}}if(!r||!n)return{stage:Lx,pass:!1,exitCode:2,stderr:`no coverage runner registered for language '${i}'`};let o=ate(e),s=o?o.proc:Ye(r,[...n],{cwd:e,reject:!1}),a=qt(Lx,r,s,n);return a||tr(Lx,s)}var XUe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${dte.argv[1]}`;if(XUe){let t=Pj();console.log(JSON.stringify(t)),dte.exit(t.exitCode)}Mp();Cj();Mr();on();On();import pte from"node:process";var Bx="stage_3.2";function Dj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.perf,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Bx,pass:!1,exitCode:2,stderr:`no perf runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Ll(e,o[o.length-1]))return{stage:Bx,pass:!1,exitCode:2,stderr:"perf npm script not defined"};let s=Ye(i,[...o],{cwd:e,reject:!1}),a=qt(Bx,i,s,o);return a||tr(Bx,s)}var hqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${pte.argv[1]}`;if(hqe){let t=Dj();console.log(JSON.stringify(t)),pte.exit(t.exitCode)}Mr();Be();On();import{existsSync as gqe}from"node:fs";import{resolve as hte}from"node:path";import gte from"node:process";var li="stage_2.4",Nj=5e3,yqe=3e4;function jj(t={}){let{cwd:e="."}=t,r,n=[],i=!1,o=new Map;try{let p=H(e);r=p.project.deliverable,n=p.project.smoke??[],i=p.features.some(m=>m.status==="done"),o=new Map(p.features.map(m=>[m.id,m.status]))}catch{return{stage:li,pass:!1,exitCode:2,stderr:"spec.yaml not loaded \u2014 deliverable smoke skipped"}}if(n.length>0)return bqe(e,n,{anyDone:i,featureStatus:o});if(!r)return{stage:li,pass:!1,exitCode:2,stderr:"no project.deliverable declared \u2014 skipped"};if(r.is_safe_to_smoke!==!0)return{stage:li,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not marked is_safe_to_smoke \u2014 skipped`};if(!i)return{stage:li,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 deliverable smoke skipped"};let s=hte(e,r.path);if(!gqe(s))return{stage:li,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not found \u2014 see DELIVERABLE_INTEGRITY`};let a=r.timeout_ms??Nj,c;try{c=Ye(s,[...r.smoke_args??[]],{cwd:e,reject:!1,timeout:a})}catch(p){c=p}let l=qt(li,r.path,c);if(l)return l;if(c.timedOut)return{stage:li,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' timed out after ${a}ms (hung or too slow)`};let u=r.expect_exit??0,d=c.exitCode??1;if(d===u)return{stage:li,pass:!0,exitCode:0,disposition:"liveness"};let f=String(c.stderr??"").trim()||String(c.stdout??"").trim();return{stage:li,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' exited ${d}, expected ${u}${f?` \u2014 ${f.slice(0,200)}`:""}`}}var mte={fail:5,advisory:4,pending_env:4,liveness:3,pass:2,na:1,skip:0},_qe={pass:"\u2713",fail:"\u2717",liveness:"liveness",na:"na",pending_env:"pending_env",advisory:"advisory",skip:"skip"};function bqe(t,e,r){let n=Math.min(e.length*Nj,yqe),i=Date.now(),o=[];for(let s of e){if(Date.now()-i>=n){o.push({argv:(s.run??[]).join(" ")||"(none)",kind:s.kind,disposition:"pending_env",detail:"stage time ceiling \u2014 not started",feature:s.feature,why:s.why});continue}o.push(vqe(t,s,r))}return Sqe(o)}function vqe(t,e,r){let n=(e.run??[]).join(" ")||"(none)",i=e.why;if(e.kind==="none")return{argv:"(kind:none)",kind:"none",disposition:"na",detail:"nothing to run (library/static)",why:i};let o=e.feature;if(o!==void 0){let h=r.featureStatus.get(o);if(h!=="done"){let g=h===void 0?`bound feature ${o} not found in spec \u2014 not executed`:`bound feature ${o} is ${h}, not done \u2014 not executed`;return{argv:n,kind:"cli",disposition:"na",detail:g,feature:o,why:i}}}else if(!r.anyDone)return{argv:n,kind:"cli",disposition:"skip",detail:"no done feature yet \u2014 smoke probe skipped",why:i};let s=e.run??[];if(s.length===0)return{argv:"(none)",kind:"cli",disposition:"skip",detail:"cli smoke probe has no run argv \u2014 skipped",feature:o,why:i};let[a,...c]=s,l=a.startsWith(".")||a.startsWith("/")?hte(t,a):a,u=Nj,d;try{d=Ye(l,[...c],{cwd:t,reject:!1,timeout:u})}catch(h){d=h}if(za(d))return{argv:n,kind:"cli",disposition:"skip",detail:`'${a}' not installed`,feature:o,why:i};if(d.timedOut)return{argv:n,kind:"cli",disposition:"fail",detail:`timed out after ${u}ms`,feature:o,why:i};let f=e.expect?.exit??0,p=d.exitCode??1;if(p!==f){let h=String(d.stderr??"").trim()||String(d.stdout??"").trim();return{argv:n,kind:"cli",disposition:"fail",detail:`exited ${p}, expected ${f}${h?` \u2014 ${h.slice(0,200)}`:""}`,feature:o,why:i}}let m=e.expect?.token;return m?String(d.stdout??"").includes(m)?{argv:n,kind:"cli",disposition:"pass",detail:`ran clean (exit ${p}), stdout contains ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"fail",detail:`ran (exit ${p}) but stdout did not contain the AC token ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"liveness",detail:`ran clean (exit ${p}), no token declared \u2014 exit-only`,feature:o,why:i}}function Sqe(t){let e="skip";for(let o of t)mte[o.disposition]>mte[e]&&(e=o.disposition);let r=t.map(o=>{let s=o.why?` \xB7 ${o.why}`:"";return`${_qe[o.disposition]} ${o.argv} \xB7 ${o.detail}${s}`}).join(` -`),n=t.map((o,s)=>({id:`probe_${s+1}`,kind:o.kind,disposition:o.disposition==="skip"?"na":o.disposition,bindsFeature:o.feature,why:o.why,detail:o.detail}));if(e==="skip")return{stage:li,pass:!1,exitCode:2,stderr:r,probes:n};let i=e==="fail"||e==="pending_env"||e==="advisory";return{stage:li,pass:!i,exitCode:i?1:0,disposition:e,stderr:r,probes:n}}var wqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${gte.argv[1]}`;if(wqe){let t=jj();console.log(JSON.stringify(t)),gte.exit(t.exitCode)}Mr();on();On();import yte from"node:process";var Hx="stage_3.1";function Mj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.smoke,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Hx,pass:!1,exitCode:2,stderr:`no smoke runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Ll(e,o[o.length-1]))return{stage:Hx,pass:!1,exitCode:2,stderr:"smoke npm script not defined"};let s=Ye(i,[...o],{cwd:e,reject:!1}),a=qt(Hx,i,s,o);return a||tr(Hx,s)}var xqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${yte.argv[1]}`;if(xqe){let t=Mj();console.log(JSON.stringify(t)),yte.exit(t.exitCode)}dC();Fj();Lj();Mr();Ux();import{randomBytes as Rqe}from"node:crypto";import{unlinkSync as Iqe}from"node:fs";import{tmpdir as Pqe}from"node:os";import{join as Cqe}from"node:path";import Uj from"node:process";Jm();On();Be();import{readFileSync as Eqe}from"node:fs";import{resolve as vte}from"node:path";function Aqe(t){let e=t.trim();if(!e.startsWith("{"))return null;let r;try{r=JSON.parse(e)}catch{return null}let n=r.testResults;if(!Array.isArray(n))return null;let i=new Map;for(let o of n){if(typeof o.name!="string"||!o.name)continue;let s=vte(o.name),a=i.get(s)??0;for(let c of o.assertionResults??[])c.status==="passed"&&(a+=1);i.set(s,a)}return i}function Tqe(t){let e=t.indexOf("#");return(e===-1?t:t.slice(0,e)).trim()}function Oqe(t,e,r){let n=[];for(let i of t.features??[]){if(i.status!=="done")continue;let o=[],s=new Set;for(let u of i.acceptance_criteria??[])for(let d of u.test_refs??[]){let f=Tqe(d);f&&!s.has(f)&&(s.add(f),o.push(f))}if(o.length===0)continue;let a=!0,c=!1;for(let u of o){let d=e.get(vte(r,u));if(d===void 0){a=!1;break}if(d>0){c=!0;break}}if(c||!a)continue;let l=i.title||i.id;n.push({detector:"VACUOUS_TESTS",severity:"warn",path:o[0],message:`Done feature "${l}" declares tests, but none of its test files executed a passing test (all skipped / todo / empty) \u2014 its behavioral proof never actually ran`})}return n}function zj(t,e){try{let r=Aqe(Eqe(t,"utf8"));return r?Oqe(H(e),r,e):[]}catch{return[]}}var Ji="stage_2.1";function Ste(t,e){return t==="vitest"||t.endsWith("/vitest")||e.includes("vitest")}function Dqe(t){let e=`${String(t.stdout??"")} -${String(t.stderr??"")}`,r=[],n=[/^\s*#\s*tests\s+(\d+)\s*$/gim,/^\s*ℹ\s+tests\s+(\d+)\s*$/gim,/^\s*Tests:\s+.*?\b(\d+)\s+total\b.*$/gim];for(let i of n)for(let o of e.matchAll(i))r.push(Number(o[1]));return r.length>0&&r.every(i=>i===0)}function Nqe(t,e,r){let n,i;try{({cmd:n,args:i}=No("coverage",t))}catch{return null}if(!n||!i||!Ste(n,i))return null;let o=n,s=i,a=ste(e,d=>Ye(o,[...s,"--reporter=default","--reporter=json",`--outputFile=${d}`],{cwd:e,reject:!1}));if(!a)return null;let{proc:c,jsonFile:l}=a;if(qt(Ji,n,c,s))return null;let u=tr(Ji,c);if(cte(u)==="fallback")return null;if(r){let d=zj(l,e);if(d.length>0)return{stage:Ji,pass:!1,exitCode:1,findings:d,stderr:d[0].message}}return{stage:Ji,pass:!0,exitCode:0}}function qj(t={}){let{cwd:e=".",strict:r=!1}=t,n,i,o;try{({cmd:n,args:i,language:o}=No("test",t))}catch(u){return{stage:Ji,pass:!1,exitCode:1,stderr:u.message}}if(!n||!i)return{stage:Ji,pass:!1,exitCode:2,stderr:`no unit test runner registered for language '${o}'`};let s=Ste(n,i),a=r&&s;if(ote()&&s){let u=Nqe(t,e,a);if(u)return u}let c,l=i;a&&(c=Cqe(Pqe(),`clad-vitest-${Uj.pid}-${Rqe(6).toString("hex")}.json`),l=[...i,"--reporter=default","--reporter=json",`--outputFile=${c}`]);try{let u=Ye(n,[...l],{cwd:e,reject:!1}),d=qt(Ji,n,u,l);if(d)return d;let f=Ru("unit",tr(Ji,u),u);if(r&&f.pass&&Dqe(u)){let p={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Ji,pass:!1,exitCode:1,findings:[p],stderr:p.message}}if(a&&f.pass&&c){let p=zj(c,e);if(p.length>0)return{stage:Ji,pass:!1,exitCode:1,findings:p,stderr:p[0].message}}return f}finally{if(c)try{Iqe(c)}catch{}}}var jqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Uj.argv[1]}`;if(jqe){let t=qj();console.log(JSON.stringify(t)),Uj.exit(t.exitCode)}Mr();on();On();import wte from"node:process";var Vx="stage_3.3";function Bj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.visual,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Vx,pass:!1,exitCode:2,stderr:`no visual runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Ll(e,o[o.length-1]))return{stage:Vx,pass:!1,exitCode:2,stderr:"visual npm script not defined"};let s=Ye(i,[...o],{cwd:e,reject:!1}),a=qt(Vx,i,s,o);return a||tr(Vx,s)}var Mqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${wte.argv[1]}`;if(Mqe){let t=Bj();console.log(JSON.stringify(t)),wte.exit(t.exitCode)}pC();jf();_a();Gj();kp();Qv();var Ote=St(Qt(),1);import{existsSync as Zj,readFileSync as Wqe,readdirSync as Tte,statSync as Kqe,writeFileSync as Jqe}from"node:fs";import{basename as eh,join as th,relative as Ate}from"node:path";var Yqe=["self-dogfood:","fixture:","derived:"],Rte=/\.(test|spec)\.[jt]sx?$/;function Ite(t,e=t,r=[]){let n;try{n=Tte(e)}catch{return r}for(let i of n){if(i.startsWith("."))continue;let o=th(e,i);try{Kqe(o).isDirectory()?Ite(t,o,r):Rte.test(i)&&r.push(o)}catch{continue}}return r}function Pte(t="."){let e=th(t,"spec","features"),r=th(t,"tests"),n=[],i=[];if(!Zj(e)||!Zj(r))return{repaired:n,suggested:i};let o=Ite(r),s=new Map;for(let a of o){let c=Ate(t,a).split("\\").join("/"),l=s.get(eh(a))??[];l.push(c),s.set(eh(a),l)}for(let a of Tte(e)){if(!a.endsWith(".yaml")&&!a.endsWith(".yml"))continue;let c=th(e,a),l,u;try{l=Wqe(c,"utf8"),u=(0,Ote.parse)(l)}catch{continue}if(!u||u.status!=="done")continue;let d=!1;for(let h of u.acceptance_criteria??[])for(let g of h.test_refs??[]){if(Yqe.some(x=>g.startsWith(x)))continue;let b=g.split("#",1)[0];if(Zj(th(t,b)))continue;let _=s.get(eh(b))??[];if(_.length!==1)continue;let S=g.replace(b,_[0]);S!==g&&l.includes(g)&&(l=l.split(g).join(S),n.push({shard:a,from:g,to:S}),d=!0)}let f=u.slug??"",p=(u.modules??[]).map(h=>eh(h).replace(/\.[jt]sx?$/,"")),m=o.map(h=>Ate(t,h).split("\\").join("/")).find(h=>{let g=eh(h).replace(Rte,"");return f!==""&&g===f||p.includes(g)});if(m)for(let h of u.acceptance_criteria??[]){if((h.test_refs?.length??0)>0||(h.evidence_refs?.length??0)>0||!h.id)continue;let g=new RegExp(`^(([ ]+)- id: ${h.id}\\b.*)$`,"m"),b=l.match(g);if(!b)continue;let _=b[2]+" ";l=l.replace(g,`$1 +`)}catch{r.delete(u)}},3e4);return typeof l.unref=="function"&&l.unref(),new Promise((u,d)=>{o.on("error",d),o.listen(t.port??0,"127.0.0.1",()=>{let f=o.address(),p=typeof f=="object"&&f?f.port:t.port??0;u({port:p,broadcast:i,close:()=>new Promise(m=>{s&&clearTimeout(s),clearInterval(l);for(let h of c)try{h.close()}catch{}for(let h of r)try{h.end()}catch{}r.clear(),o.close(()=>m()),typeof o.closeAllConnections=="function"&&o.closeAllConnections()})})})})}async function lte(t={}){let e=t.port!==void 0?Number(t.port):3e3;try{let r=await QUe({port:e,cwd:t.cwd??"."});L("pass","graph",`live graph at http://localhost:${r.port} \u2014 edit spec/ or docs/ and the view auto-reloads (Ctrl-C to stop)`)}catch(r){L("fail","graph",r.message),process.exit(1)}}var eqe=["stage_1.1","stage_2.1","stage_2.3"];function tqe(t){return(t.features??[]).filter(e=>e.status==="done")}function rqe(t,e){let r=tqe(t);switch(e){case"stage_1.1":return!t.project?.language||r.length===0?null:`project.language is '${t.project.language}' and ${r.length} feature(s) are done, but the type checker did not run (skipped) \u2014 type safety of shipped code was never verified. Install the language toolchain; under --strict, an unverifiable 'done' is not GREEN.`;case"stage_2.1":{let n=r.filter(i=>(i.acceptance_criteria??[]).some(o=>(o.test_refs??[]).length>0)).length;return n===0?null:`${n} done feature(s) declare tests but the test runner did not run (skipped) \u2014 the implementation was never verified. Install the test framework; under --strict, an unverifiable 'done' is not GREEN.`}case"stage_2.3":{let n=r.flatMap(i=>i.acceptance_criteria??[]).filter(i=>(i.oracle_refs??[]).length>0).length;return n===0?null:`${n} done AC(s) declare oracle_refs but the conformance runner did not run (skipped) \u2014 the declared oracles never executed. Under --strict, declared-but-unrun verification is not GREEN.`}}}function ute(t,e){let r=[];for(let n of eqe){if(!e.some(s=>s.stage===n&&s.status==="skip"))continue;let o=rqe(t,n);o&&r.push({stage:n,label:"Verification",message:o})}return r}SS();import dte from"node:process";function nqe(t,e){let r=e.filter(i=>i.acId===t),n=r.filter(i=>i.identity.author==="human");return n.length===0?{acId:t,pass:!1,totalEvidence:r.length,humanEvidence:0,reason:r.length===0?"no evidence at all":`${r.length} tool/LLM evidence but 0 human \u2014 anti-self-cert guard blocks`}:{acId:t,pass:!0,totalEvidence:r.length,humanEvidence:n.length}}function Lx(t){let e=new Set;for(let n of t)n.acId&&e.add(n.acId);let r=[];for(let n of e){let i=nqe(n,t);i.pass||r.push(i)}return r}ni();var Rj="stage_4.1";function Ij(t={}){let{cwd:e="."}=t,r=In(e);if(r.length===0)return{stage:Rj,pass:!1,exitCode:2,stderr:"no audit log present \u2014 record evidence before running stage_4.1"};let n=Lx(r);if(n.length===0)return{stage:Rj,pass:!0,exitCode:0};let i=n.map(o=>`${o.acId}: ${o.reason}`).join("; ");return{stage:Rj,pass:!1,exitCode:1,stderr:`anti-self-cert guard: ${i}`}}var iqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${dte.argv[1]}`;if(iqe){let t=Ij();console.log(JSON.stringify(t)),dte.exit(t.exitCode)}vl();import{randomBytes as oqe}from"node:crypto";import{unlinkSync as sqe}from"node:fs";import{tmpdir as aqe}from"node:os";import{join as cqe,resolve as Pj}from"node:path";import lqe from"node:process";var qr=null;function fte(t){qr={cwd:Pj(t),run:null,jsonFile:null}}function Cj(){return qr!==null}function Dj(t,e){if(!qr||qr.cwd!==Pj(t))return null;if(qr.run)return qr.run;let r=cqe(aqe(),`clad-shared-vitest-${lqe.pid}-${oqe(6).toString("hex")}.json`);qr.jsonFile=r;let n=e(r);return qr.run={proc:n,jsonFile:r},qr.run}function pte(t){return!qr||qr.cwd!==Pj(t)?null:qr.run}function Nj(t){return t.pass&&t.exitCode===0?"reuse-pass":"fallback"}function mte(){let t=qr?.jsonFile;if(qr=null,t)try{sqe(t)}catch{}}Mr();import hte from"node:process";var zx="stage_1.4";function jj(t={}){let{cwd:e="."}=t,r;try{r=We("git",["status","--porcelain"],{cwd:e,reject:!1})}catch(i){if(i.code==="ENOENT")return{stage:zx,pass:!1,exitCode:2,stderr:"git binary not found"};throw i}if(r.exitCode!==0){let i=(r.stderr??"").toString().trim()||"not a git repository";return{stage:zx,pass:!1,exitCode:2,stderr:i}}let n=(r.stdout??"").toString().trim();return n.length===0?{stage:zx,pass:!0,exitCode:0}:{stage:zx,pass:!1,exitCode:1,stderr:`working tree dirty: +${n}`}}var uqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${hte.argv[1]}`;if(uqe){let t=jj();console.log(JSON.stringify(t)),hte.exit(t.exitCode)}Mr();import gte from"node:process";Jm();Rn();var Ux="stage_2.2";function Mj(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=Yi("coverage",t))}catch(c){return{stage:Ux,pass:!1,exitCode:1,stderr:c.message}}if(!r||!n)return{stage:Ux,pass:!1,exitCode:2,stderr:`no coverage runner registered for language '${i}'`};let o=pte(e),s=o?o.proc:We(r,[...n],{cwd:e,reject:!1}),a=Nt(Ux,r,s,n);return a||Yt(Ux,s)}var pqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${gte.argv[1]}`;if(pqe){let t=Mj();console.log(JSON.stringify(t)),gte.exit(t.exitCode)}Mp();Fj();Mr();sn();Rn();import _te from"node:process";var Hx="stage_3.2";function Lj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.perf,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Hx,pass:!1,exitCode:2,stderr:`no perf runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!ql(e,o[o.length-1]))return{stage:Hx,pass:!1,exitCode:2,stderr:"perf npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Hx,i,s,o);return a||Yt(Hx,s)}var Cqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${_te.argv[1]}`;if(Cqe){let t=Lj();console.log(JSON.stringify(t)),_te.exit(t.exitCode)}Mr();Ue();Rn();import{existsSync as Dqe}from"node:fs";import{resolve as vte}from"node:path";import Ste from"node:process";var di="stage_2.4",zj=5e3,Nqe=3e4;function Uj(t={}){let{cwd:e="."}=t,r,n=[],i=!1,o=new Map;try{let p=B(e);r=p.project.deliverable,n=p.project.smoke??[],i=p.features.some(m=>m.status==="done"),o=new Map(p.features.map(m=>[m.id,m.status]))}catch{return{stage:di,pass:!1,exitCode:2,stderr:"spec.yaml not loaded \u2014 deliverable smoke skipped"}}if(n.length>0)return Mqe(e,n,{anyDone:i,featureStatus:o});if(!r)return{stage:di,pass:!1,exitCode:2,stderr:"no project.deliverable declared \u2014 skipped"};if(r.is_safe_to_smoke!==!0)return{stage:di,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not marked is_safe_to_smoke \u2014 skipped`};if(!i)return{stage:di,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 deliverable smoke skipped"};let s=vte(e,r.path);if(!Dqe(s))return{stage:di,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not found \u2014 see DELIVERABLE_INTEGRITY`};let a=r.timeout_ms??zj,c;try{c=We(s,[...r.smoke_args??[]],{cwd:e,reject:!1,timeout:a})}catch(p){c=p}let l=Nt(di,r.path,c);if(l)return l;if(c.timedOut)return{stage:di,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' timed out after ${a}ms (hung or too slow)`};let u=r.expect_exit??0,d=c.exitCode??1;if(d===u)return{stage:di,pass:!0,exitCode:0,disposition:"liveness"};let f=String(c.stderr??"").trim()||String(c.stdout??"").trim();return{stage:di,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' exited ${d}, expected ${u}${f?` \u2014 ${f.slice(0,200)}`:""}`}}var bte={fail:5,advisory:4,pending_env:4,liveness:3,pass:2,na:1,skip:0},jqe={pass:"\u2713",fail:"\u2717",liveness:"liveness",na:"na",pending_env:"pending_env",advisory:"advisory",skip:"skip"};function Mqe(t,e,r){let n=Math.min(e.length*zj,Nqe),i=Date.now(),o=[];for(let s of e){if(Date.now()-i>=n){o.push({argv:(s.run??[]).join(" ")||"(none)",kind:s.kind,disposition:"pending_env",detail:"stage time ceiling \u2014 not started",feature:s.feature,why:s.why});continue}o.push(Fqe(t,s,r))}return Lqe(o)}function Fqe(t,e,r){let n=(e.run??[]).join(" ")||"(none)",i=e.why;if(e.kind==="none")return{argv:"(kind:none)",kind:"none",disposition:"na",detail:"nothing to run (library/static)",why:i};let o=e.feature;if(o!==void 0){let h=r.featureStatus.get(o);if(h!=="done"){let g=h===void 0?`bound feature ${o} not found in spec \u2014 not executed`:`bound feature ${o} is ${h}, not done \u2014 not executed`;return{argv:n,kind:"cli",disposition:"na",detail:g,feature:o,why:i}}}else if(!r.anyDone)return{argv:n,kind:"cli",disposition:"skip",detail:"no done feature yet \u2014 smoke probe skipped",why:i};let s=e.run??[];if(s.length===0)return{argv:"(none)",kind:"cli",disposition:"skip",detail:"cli smoke probe has no run argv \u2014 skipped",feature:o,why:i};let[a,...c]=s,l=a.startsWith(".")||a.startsWith("/")?vte(t,a):a,u=zj,d;try{d=We(l,[...c],{cwd:t,reject:!1,timeout:u})}catch(h){d=h}if(za(d))return{argv:n,kind:"cli",disposition:"skip",detail:`'${a}' not installed`,feature:o,why:i};if(d.timedOut)return{argv:n,kind:"cli",disposition:"fail",detail:`timed out after ${u}ms`,feature:o,why:i};let f=e.expect?.exit??0,p=d.exitCode??1;if(p!==f){let h=String(d.stderr??"").trim()||String(d.stdout??"").trim();return{argv:n,kind:"cli",disposition:"fail",detail:`exited ${p}, expected ${f}${h?` \u2014 ${h.slice(0,200)}`:""}`,feature:o,why:i}}let m=e.expect?.token;return m?String(d.stdout??"").includes(m)?{argv:n,kind:"cli",disposition:"pass",detail:`ran clean (exit ${p}), stdout contains ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"fail",detail:`ran (exit ${p}) but stdout did not contain the AC token ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"liveness",detail:`ran clean (exit ${p}), no token declared \u2014 exit-only`,feature:o,why:i}}function Lqe(t){let e="skip";for(let o of t)bte[o.disposition]>bte[e]&&(e=o.disposition);let r=t.map(o=>{let s=o.why?` \xB7 ${o.why}`:"";return`${jqe[o.disposition]} ${o.argv} \xB7 ${o.detail}${s}`}).join(` +`),n=t.map((o,s)=>({id:`probe_${s+1}`,kind:o.kind,disposition:o.disposition==="skip"?"na":o.disposition,bindsFeature:o.feature,why:o.why,detail:o.detail}));if(e==="skip")return{stage:di,pass:!1,exitCode:2,stderr:r,probes:n};let i=e==="fail"||e==="pending_env"||e==="advisory";return{stage:di,pass:!i,exitCode:i?1:0,disposition:e,stderr:r,probes:n}}var zqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Ste.argv[1]}`;if(zqe){let t=Uj();console.log(JSON.stringify(t)),Ste.exit(t.exitCode)}Mr();sn();Rn();import wte from"node:process";var Gx="stage_3.1";function qj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.smoke,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Gx,pass:!1,exitCode:2,stderr:`no smoke runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!ql(e,o[o.length-1]))return{stage:Gx,pass:!1,exitCode:2,stderr:"smoke npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Gx,i,s,o);return a||Yt(Gx,s)}var Uqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${wte.argv[1]}`;if(Uqe){let t=qj();console.log(JSON.stringify(t)),wte.exit(t.exitCode)}fC();Bj();Hj();Mr();qx();import{randomBytes as Wqe}from"node:crypto";import{unlinkSync as Kqe}from"node:fs";import{tmpdir as Jqe}from"node:os";import{join as Yqe}from"node:path";import Zj from"node:process";Jm();Rn();Ue();import{readFileSync as Hqe}from"node:fs";import{resolve as kte}from"node:path";function Gqe(t){let e=t.trim();if(!e.startsWith("{"))return null;let r;try{r=JSON.parse(e)}catch{return null}let n=r.testResults;if(!Array.isArray(n))return null;let i=new Map;for(let o of n){if(typeof o.name!="string"||!o.name)continue;let s=kte(o.name),a=i.get(s)??0;for(let c of o.assertionResults??[])c.status==="passed"&&(a+=1);i.set(s,a)}return i}function Zqe(t){let e=t.indexOf("#");return(e===-1?t:t.slice(0,e)).trim()}function Vqe(t,e,r){let n=[];for(let i of t.features??[]){if(i.status!=="done")continue;let o=[],s=new Set;for(let u of i.acceptance_criteria??[])for(let d of u.test_refs??[]){let f=Zqe(d);f&&!s.has(f)&&(s.add(f),o.push(f))}if(o.length===0)continue;let a=!0,c=!1;for(let u of o){let d=e.get(kte(r,u));if(d===void 0){a=!1;break}if(d>0){c=!0;break}}if(c||!a)continue;let l=i.title||i.id;n.push({detector:"VACUOUS_TESTS",severity:"warn",path:o[0],message:`Done feature "${l}" declares tests, but none of its test files executed a passing test (all skipped / todo / empty) \u2014 its behavioral proof never actually ran`})}return n}function Gj(t,e){try{let r=Gqe(Hqe(t,"utf8"));return r?Vqe(B(e),r,e):[]}catch{return[]}}var Br="stage_2.1";function Ete(t,e){return t==="vitest"||t.endsWith("/vitest")||e.includes("vitest")}function Ate(t,e){return[t,...e].some(r=>r==="pytest"||r.endsWith("/pytest"))}function Tte(t){let e=`${String(t.stdout??"")} +${String(t.stderr??"")}`,r=[],n=[/^\s*#\s*tests\s+(\d+)\s*$/gim,/^\s*ℹ\s+tests\s+(\d+)\s*$/gim,/^\s*Tests:\s+.*?\b(\d+)\s+total\b.*$/gim,/^\s*collected\s+(\d+)\s+items?\b.*$/gim];for(let i of n)for(let o of e.matchAll(i))r.push(Number(o[1]));return r.length>0&&r.every(i=>i===0)}function Xqe(t,e,r){let n,i;try{({cmd:n,args:i}=Yi("coverage",t))}catch{return null}if(!n||!i||!Ete(n,i))return null;let o=n,s=i,a=Dj(e,d=>We(o,[...s,"--reporter=default","--reporter=json",`--outputFile=${d}`],{cwd:e,reject:!1}));if(!a)return null;let{proc:c,jsonFile:l}=a;if(Nt(Br,n,c,s))return null;let u=Yt(Br,c);if(Nj(u)==="fallback")return null;if(r){let d=Gj(l,e);if(d.length>0)return{stage:Br,pass:!1,exitCode:1,findings:d,stderr:d[0].message}}return{stage:Br,pass:!0,exitCode:0}}function Qqe(t,e){let{strict:r=!1}=t,n,i;try{({cmd:n,args:i}=Yi("coverage",t))}catch{return null}if(!n||!i||!Ate(n,i))return null;let o=n,s=i,a=Dj(e,()=>We(o,[...s],{cwd:e,reject:!1}));if(!a||Nt(Br,o,a.proc,s))return null;let c=Yt(Br,a.proc);if(Nj(c)==="fallback")return null;if(r&&Tte(a.proc)){let l={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Br,pass:!1,exitCode:1,findings:[l],stderr:l.message}}return{stage:Br,pass:!0,exitCode:0}}function Vj(t={}){let{cwd:e=".",strict:r=!1}=t,n,i,o;try{({cmd:n,args:i,language:o}=Yi("test",t))}catch(d){return{stage:Br,pass:!1,exitCode:1,stderr:d.message}}if(!n||!i)return{stage:Br,pass:!1,exitCode:2,stderr:`no unit test runner registered for language '${o}'`};let s=Ete(n,i),a=Ate(n,i),c=r&&s;if(Cj()&&s){let d=Xqe(t,e,c);if(d)return d}if(Cj()&&a){let d=Qqe(t,e);if(d)return d}let l,u=i;c&&(l=Yqe(Jqe(),`clad-vitest-${Zj.pid}-${Wqe(6).toString("hex")}.json`),u=[...i,"--reporter=default","--reporter=json",`--outputFile=${l}`]);try{let d=We(n,[...u],{cwd:e,reject:!1}),f=Nt(Br,n,d,u);if(f)return f;let p=Ru("unit",Yt(Br,d),d);if(r&&p.pass&&Tte(d)){let m={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Br,pass:!1,exitCode:1,findings:[m],stderr:m.message}}if(c&&p.pass&&l){let m=Gj(l,e);if(m.length>0)return{stage:Br,pass:!1,exitCode:1,findings:m,stderr:m[0].message}}return p}finally{if(l)try{Kqe(l)}catch{}}}var e4e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Zj.argv[1]}`;if(e4e){let t=Vj();console.log(JSON.stringify(t)),Zj.exit(t.exitCode)}Mr();sn();Rn();import Ote from"node:process";var Wx="stage_3.3";function Wj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.visual,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Wx,pass:!1,exitCode:2,stderr:`no visual runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!ql(e,o[o.length-1]))return{stage:Wx,pass:!1,exitCode:2,stderr:"visual npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Wx,i,s,o);return a||Yt(Wx,s)}var t4e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Ote.argv[1]}`;if(t4e){let t=Wj();console.log(JSON.stringify(t)),Ote.exit(t.exitCode)}mC();jf();_a();Jj();kp();eS();var jte=St(er(),1);import{existsSync as Yj,readFileSync as f4e,readdirSync as Nte,statSync as p4e,writeFileSync as m4e}from"node:fs";import{basename as th,join as rh,relative as Dte}from"node:path";var h4e=["self-dogfood:","fixture:","derived:"],Mte=/\.(test|spec)\.[jt]sx?$/;function Fte(t,e=t,r=[]){let n;try{n=Nte(e)}catch{return r}for(let i of n){if(i.startsWith("."))continue;let o=rh(e,i);try{p4e(o).isDirectory()?Fte(t,o,r):Mte.test(i)&&r.push(o)}catch{continue}}return r}function Lte(t="."){let e=rh(t,"spec","features"),r=rh(t,"tests"),n=[],i=[];if(!Yj(e)||!Yj(r))return{repaired:n,suggested:i};let o=Fte(r),s=new Map;for(let a of o){let c=Dte(t,a).split("\\").join("/"),l=s.get(th(a))??[];l.push(c),s.set(th(a),l)}for(let a of Nte(e)){if(!a.endsWith(".yaml")&&!a.endsWith(".yml"))continue;let c=rh(e,a),l,u;try{l=f4e(c,"utf8"),u=(0,jte.parse)(l)}catch{continue}if(!u||u.status!=="done")continue;let d=!1;for(let h of u.acceptance_criteria??[])for(let g of h.test_refs??[]){if(h4e.some(x=>g.startsWith(x)))continue;let b=g.split("#",1)[0];if(Yj(rh(t,b)))continue;let _=s.get(th(b))??[];if(_.length!==1)continue;let S=g.replace(b,_[0]);S!==g&&l.includes(g)&&(l=l.split(g).join(S),n.push({shard:a,from:g,to:S}),d=!0)}let f=u.slug??"",p=(u.modules??[]).map(h=>th(h).replace(/\.[jt]sx?$/,"")),m=o.map(h=>Dte(t,h).split("\\").join("/")).find(h=>{let g=th(h).replace(Mte,"");return f!==""&&g===f||p.includes(g)});if(m)for(let h of u.acceptance_criteria??[]){if((h.test_refs?.length??0)>0||(h.evidence_refs?.length??0)>0||!h.id)continue;let g=new RegExp(`^(([ ]+)- id: ${h.id}\\b.*)$`,"m"),b=l.match(g);if(!b)continue;let _=b[2]+" ";l=l.replace(g,`$1 ${_}test_refs: -${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&Jqe(c,l,"utf8")}return{repaired:n,suggested:i}}gl();import{existsSync as Xqe,readFileSync as Qqe}from"node:fs";import{join as e4e}from"node:path";function t4e(t,e){let r=e4e(t,e);if(!Xqe(r))return[];let n=[];for(let i of Qqe(r,"utf8").split(/\r?\n/)){let o=i.trim();if(!/^export\s+(?:async\s+)?(?:abstract\s+)?(?:function|const|let|class|interface|type|enum)\b/.test(o))continue;let s=o.replace(/\s*[{=].*$/s,"").trim();s&&n.push(s)}return n}function Cte(t,e,r,n){let i=t.features.find(c=>c.id===e);if(!i)return null;let o=(i.acceptance_criteria??[]).filter(c=>!r||c.id===r),s=i.modules??[],a=s.flatMap(c=>t4e(n,c).map(l=>`${c}: ${l}`));return{featureId:e,featureTitle:i.title,acs:o.map(c=>({id:c.id,ears:c.ears,condition:c.condition,action:c.action,response:c.response,text:c.text})),modules:s,signatures:a,readManifest:[...s.map(c=>`signatures-of:${c}`),"spec:acceptance_criteria"]}}function Dte(t){let e=[];e.push(`# Impl-blind oracle brief \u2014 ${t.featureId}: ${t.featureTitle}`),e.push("#"),e.push("# Author a conformance TEST SUITE from THIS SPECIFICATION ONLY. You have NOT been"),e.push("# shown the implementation and MUST NOT read it. Assert ONLY what the acceptance"),e.push("# criteria literally require; when the spec is silent on an edge, write a WEAKER"),e.push("# assertion, not a stronger guess (an over-strict oracle falsely fails correct code)."),e.push(""),e.push("## Acceptance criteria (the spec)");for(let r of t.acs)e.push(`- ${r.id}${r.ears?` [${r.ears}]`:""}: ${r.text??""}`.trimEnd()),r.condition&&e.push(` when: ${r.condition}`),r.action&&e.push(` system shall: ${r.action}`),r.response&&e.push(` so that: ${r.response}`);e.push(""),e.push("## Public surface to call (signatures only \u2014 NO implementation shown)"),t.signatures.length===0&&e.push(" (no export signatures extracted \u2014 call the API exactly as the criteria describe)");for(let r of t.signatures)e.push(` ${r}`);return e.push(""),e.push("## Write the suite under tests/oracle/ (the dir stage_2.3 runs), then record it with"),e.push("## the clad_author_oracle MCP tool so its impl-blind provenance is gate-verified."),e.join(` -`)}rS();Be();Oi();ri();gl();var Vj=["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"],r4e=[...Vj,"att"];function n4e(t,e,r){if(e.startsWith("stage_4")){let n=Rn(r);if(n.length===0)return"\xB7";let i=(t.acceptance_criteria??[]).map(s=>s.id);return Mx(n).filter(s=>i.includes(s.acId)).length>0?"\u2717":"\u2713"}return"-"}function i4e(t,e,r){let n=t.modules??[];return t.status!=="done"||n.length===0?"\xB7":e===null?"-":q_(e,r,t).state==="fresh"?"\u2713":"!"}function Yx(t,e="."){let r=as(e),n=t.features.map(i=>({featureId:i.id,title:i.title||i.id,status:i.status,cells:[...Vj.map(o=>n4e(i,o,e)),i4e(i,r,e)]}));return{columns:r4e,rows:n}}function Nte(t,e=".",r={}){let n=r.internal??!1,i=Yx(t,e),o=[...Vj.map(c=>n?c.replace("stage_",""):o4e(c)),"att"],s=n?`feature ${o.join(" ")}`:`feature${" ".repeat(28)}${o.join(" ")}`,a=i.rows.map(c=>{let l=c.cells.join(" ");return n?`${c.featureId.padEnd(12)} ${l} ${c.title}`:`${c.title.padEnd(35).slice(0,35)} ${l}`});return[s,...a].join(` -`)}function o4e(t){return Ta(t).slice(0,3)}async function P8e(t){let[{buildServer:e},{StdioServerTransport:r},{setHostMcpServer:n}]=await Promise.all([Promise.resolve().then(()=>(Jue(),Kue)),Promise.resolve().then(()=>(tde(),ede)),Promise.resolve().then(()=>(Xp(),s7))]),i=e({cwd:t.cwd,onboarding:{renderDraft:s=>Lee(s),prepareInit:({cwd:s,mode:a,intent:c})=>Mee(s,a,c),initialize:dj,prepareClarify:(s,{cwd:a})=>Fee(a,s),clarify:hj,resolveReview:(s,{cwd:a})=>Cee(s,{cwd:a})}});n(i.server);let o=new r;V.stderr.write(`\xB7 serve stdio transport \xB7 cwd=${t.cwd??"."} -`),await i.connect(o)}async function C8e(t,e){let r=t&&t.length>0?t.join(" ").trim():void 0,n=await dj({projectName:e.name,force:e.force,scan:e.scan,noLlm:e.noLlm,roots:e.roots?e.roots.split(",").map(o=>o.trim()).filter(Boolean):void 0,intent:r,withHook:e.withHook,withCi:e.withCi});if(e.json){V.stdout.write(`${JSON.stringify(n,null,2)} -`),V.exit(0);return}for(let o of n.created)L("pass",`created ${o}`);for(let o of n.skipped)L("skip",o);for(let o of n.proposals??[])L("note","proposal",o);let i=n.onboardingMode?`language: ${n.language} \xB7 mode: ${n.onboardingMode}`:`language: ${n.language}`;if(L("note","init done",i),n.clarifyingQuestions&&n.clarifyingQuestions.length>0){V.stdout.write(` +${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&m4e(c,l,"utf8")}return{repaired:n,suggested:i}}bl();import{existsSync as g4e,readFileSync as y4e}from"node:fs";import{join as _4e}from"node:path";function b4e(t,e){let r=_4e(t,e);if(!g4e(r))return[];let n=[];for(let i of y4e(r,"utf8").split(/\r?\n/)){let o=i.trim();if(!/^export\s+(?:async\s+)?(?:abstract\s+)?(?:function|const|let|class|interface|type|enum)\b/.test(o))continue;let s=o.replace(/\s*[{=].*$/s,"").trim();s&&n.push(s)}return n}function zte(t,e,r,n){let i=t.features.find(c=>c.id===e);if(!i)return null;let o=(i.acceptance_criteria??[]).filter(c=>!r||c.id===r),s=i.modules??[],a=s.flatMap(c=>b4e(n,c).map(l=>`${c}: ${l}`));return{featureId:e,featureTitle:i.title,acs:o.map(c=>({id:c.id,ears:c.ears,condition:c.condition,action:c.action,response:c.response,text:c.text})),modules:s,signatures:a,readManifest:[...s.map(c=>`signatures-of:${c}`),"spec:acceptance_criteria"]}}function Ute(t){let e=[];e.push(`# Impl-blind oracle brief \u2014 ${t.featureId}: ${t.featureTitle}`),e.push("#"),e.push("# Author a conformance TEST SUITE from THIS SPECIFICATION ONLY. You have NOT been"),e.push("# shown the implementation and MUST NOT read it. Assert ONLY what the acceptance"),e.push("# criteria literally require; when the spec is silent on an edge, write a WEAKER"),e.push("# assertion, not a stronger guess (an over-strict oracle falsely fails correct code)."),e.push(""),e.push("## Acceptance criteria (the spec)");for(let r of t.acs)e.push(`- ${r.id}${r.ears?` [${r.ears}]`:""}: ${r.text??""}`.trimEnd()),r.condition&&e.push(` when: ${r.condition}`),r.action&&e.push(` system shall: ${r.action}`),r.response&&e.push(` so that: ${r.response}`);e.push(""),e.push("## Public surface to call (signatures only \u2014 NO implementation shown)"),t.signatures.length===0&&e.push(" (no export signatures extracted \u2014 call the API exactly as the criteria describe)");for(let r of t.signatures)e.push(` ${r}`);return e.push(""),e.push("## Write the suite under tests/oracle/ (the dir stage_2.3 runs), then record it with"),e.push("## the clad_author_oracle MCP tool so its impl-blind provenance is gate-verified."),e.join(` +`)}nS();Ue();Ii();ni();bl();var Xj=["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"],v4e=[...Xj,"att"];function S4e(t,e,r){if(e.startsWith("stage_4")){let n=In(r);if(n.length===0)return"\xB7";let i=(t.acceptance_criteria??[]).map(s=>s.id);return Lx(n).filter(s=>i.includes(s.acId)).length>0?"\u2717":"\u2713"}return"-"}function w4e(t,e,r){let n=t.modules??[];return t.status!=="done"||n.length===0?"\xB7":e===null?"-":B_(e,r,t).state==="fresh"?"\u2713":"!"}function Xx(t,e="."){let r=as(e),n=t.features.map(i=>({featureId:i.id,title:i.title||i.id,status:i.status,cells:[...Xj.map(o=>S4e(i,o,e)),w4e(i,r,e)]}));return{columns:v4e,rows:n}}function qte(t,e=".",r={}){let n=r.internal??!1,i=Xx(t,e),o=[...Xj.map(c=>n?c.replace("stage_",""):x4e(c)),"att"],s=n?`feature ${o.join(" ")}`:`feature${" ".repeat(28)}${o.join(" ")}`,a=i.rows.map(c=>{let l=c.cells.join(" ");return n?`${c.featureId.padEnd(12)} ${l} ${c.title}`:`${c.title.padEnd(35).slice(0,35)} ${l}`});return[s,...a].join(` +`)}function x4e(t){return Ta(t).slice(0,3)}async function J8e(t){let[{buildServer:e},{StdioServerTransport:r},{setHostMcpServer:n}]=await Promise.all([Promise.resolve().then(()=>(nde(),rde)),Promise.resolve().then(()=>(cde(),ade)),Promise.resolve().then(()=>(Xp(),_7))]),i=e({cwd:t.cwd,onboarding:{renderDraft:s=>Vee(s),prepareInit:({cwd:s,mode:a,intent:c})=>Gee(s,a,c),initialize:pj,prepareClarify:(s,{cwd:a})=>Zee(a,s),clarify:yj,resolveReview:(s,{cwd:a})=>Uee(s,{cwd:a})}});n(i.server);let o=new r;G.stderr.write(`\xB7 serve stdio transport \xB7 cwd=${t.cwd??"."} +`),await i.connect(o)}async function Y8e(t,e){let r=t&&t.length>0?t.join(" ").trim():void 0,n=await pj({projectName:e.name,force:e.force,scan:e.scan,noLlm:e.noLlm,roots:e.roots?e.roots.split(",").map(o=>o.trim()).filter(Boolean):void 0,intent:r,withHook:e.withHook,withCi:e.withCi});if(e.json){G.stdout.write(`${JSON.stringify(n,null,2)} +`),G.exit(0);return}for(let o of n.created)L("pass",`created ${o}`);for(let o of n.skipped)L("skip",o);for(let o of n.proposals??[])L("note","proposal",o);let i=n.onboardingMode?`language: ${n.language} \xB7 mode: ${n.onboardingMode}`:`language: ${n.language}`;if(L("note","init done",i),n.clarifyingQuestions&&n.clarifyingQuestions.length>0){G.stdout.write(` \u{1F4A1} A few more details would sharpen the spec: -`);for(let[o,s]of n.clarifyingQuestions.entries())V.stdout.write(` ${o+1}. ${s} -`);V.stdout.write(` -`)}else r||n.created.some(s=>s==="docs/conventions.md")&&(V.stdout.write(` +`);for(let[o,s]of n.clarifyingQuestions.entries())G.stdout.write(` ${o+1}. ${s} +`);G.stdout.write(` +`)}else r||n.created.some(s=>s==="docs/conventions.md")&&(G.stdout.write(` \u{1F4A1} Tip: for a more precise scaffold, describe the project: -`),V.stdout.write(` clad init -`),V.stdout.write(` e.g. clad init payment SaaS for B2B -`),V.stdout.write(` The existing seeds divert to .cladding/scan/*.proposal. - -`));V.exit(0)}async function D8e(t,e){L("note","run","EXPERIMENTAL \u2014 prefer the host-delegated path (clad serve + your AI host). See docs/feature-cycle.md \xA7 Execution surface.");let{runDriveLoop:r}=await Promise.resolve().then(()=>(Ede(),kde)),n=await r({cwd:e.cwd,goal:t,budget:{maxIterations:Number(e.maxIterations),maxWallClockMs:Number(e.maxWallClockMs),maxRetriesPerFeature:Number(e.maxRetries)}}),i=n.halt.class==="ALL_FEATURES_DONE"?"pass":"note";if(e.json)L(i,"run",`halt=${n.halt.class} iter=${n.iterations} features=${n.featuresTouched.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`),V.stdout.write(`${JSON.stringify(n,null,2)} -`);else{let s=H(e.cwd??"."),a=n.featuresTouched.map(l=>nR(l,s)),c=`${aG(n.halt,s)} iter=${n.iterations} features=${a.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`;L(i,"run",c),a.length>0&&V.stdout.write(`Touched: ${a.join(", ")} -`)}let o=n.stubsCreated.length>0;o&&L("fail","run",`produced ${n.stubsCreated.length} empty auto-stub(s) and implemented nothing \u2014 the headless code-author needs a real LLM transport (set ANTHROPIC_API_KEY) or use the host-delegated path (clad serve + your AI host). This run did NOT do the work.`),V.exit(n.halt.class==="ALL_FEATURES_DONE"&&!o?0:1)}function N8e(t={}){try{let e=H();if(ya("."))L("note","sync","derived-file writes deferred \u2014 git operation in progress; re-run after the merge/rebase completes.");else{let r=_s(".");Bl(".",r),Wa("."),R5(".");let n=eu(".");n==="created"?L("note","agents.md","wrote a spec-driven AGENTS.md so non-Claude agents share the same guidance."):n==="updated"&&L("note","agents.md","refreshed the AGENTS.md managed block from the current spec.");let i=Pte(".");for(let s of i.repaired)L("note","test_refs",`repaired ${s.from} \u2192 ${s.to} (${s.shard})`);for(let s of i.suggested)L("note","test_refs",`suggested ${s.ref} (${s.shard}) \u2014 confirm by removing the 'derived:' prefix`);let o=Jx(".");o&&L("note","deliverable",`auto-detected entry '${o.path}' \u2014 the gate now smoke-tests it (stage_2.4). Opt out with is_safe_to_smoke: false.`)}if(t.proposeArchive){let n=nS.run({cwd:"."}).filter(i=>i.suggestion?.action==="propose-archive");if(n.length===0){L("pass","sync",`${e.features.length} features \xB7 0 archive candidates`),V.exit(0);return}for(let i of n){let o=i.suggestion?.args??{},s=String(o.featureId??"?"),a=String(o.reason??i.message);L("note",`propose-archive \xB7 ${s}`,a)}L("pass","sync",`${e.features.length} features \xB7 ${n.length} archive candidate(s)`),V.exit(0);return}L("pass","sync",`${e.features.length} features valid`),V.exit(0)}catch(e){L("fail","sync",e.message),V.exit(1)}}function j8e(t){if(!t){L("fail","checkpoint","feature id required (e.g. clad checkpoint F-001)"),V.exit(2);return}let e=k_(".",t),r=e.gitHead?e.gitHead.slice(0,12):"(no git)";L("pass",`checkpoint \xB7 ${t}`,`head=${r} digest=${e.specDigest.slice(0,12)}`),V.exit(0)}function M8e(t,e={}){if(!t){L("fail","rollback","feature id required (e.g. clad rollback F-001)"),V.exit(2);return}let r=E_(".",t);if(!r){L("fail",`rollback \xB7 ${t}`,"no prior checkpoint recorded"),V.exit(1);return}A_(".",t,r,e.reason);let n=r.gitHead?r.gitHead.slice(0,12):"(no git)";L("note",`rollback \xB7 ${t}`,`recorded \u2014 run the printed command to apply (cladding does not execute git) \xB7 target head=${n} ts=${r.timestamp}`),r.gitHead?V.stdout.write(`Run: git checkout ${r.gitHead} -`):V.stdout.write(`No git head pinned \u2014 restore spec.yaml manually from VCS history. -`),V.exit(0)}async function F8e(t){let e=t.host?t.host==="all"?["claude","codex","gemini","antigravity","cursor"].slice():[t.host]:void 0,r=await ZC({force:t.force,quiet:t.quiet,projectRoot:t.project,hosts:e});V.exit(r.errors.length>0?1:0)}async function L8e(){L("note","update","reconciling the current project after the engine upgrade");let t=await EX(".",{wireHosts:async()=>(await ZC({quiet:!0,projectRoot:"."})).errors.length});if(!t.isProject){L("skip","update","no spec.yaml here \u2014 nothing re-wired. Run `clad update` inside a cladding project, or `clad init` to start one."),V.exit(t.code);return}L(t.wiringErrors>0?"fail":"pass","hosts",t.wiringErrors>0?`${t.wiringErrors} wiring error(s)`:"re-wired"),t.inventoryDeferred?L("note","spec",`inventory + index writes deferred \u2014 git operation in progress; re-run \`clad update\` after it completes (${t.features} features seen).`):L("pass","spec",`inventory synced \xB7 ${t.features} features`),L(t.claudeMd==="refreshed-stale"?"note":"pass","CLAUDE.md",t.claudeMd),L(t.agentsMd==="refreshed-stale"?"note":"pass","AGENTS.md",t.agentsMd);for(let r of t.deprecations)L("note","deprecated",r);V.stdout.write(` +`),G.stdout.write(` clad init +`),G.stdout.write(` e.g. clad init payment SaaS for B2B +`),G.stdout.write(` The existing seeds divert to .cladding/scan/*.proposal. + +`));G.exit(0)}async function X8e(t,e){L("note","run","EXPERIMENTAL \u2014 prefer the host-delegated path (clad serve + your AI host). See docs/feature-cycle.md \xA7 Execution surface.");let{runDriveLoop:r}=await Promise.resolve().then(()=>(Cde(),Pde)),n=await r({cwd:e.cwd,goal:t,budget:{maxIterations:Number(e.maxIterations),maxWallClockMs:Number(e.maxWallClockMs),maxRetriesPerFeature:Number(e.maxRetries)}}),i=n.halt.class==="ALL_FEATURES_DONE"?"pass":"note";if(e.json)L(i,"run",`halt=${n.halt.class} iter=${n.iterations} features=${n.featuresTouched.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`),G.stdout.write(`${JSON.stringify(n,null,2)} +`);else{let s=B(e.cwd??"."),a=n.featuresTouched.map(l=>iR(l,s)),c=`${fG(n.halt,s)} iter=${n.iterations} features=${a.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`;L(i,"run",c),a.length>0&&G.stdout.write(`Touched: ${a.join(", ")} +`)}let o=n.stubsCreated.length>0;o&&L("fail","run",`produced ${n.stubsCreated.length} empty auto-stub(s) and implemented nothing \u2014 the headless code-author needs a real LLM transport (set ANTHROPIC_API_KEY) or use the host-delegated path (clad serve + your AI host). This run did NOT do the work.`),G.exit(n.halt.class==="ALL_FEATURES_DONE"&&!o?0:1)}function Q8e(t={}){try{let e=B();if(ya("."))L("note","sync","derived-file writes deferred \u2014 git operation in progress; re-run after the merge/rebase completes.");else{let r=_s(".");Zl(".",r),Wa("."),N5(".");let n=eu(".");n==="created"?L("note","agents.md","wrote a spec-driven AGENTS.md so non-Claude agents share the same guidance."):n==="updated"&&L("note","agents.md","refreshed the AGENTS.md managed block from the current spec.");let i=Lte(".");for(let s of i.repaired)L("note","test_refs",`repaired ${s.from} \u2192 ${s.to} (${s.shard})`);for(let s of i.suggested)L("note","test_refs",`suggested ${s.ref} (${s.shard}) \u2014 confirm by removing the 'derived:' prefix`);let o=Yx(".");o&&L("note","deliverable",`auto-detected entry '${o.path}' \u2014 the gate now smoke-tests it (stage_2.4). Opt out with is_safe_to_smoke: false.`)}if(t.proposeArchive){let n=iS.run({cwd:"."}).filter(i=>i.suggestion?.action==="propose-archive");if(n.length===0){L("pass","sync",`${e.features.length} features \xB7 0 archive candidates`),G.exit(0);return}for(let i of n){let o=i.suggestion?.args??{},s=String(o.featureId??"?"),a=String(o.reason??i.message);L("note",`propose-archive \xB7 ${s}`,a)}L("pass","sync",`${e.features.length} features \xB7 ${n.length} archive candidate(s)`),G.exit(0);return}L("pass","sync",`${e.features.length} features valid`),G.exit(0)}catch(e){L("fail","sync",e.message),G.exit(1)}}function e5e(t){if(!t){L("fail","checkpoint","feature id required (e.g. clad checkpoint F-001)"),G.exit(2);return}let e=E_(".",t),r=e.gitHead?e.gitHead.slice(0,12):"(no git)";L("pass",`checkpoint \xB7 ${t}`,`head=${r} digest=${e.specDigest.slice(0,12)}`),G.exit(0)}function t5e(t,e={}){if(!t){L("fail","rollback","feature id required (e.g. clad rollback F-001)"),G.exit(2);return}let r=A_(".",t);if(!r){L("fail",`rollback \xB7 ${t}`,"no prior checkpoint recorded"),G.exit(1);return}T_(".",t,r,e.reason);let n=r.gitHead?r.gitHead.slice(0,12):"(no git)";L("note",`rollback \xB7 ${t}`,`recorded \u2014 run the printed command to apply (cladding does not execute git) \xB7 target head=${n} ts=${r.timestamp}`),r.gitHead?G.stdout.write(`Run: git checkout ${r.gitHead} +`):G.stdout.write(`No git head pinned \u2014 restore spec.yaml manually from VCS history. +`),G.exit(0)}async function r5e(t){let e=t.host?t.host==="all"?["claude","codex","gemini","antigravity","cursor"].slice():[t.host]:void 0,r=await VC({force:t.force,quiet:t.quiet,projectRoot:t.project,hosts:e});G.exit(r.errors.length>0?1:0)}async function n5e(){L("note","update","reconciling the current project after the engine upgrade");let t=await FX(".",{wireHosts:async()=>(await VC({quiet:!0,projectRoot:"."})).errors.length});if(!t.isProject){L("skip","update","no spec.yaml here \u2014 nothing re-wired. Run `clad update` inside a cladding project, or `clad init` to start one."),G.exit(t.code);return}L(t.wiringErrors>0?"fail":"pass","hosts",t.wiringErrors>0?`${t.wiringErrors} wiring error(s)`:"re-wired"),t.inventoryDeferred?L("note","spec",`inventory + index writes deferred \u2014 git operation in progress; re-run \`clad update\` after it completes (${t.features} features seen).`):L("pass","spec",`inventory synced \xB7 ${t.features} features`),L(t.claudeMd==="refreshed-stale"?"note":"pass","CLAUDE.md",t.claudeMd),L(t.agentsMd==="refreshed-stale"?"note":"pass","AGENTS.md",t.agentsMd);for(let r of t.deprecations)L("note","deprecated",r);G.stdout.write(` \u2192 drift check (report-only \xB7 does not block, does not edit your spec): -`),xA({tier:"pre-commit",strict:!0}).anyFailed?V.stdout.write("\n\u2139 The findings above are the bar this upgrade raised \u2014 not a failed update. Reconcile them in YOUR spec when ready (`clad check --strict` for the full gate).\n"):L("pass","drift","clean against the stricter detectors"),V.exit(t.code)}var z8e={"pre-commit":["stage_1.3","stage_1.5","stage_1.6"],"pre-push":["stage_1.1","stage_1.2","stage_1.3","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4"],all:["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"]};function xA(t){let e=t.tier??"all",r=t.silent===!0,n=z8e[e];if(!n)return t.json&&!r?V.stdout.write(`${JSON.stringify({tier:e,error:`unknown tier '${e}'`,worst:2,anyFailed:!0,stages:[]},null,2)} -`):r||L("fail","check",`unknown --tier '${e}' (expected: pre-commit | pre-push | all)`),{worst:2,anyFailed:!0,stages:[]};let i={focusModules:t.focusModules},s=[["stage_1.1",()=>Xm(i)],["stage_1.2",()=>Ym(i)],["stage_1.3",()=>ii({...i,strict:t.strict})],["stage_1.4",Ij],["stage_1.5",rc],["stage_1.6",Gp],["stage_2.1",()=>qj({...i,strict:t.strict})],["stage_2.2",()=>Pj(i)],["stage_2.3",uC],["stage_2.4",jj],["stage_3.1",Mj],["stage_3.2",Dj],["stage_3.3",Bj],["stage_4.1",Oj],["stage_4.2",Qm]].filter(([d])=>n.includes(d)),a=0,c=!1,l=d=>d==="pass"?"pass":d==="liveness"?"note":d==="na"?"skip":si(d)?"fail":"skip",u=[];B_("."),ite(".");try{for(let[d,f]of s){let p=f({}),m=t.internal?d:Ta(d),h=pX(p);si(h)&&(c=!0,a=Math.max(a,mX(p,h))),u.push({stage:d,label:m,status:h,exitCode:p.exitCode,stderr:p.stderr,findings:p.findings}),!t.json&&!r&&(L(l(h),m),si(h)&&W8e(p))}}finally{G_(),lte()}if(t.strict)try{let d=H();for(let f of rte(d,u))a=Math.max(a,1),c=!0,u.push({stage:f.stage,label:f.label,status:"fail",exitCode:1,stderr:f.message}),!t.json&&!r&&L("fail",f.label,f.message)}catch{}if(t.strict&&(e==="pre-push"||e==="all")){let d=u.find(h=>h.stage==="stage_1.3"),f=(d?.findings??[]).filter(h=>h.severity==="error"||h.severity==="warn"),p=d?.status==="fail"&&f.length>0&&f.every(h=>h.detector==="STALE_ATTESTATION"),m=u.every(h=>h.stage==="stage_1.3"||!si(h.status));if(p&&m&&d&&(d.status="pass",d.exitCode=0,d.stderr="stale attestation exempted \u2014 this run re-verified and re-attests",c=u.some(h=>si(h.status)),a=c?Math.max(1,a):0,!t.json&&!r&&L("note","attestation","stale entries re-verified by this run \u2014 re-attesting")),!c&&!r)if(ya("."))t.json||L("note","attestation","deferred \u2014 git operation in progress; run the gate again after the merge/rebase completes.");else try{AG(".",H())&&(t.json||L("note","attestation","spec/attestation.yaml refreshed (verified tree stamped)"))}catch{}}return t.json&&!r?V.stdout.write(`${JSON.stringify({tier:e,worst:a,anyFailed:c,stages:u},null,2)} -`):c&&!r&&V.stdout.write("\n\u2139 Run `clad doctor` for the event log, or `clad sync` to validate spec shards. Drift findings above name the offending detector.\n"),er(".","gate_run",{tier:e,strict:t.strict===!0,worst:a,anyFailed:c}),{worst:a,anyFailed:c,stages:u}}function U8e(t){try{let e=H(),r=ll(e,t);V.stdout.write(`${JSON.stringify(r,null,2)} -`),V.exit("not_found"in r?1:0)}catch(e){L("fail","context",e.message),V.exit(1)}}function q8e(t,e={}){try{let r=H(),n=e.depth!==void 0?Number(e.depth):void 0,i=br(r,t,{depth:n});V.stdout.write(`${JSON.stringify(i,null,2)} -`),V.exit("not_found"in i?1:0)}catch(r){L("fail","impact",r.message),V.exit(1)}}function B8e(t={}){try{let e=H(),r=t.ambiguity!==void 0?Number(t.ambiguity):void 0,i=lS(e,o=>{try{return Tde(o,"utf8")}catch{return null}},r!==void 0?{maxOwnerAmbiguity:r}:{});V.stdout.write(`${JSON.stringify({suggestions:i.suggestions,new_edges:i.edges.length,already_declared:i.alreadyDeclared.length,dynamic_import_files:i.dynamicImportFiles},null,2)} -`),V.exit(0)}catch(e){L("fail","infer-deps",e.message),V.exit(1)}}function H8e(t={}){try{if(t.sessions){qee(t);return}if(t.trend!==void 0&&t.trend!==!1){Bee(t);return}let e=H(),n=EH(e,o=>{try{return Tde(o,"utf8")}catch{return null}},"."),i=TH(".",n);if(t.json)V.stdout.write(`${JSON.stringify(n,null,2)} -`);else{let o=n.context,s=o.truncatedCount>0?`budget enforces ${o.medianShrinkTruncated}x on ${o.truncatedCount} capped feature(s) (cap-driven)`:"no feature hit the budget cap",a=o.fitsCount>0?`${o.medianShrinkFit}x on ${o.fitsCount} fitting`:"none fit untruncated",c=[`graph efficiency \xB7 ${n.measured}/${n.featureCount} features`,` context: working-set ${o.medianSliceTokens} tok vs naive ${o.medianNaiveTokens} tok \u2014 ${s}, ${a}`,` uncapped structural slice = ${o.medianStructuralRatio}x of naive \u2014 the value is the guaranteed budget + wired needs/breaks/verify, not raw shrink`,` search: median ${n.search.medianDepth} hop(s) resolved (p95 ${n.search.p95Depth}), median ${n.search.medianEdges} edge(s)/feature (max hub ${n.search.maxEdges})`,` stability: median blast-radius coverage ${n.stability.medianCoverage}, median ${n.stability.medianRegressionTests} regression test(s) surfaced; stops ${JSON.stringify(n.stability.byStopReason)}`,` ${ul}`];V.stdout.write(`${c.join(` +`),$A({tier:"pre-commit",strict:!0}).anyFailed?G.stdout.write("\n\u2139 The findings above are the bar this upgrade raised \u2014 not a failed update. Reconcile them in YOUR spec when ready (`clad check --strict` for the full gate).\n"):L("pass","drift","clean against the stricter detectors"),G.exit(t.code)}var i5e={"pre-commit":["stage_1.3","stage_1.5","stage_1.6"],"pre-push":["stage_1.1","stage_1.2","stage_1.3","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4"],all:["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"]};function $A(t){let e=t.tier??"all",r=t.silent===!0,n=i5e[e];if(!n)return t.json&&!r?G.stdout.write(`${JSON.stringify({tier:e,error:`unknown tier '${e}'`,worst:2,anyFailed:!0,stages:[]},null,2)} +`):r||L("fail","check",`unknown --tier '${e}' (expected: pre-commit | pre-push | all)`),{worst:2,anyFailed:!0,stages:[]};let i={focusModules:t.focusModules},s=[["stage_1.1",()=>Qm(i)],["stage_1.2",()=>Xm(i)],["stage_1.3",()=>oi({...i,strict:t.strict})],["stage_1.4",jj],["stage_1.5",rc],["stage_1.6",Gp],["stage_2.1",()=>Vj({...i,strict:t.strict})],["stage_2.2",()=>Mj(i)],["stage_2.3",dC],["stage_2.4",Uj],["stage_3.1",qj],["stage_3.2",Lj],["stage_3.3",Wj],["stage_4.1",Ij],["stage_4.2",eh]].filter(([d])=>n.includes(d)),a=0,c=!1,l=d=>d==="pass"?"pass":d==="liveness"?"note":d==="na"?"skip":ci(d)?"fail":"skip",u=[];H_("."),fte(".");try{for(let[d,f]of s){let p=f({}),m=t.internal?d:Ta(d),h=kX(p);ci(h)&&(c=!0,a=Math.max(a,EX(p,h))),u.push({stage:d,label:m,status:h,exitCode:p.exitCode,stderr:p.stderr,findings:p.findings}),!t.json&&!r&&(L(l(h),m),ci(h)&&f5e(p))}}finally{Z_(),mte()}if(t.strict)try{let d=B();for(let f of ute(d,u))a=Math.max(a,1),c=!0,u.push({stage:f.stage,label:f.label,status:"fail",exitCode:1,stderr:f.message}),!t.json&&!r&&L("fail",f.label,f.message)}catch{}if(t.strict&&(e==="pre-push"||e==="all")){let d=u.find(h=>h.stage==="stage_1.3"),f=(d?.findings??[]).filter(h=>h.severity==="error"||h.severity==="warn"),p=d?.status==="fail"&&f.length>0&&f.every(h=>h.detector==="STALE_ATTESTATION"),m=u.every(h=>h.stage==="stage_1.3"||!ci(h.status));if(p&&m&&d&&(d.status="pass",d.exitCode=0,d.stderr="stale attestation exempted \u2014 this run re-verified and re-attests",c=u.some(h=>ci(h.status)),a=c?Math.max(1,a):0,!t.json&&!r&&L("note","attestation","stale entries re-verified by this run \u2014 re-attesting")),!c&&!r)if(ya("."))t.json||L("note","attestation","deferred \u2014 git operation in progress; run the gate again after the merge/rebase completes.");else try{PG(".",B())&&(t.json||L("note","attestation","spec/attestation.yaml refreshed (verified tree stamped)"))}catch{}}return t.json&&!r?G.stdout.write(`${JSON.stringify({tier:e,worst:a,anyFailed:c,stages:u},null,2)} +`):c&&!r&&G.stdout.write("\n\u2139 Run `clad doctor` for the event log, or `clad sync` to validate spec shards. Drift findings above name the offending detector.\n"),tr(".","gate_run",{tier:e,strict:t.strict===!0,worst:a,anyFailed:c}),{worst:a,anyFailed:c,stages:u}}function o5e(t){try{let e=B(),r=fl(e,t);G.stdout.write(`${JSON.stringify(r,null,2)} +`),G.exit("not_found"in r?1:0)}catch(e){L("fail","context",e.message),G.exit(1)}}function s5e(t,e={}){try{let r=B(),n=e.depth!==void 0?Number(e.depth):void 0,i=vr(r,t,{depth:n});G.stdout.write(`${JSON.stringify(i,null,2)} +`),G.exit("not_found"in i?1:0)}catch(r){L("fail","impact",r.message),G.exit(1)}}function a5e(t={}){try{let e=B(),r=t.ambiguity!==void 0?Number(t.ambiguity):void 0,i=uS(e,o=>{try{return Nde(o,"utf8")}catch{return null}},r!==void 0?{maxOwnerAmbiguity:r}:{});G.stdout.write(`${JSON.stringify({suggestions:i.suggestions,new_edges:i.edges.length,already_declared:i.alreadyDeclared.length,dynamic_import_files:i.dynamicImportFiles},null,2)} +`),G.exit(0)}catch(e){L("fail","infer-deps",e.message),G.exit(1)}}function c5e(t={}){try{if(t.sessions){Jee(t);return}if(t.trend!==void 0&&t.trend!==!1){Yee(t);return}let e=B(),n=IH(e,o=>{try{return Nde(o,"utf8")}catch{return null}},"."),i=CH(".",n);if(t.json)G.stdout.write(`${JSON.stringify(n,null,2)} +`);else{let o=n.context,s=o.truncatedCount>0?`budget enforces ${o.medianShrinkTruncated}x on ${o.truncatedCount} capped feature(s) (cap-driven)`:"no feature hit the budget cap",a=o.fitsCount>0?`${o.medianShrinkFit}x on ${o.fitsCount} fitting`:"none fit untruncated",c=[`graph efficiency \xB7 ${n.measured}/${n.featureCount} features`,` context: working-set ${o.medianSliceTokens} tok vs naive ${o.medianNaiveTokens} tok \u2014 ${s}, ${a}`,` uncapped structural slice = ${o.medianStructuralRatio}x of naive \u2014 the value is the guaranteed budget + wired needs/breaks/verify, not raw shrink`,` search: median ${n.search.medianDepth} hop(s) resolved (p95 ${n.search.p95Depth}), median ${n.search.medianEdges} edge(s)/feature (max hub ${n.search.maxEdges})`,` stability: median blast-radius coverage ${n.stability.medianCoverage}, median ${n.stability.medianRegressionTests} regression test(s) surfaced; stops ${JSON.stringify(n.stability.byStopReason)}`,` ${pl}`];G.stdout.write(`${c.join(` `)} -`),i.appended?L("note","measure","snapshot recorded to .cladding/measure.jsonl \u2014 see `clad measure --trend`"):i.reason==="deduped"?L("note","measure","commit+spec state unchanged since last snapshot \u2014 not recorded"):i.reason==="no_head"&&L("note","measure","no git HEAD \u2014 snapshot not recorded (commit first; a head-less line has no reproduce target)")}V.exit(0)}catch(e){L("fail","measure",e.message),V.exit(1)}}function G8e(t){let e;if(t.feature)try{let n=(H().features??[]).find(i=>i.id===t.feature||i.slug===t.feature);n||(L("fail","check",`no feature '${t.feature}' in spec \u2014 cannot scope gate`),V.exit(1)),e=n.modules}catch(r){L("fail","check",r.message),V.exit(1)}V.exitCode=xA({...t,focusModules:e}).worst}function Z8e(t){let e=WY(".",t,{checkStages:xA,onIndex:Wa,gitOpInProgress:xO});L(e.ok?"pass":"fail",`done \xB7 ${t}`,e.reason),V.exit(e.code)}function V8e(t,e={}){let r=e.cwd??".",n;try{n=H(r)}catch(o){L("fail","oracle",`spec not loaded: ${o.message}`),V.exit(1);return}if(e.required){t&&V.stdout.write(`(note: --required lists the whole-project worklist; ignoring '${t}') -`);let o=N5(n);if(o.length===0){V.stdout.write(`No oracles required \u2014 set project.oracle_policy or require_oracles, or no done ACs match the policy. -`),V.exit(0);return}let s=o.filter(a=>!a.hasOracle);for(let a of o){let c=a.hasOracle?"\u2713":"\xB7",l=a.hasOracle?"":" \u2190 needs an impl-blind oracle";V.stdout.write(` ${c} ${a.featureId}.${a.acId} [${a.reason}${a.ears?`:${a.ears}`:""}]${l} -`)}V.stdout.write(` +`),i.appended?L("note","measure","snapshot recorded to .cladding/measure.jsonl \u2014 see `clad measure --trend`"):i.reason==="deduped"?L("note","measure","commit+spec state unchanged since last snapshot \u2014 not recorded"):i.reason==="no_head"&&L("note","measure","no git HEAD \u2014 snapshot not recorded (commit first; a head-less line has no reproduce target)")}G.exit(0)}catch(e){L("fail","measure",e.message),G.exit(1)}}function l5e(t){let e;if(t.feature)try{let i=(B().features??[]).find(o=>o.id===t.feature||o.slug===t.feature);i||(L("fail","check",`no feature '${t.feature}' in spec \u2014 cannot scope gate`),G.exit(1)),e=i.modules}catch(n){L("fail","check",n.message),G.exit(1)}let r=$A({...t,focusModules:e});if(!t.json){let n=oX(".");n&&G.stdout.write(`\u2139 ${n} +`)}G.exitCode=r.worst}function u5e(t){let e=QY(".",t,{checkStages:$A,onIndex:Wa,gitOpInProgress:$O});L(e.ok?"pass":"fail",`done \xB7 ${t}`,e.reason),G.exit(e.code)}function d5e(t,e={}){let r=e.cwd??".",n;try{n=B(r)}catch(o){L("fail","oracle",`spec not loaded: ${o.message}`),G.exit(1);return}if(e.required){t&&G.stdout.write(`(note: --required lists the whole-project worklist; ignoring '${t}') +`);let o=z5(n);if(o.length===0){G.stdout.write(`No oracles required \u2014 set project.oracle_policy or require_oracles, or no done ACs match the policy. +`),G.exit(0);return}let s=o.filter(a=>!a.hasOracle);for(let a of o){let c=a.hasOracle?"\u2713":"\xB7",l=a.hasOracle?"":" \u2190 needs an impl-blind oracle";G.stdout.write(` ${c} ${a.featureId}.${a.acId} [${a.reason}${a.ears?`:${a.ears}`:""}]${l} +`)}G.stdout.write(` ${o.length} AC(s) required, ${s.length} missing an oracle. -`),V.exit(s.length>0?1:0);return}if(!t){L("fail","oracle","provide a to print its blind brief, or --required to list the ACs the policy needs an oracle for"),V.exit(1);return}let i=Cte(n,t,e.ac,r);if(!i||i.acs.length===0){L("fail","oracle",`no acceptance criteria for ${t}${e.ac?`.${e.ac}`:""} \u2014 nothing to author a blind oracle from`),V.exit(1);return}V.stdout.write(`${Dte(i)} -`),V.exit(0)}function W8e(t){if(t.findings&&t.findings.length>0){let e=t.findings.filter(i=>i.severity==="error"),r=t.findings.filter(i=>i.severity==="warn"),n=e.length>0?e:r;for(let i of n.slice(0,3)){let o=Ade(Uf(i.detector,i.message),140),s=i.path?` \u2014 ${i.path}`:"";V.stdout.write(` ${o}${s} [${i.detector}] -`)}n.length>3&&V.stdout.write(` \u2026 and ${n.length-3} more finding(s) +`),G.exit(s.length>0?1:0);return}if(!t){L("fail","oracle","provide a to print its blind brief, or --required to list the ACs the policy needs an oracle for"),G.exit(1);return}let i=zte(n,t,e.ac,r);if(!i||i.acs.length===0){L("fail","oracle",`no acceptance criteria for ${t}${e.ac?`.${e.ac}`:""} \u2014 nothing to author a blind oracle from`),G.exit(1);return}G.stdout.write(`${Ute(i)} +`),G.exit(0)}function f5e(t){if(t.findings&&t.findings.length>0){let e=t.findings.filter(i=>i.severity==="error"),r=t.findings.filter(i=>i.severity==="warn"),n=e.length>0?e:r;for(let i of n.slice(0,3)){let o=Dde(Uf(i.detector,i.message),140),s=i.path?` \u2014 ${i.path}`:"";G.stdout.write(` ${o}${s} [${i.detector}] +`)}n.length>3&&G.stdout.write(` \u2026 and ${n.length-3} more finding(s) +`),t.hint&&G.stdout.write(` fix: run \`${t.hint}\` `);return}if(t.stderr&&t.stderr.trim().length>0){let e=t.stderr.split(` -`).find(r=>r.trim().length>0);e&&V.stdout.write(` ${Ade(e.trim(),160)} -`)}}function Ade(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function K8e(t){let e=H();if(t.json){V.stdout.write(`${JSON.stringify(Yx(e,"."),null,2)} -`),V.exitCode=0;return}V.stdout.write(`${Nte(e,".",{internal:t.internal})} -`),V.exit(0)}function J8e(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function Y8e(t){let e=t.cwd??".",r=(t.out??"").trim();if(r.length===0){L("fail","bundle","missing --out \u2014 the bundle needs a destination path"),V.exit(1);return}let n;try{let i=H(e),o=Yx(i,e),s={gitHead:va(e),version:Wl(),generatedAt:t.now??new Date().toISOString()},a=pl(i),c;try{let l=t.since??rs(e),u=ns(e,l);c={kind:"present",sinceRef:l,changelogMarkdown:dl(u),auditMarkdown:fl(u,i,e)}}catch(l){c={kind:"omitted",reason:l.message}}n=bG({spec:i,panel:o,provenance:s,catalogMarkdown:a,changes:c})}catch(i){L("fail","bundle",i.message),V.exit(1);return}try{I8e(r,n,"utf8")}catch(i){L("fail","bundle",`could not write ${r}: ${i.message}`),V.exit(1);return}L("pass","bundle",`${r} \xB7 ${J8e(Buffer.byteLength(n,"utf8"))}`),V.exit(0)}function X8e(t){let e=qA(t);L("note",`route \u2192 ${e}`,t),V.exit(e==="unknown"?1:0)}function Q8e(){let t=new y4;t.name("clad").description("Reference Ironclad CLI").version("0.9.0"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init payment SaaS for B2B` \u2014 free text in any language) to drive intent-aware onboarding \u2014 the LLM dispatcher then produces domain-aware capabilities/architecture/project-context plus product-level follow-up questions. Bare `clad init` keeps the v0.3.42 behaviour (greenfield seeds, or observed scan when \u22653 source files exist).").option("-n, --name ","Project name (default: cwd basename)").option("-f, --force","Overwrite existing spec.yaml").option("--scan","Force-walk the existing codebase. Default auto-detects (\u22653 source files trigger scan). Use --no-scan to skip even when source is present.").option("--no-llm","Force the deterministic interpreter (skip the LLM dispatcher chain). Intent text falls back to a deterministic quote in project-context.md.").option("--roots ","Override scanner source roots, comma-separated (e.g. packages/a/src,packages/b/src). Otherwise inferred from manifests + directory heuristics.").option("--with-hook","Install git pre-commit (cheap tier) AND pre-push (strict tier) hooks. Opt-in; cladding never touches .git without it.").option("--with-ci","Scaffold .github/workflows/cladding.yml running the strict pre-push gate \u2014 the authoritative enforcement layer.").option("--json","emit the raw InitResult for tooling; default is the human-readable surface").action(C8e),t.command("run [goal]").description("(experimental) Headless autonomous loop \u2014 iterate ready features, dispatch developer + reviewer personas, run L1 gates, record evidence. The supported, exercised path is host-delegated (clad serve + your AI host loops the cadence); this loop needs a real LLM transport and is not auto-invoked").option("--cwd ","target project directory (default cwd)").option("--max-iterations ","cap iterations (default 50)","50").option("--max-wall-clock-ms ","cap wall clock (default 600000)","600000").option("--max-retries ","cap retries per feature (default 3)","3").option("--json","emit the raw internal result (Iron Core view); default is a plain Soft Shell summary").action(D8e),t.command("sync").description("Validate spec.yaml against schema and report").option("--propose-archive","list STALE_SPECIFICATION findings whose suggestion.action is propose-archive (Phased Decommissioning Tier 2)").action(N8e),t.command("setup").description("Activate Cladding only for the current project (Claude Code / Codex / Gemini / Antigravity / Cursor)").option("--project ","activate a project other than the current directory").option("--host ","activate detected hosts (default), all, or one of: claude, codex, gemini, antigravity, cursor").option("--force","replace an existing conflicting cladding-owned project entry").option("--quiet","suppress stdout output").action(F8e),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: refresh project host wiring + sync inventory + refresh managed CLAUDE.md/AGENTS.md, then report stricter detector findings").action(L8e),t.command("check").description("Run every Iron Law stage and the drift detector suite").option("--internal","show stage codes (`stage_1.1`) instead of names (`Type`)").option("--strict","promote warn-severity drift findings to errors (CI / pre-publish gate)").option("--tier ","run only the stages for a trigger: pre-commit (drift/arch/secret) | pre-push (+ type/lint/unit/cov/spec-conformance/deliverable-smoke) | all (default; full 15-stage gate, used by CI)").option("--json","emit structured per-stage results (machine-readable: findings with file/line/suggestion, untruncated) \u2014 for agents/CI; cuts RED\u2192fix round-trips").option("--feature ","scope the gate to this feature's modules[] (Gradle monorepos): runs only :project: tasks instead of the root aggregate. No-op for non-Gradle repos or modules-less features").action(G8e),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(j8e),t.command("done ").description("Mark a feature done ONLY if `clad check --tier=pre-push --strict` is GREEN (flip \u2192 gate \u2192 revert-on-red). Keeps `done` honest.").action(Z8e),t.command("oracle [featureId]").description("Print the impl-blind oracle authoring brief (acceptance criteria + signatures, never the implementation). Hand it to a fresh blind sub-agent; record the result with clad_author_oracle. cladding calls no LLM. Use --required to list which done ACs the project policy needs an oracle for.").option("--ac ","restrict the brief to a single acceptance criterion").option("--required","list the done ACs the oracle_policy / require_oracles requires an oracle for (worklist), instead of a brief").option("--cwd ","project root (defaults to .)").action((r,n)=>V8e(r,n)),t.command("rollback ").description("Record a rollback event and print the maintainer-runnable git command for the latest checkpoint").option("-r, --reason ","optional free-text reason recorded on the event payload").action(M8e),t.command("status").description("Render the feature \xD7 stage integrity matrix (business titles; use --internal for raw F-NNN ids)").option("--internal","show internal F-NNN ids and stage codes").option("--json","emit the row model as JSON \u2014 the same feature \xD7 stage integrity matrix rendered to the terminal (columns + per-feature glyph cells), one SSoT for terminal, JSON, and the audit bundle").action(K8e),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(U8e),t.command("impact ").description("Print the blast radius for a change \u2014 what depends on a feature/file + the tests to re-run (F-7794a6bc)").option("--depth ","bound the dependent walk to N hops (default: the full transitive radius)").action((r,n)=>q8e(r,n)),t.command("verdict").description("One-poll loop decision: DONE|ITERATE|ESCALATE|BLOCKED|BOOTSTRAP over the pre-push strict gate + feature statuses (F-2e28cc72). Single gate touch; DONE requires \u22651 non-liveness proof.").option("--json","emit the verdict object as JSON").option("--tier ","gate tier (default pre-push)").action(r=>SX(r,{checkStages:xA})),t.command("infer-deps").description("Suggest feature depends_on edges from the code import graph \u2014 the dependency edges cladding never auto-produced (F-2be3e3bb). Prints reviewable suggestions; does not write the spec.").option("--ambiguity ","emit edges for imports owned by \u2264 N features (default 1 = unambiguous single-owner only)").action(r=>B8e(r)),t.command("measure").description("Report the search + context efficiency the graph provides per feature \u2014 working-set tokens vs the naive baseline, dependency depth/edges resolved, regression-set coverage (F-16138071). Deterministic; no agent.").option("--json","emit the full report as JSON").option("--sessions","summarize recorded value-delivery telemetry instead \u2014 impact-card fire rate over eligible edits, the per-reason skip histogram, and MCP read-serve counts. Measures DELIVERY (did the surfaces fire), NOT adoption (F-6ba22c5c).").option("--trend [n]","render the last N (default 5) recorded measure snapshots with signed deltas \u2014 spot efficiency drift over time from the deduped .cladding/measure.jsonl ledger (F-39609db4)").action(r=>H8e(r));let e=t.command("graph").description("Render the spec\u2194code\u2194doc knowledge graph for a viewer, or report its shape (F-569f4b37)");return e.command("export").description("Export the graph: mermaid/dot/json to stdout, or an Obsidian vault to --out").option("--format ","mermaid | dot | json | obsidian | html (default: mermaid). html = a single self-contained offline viewer (requires --out)").option("--focus ","restrict to a feature/file node\u2019s neighborhood (id, slug, or module path)").option("--depth ","neighborhood radius around --focus (default: unbounded)").option("--out ","write to a file (or, for obsidian, a vault dir \u2014 default .cladding/graph)").action(r=>Qee(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>ete()),e.command("serve").description("Serve a LIVE graph at localhost \u2014 recomputes on each load + auto-reloads on spec/doc changes (F-64a5c159)").option("--port ","port to listen on (default 3000)").action(r=>{tte(r)}),t.command("changelog").description("Render shipped changes since a git ref into human-facing documents (F-904495a5). Default: capability-grouped markdown from feature titles + acceptance sentences (no internal ids). --json emits the deterministic manifest hosts render release notes from; --audit the id-keeping verification table; --catalog the full capability \u2192 feature \u2192 acceptance catalog.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--json","print the deterministic ChangelogManifest as JSON (byte-identical across runs on the same state)").option("--audit","print the audit table \u2014 feature | AC | EARS | verification refs, each marked resolved \u2713/\u2717").option("--catalog","print the full capability \u2192 feature \u2192 acceptance listing of the living spec (no git range)").option("--measure","embed the release's own re-derivable measurement \u2014 but ONLY a snapshot taken at the current HEAD; no match renders a not-measured notice, never an older snapshot (F-ede6fa75)").action(r=>sG(r)),t.command("report").description("Render one deterministic review packet for a git range (F-f6cc5e5a) \u2014 spec-shard movement (from the changelog), changed source files resolved to their owning features via the reverse index, the deduped regression set, and gate + attestation state. For PR reviewers, team-leads, and auditors: it RENDERS, it gates nothing. Byte-identical across two runs on the same repository state.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--format ","md (default, the four-section markdown packet) | sarif (SARIF 2.1.0 \u2014 one result per error/warn drift finding, for code-scanning UIs) | json (the raw deterministic model)").action(r=>gY(r)),t.command("bundle").description("Write ONE self-contained HTML audit bundle (F-e940fffe) a non-coder can double-click \u2014 offline, zero network, no CDN, no scripts. Contains the project header + inventory, the feature \xD7 stage matrix, the capability catalog, shipped changes for the range, the audit table with resolved refs, and the attestation summary, under a provenance banner (git HEAD, date, version). Deterministic modulo the date stamp. If no anchor ref resolves, the changelog + audit sections show an omitted notice while the rest still renders.").requiredOption("--out ","destination path for the HTML bundle").option("--since ","git ref to diff shipped changes from (default: the latest tag via `git describe --tags --abbrev=0`)").action(r=>Y8e(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(X8e),t.command("hook ").description("Host hook protocol adapter \u2014 consume one host lifecycle event (SessionStart | UserPromptSubmit | PreToolUse | PostToolUse | Stop) as stdin JSON and print the protocol response on stdout. Always exits 0 so a hook failure never bricks the host session.").action(fX),t.command("serve").description("Run cladding as an MCP server over stdio \u2014 tools/resources/prompts for any MCP client").option("--cwd ","project directory exposed to the client (default cwd)").action(P8e),t.command("doctor").description("Summarise .cladding/events.log.jsonl \u2014 sentinel-miss frequency by phase/cause/fallback plus the top missed sentinels (LLM dispatcher health check)").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").option("--hosts","smoke-test host CLIs (Claude Code / Gemini / Antigravity / Codex / Cursor) and project wiring \u2192 dated artifact + docs/dogfood/matrix.md. Live LLM prompts run only with consent (CLAD_HOST_SMOKE=1 or --yes); otherwise not-run").option("--yes","grant live-run consent for --hosts (equivalent to CLAD_HOST_SMOKE=1)").option("--matrix-only","regenerate docs/dogfood/matrix.md from the newest host-smoke artifact without any probing").action(r=>{if(r.hosts||r.matrixOnly){GY({cwd:r.cwd,yes:r.yes,matrixOnly:r.matrixOnly});return}bY(r)}),t.command("clarify [answer...]").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, free text in any language, e.g. `clad clarify B2B only`); the LLM refines spec/docs based on the full Q-A history and may emit new follow-up questions. Reads/writes `.cladding/onboarding/state.yaml`. Requires `clad init ` to have started a session first.").option("--cwd ","project directory containing .cladding/onboarding/state.yaml (default cwd)").option("--no-llm","force the deterministic interpreter (preserves current artifacts, logs the answer)").option("--json","emit the raw RefineReport for tooling; default is the human-readable surface").action(jee),t}var e5e=!!globalThis.__CLADDING_BUNDLED,t5e=e5e||import.meta.url===`file://${V.argv[1]}`;t5e&&Q8e().parse();export{z8e as TIER_STAGES,Q8e as createProgram,Y8e as runBundleCommand,G8e as runCheckCommand,xA as runCheckStages,j8e as runCheckpointCommand,U8e as runContextCommand,Z8e as runDoneCommand,q8e as runImpactCommand,B8e as runInferDepsCommand,C8e as runInitCommand,H8e as runMeasureCommand,V8e as runOracleCommand,M8e as runRollbackCommand,X8e as runRouteCommand,D8e as runRunCommand,P8e as runServeCommand,F8e as runSetupCommand,K8e as runStatusCommand,N8e as runSyncCommand,L8e as runUpdateCommand}; +`).find(r=>r.trim().length>0);e&&G.stdout.write(` ${Dde(e.trim(),160)} +`)}}function Dde(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function p5e(t){let e=B();if(t.json){G.stdout.write(`${JSON.stringify(Xx(e,"."),null,2)} +`),G.exitCode=0;return}G.stdout.write(`${qte(e,".",{internal:t.internal})} +`),G.exit(0)}function m5e(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function h5e(t){let e=t.cwd??".",r=(t.out??"").trim();if(r.length===0){L("fail","bundle","missing --out \u2014 the bundle needs a destination path"),G.exit(1);return}let n;try{let i=B(e),o=Xx(i,e),s={gitHead:va(e),version:Yl(),generatedAt:t.now??new Date().toISOString()},a=gl(i),c;try{let l=t.since??rs(e),u=ns(e,l);c={kind:"present",sinceRef:l,changelogMarkdown:ml(u),auditMarkdown:hl(u,i,e)}}catch(l){c={kind:"omitted",reason:l.message}}n=$G({spec:i,panel:o,provenance:s,catalogMarkdown:a,changes:c})}catch(i){L("fail","bundle",i.message),G.exit(1);return}try{K8e(r,n,"utf8")}catch(i){L("fail","bundle",`could not write ${r}: ${i.message}`),G.exit(1);return}L("pass","bundle",`${r} \xB7 ${m5e(Buffer.byteLength(n,"utf8"))}`),G.exit(0)}function g5e(t){let e=BA(t);L("note",`route \u2192 ${e}`,t),G.exit(e==="unknown"?1:0)}function y5e(){let t=new w4;t.name("clad").description("Reference Ironclad CLI").version("0.9.0"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init payment SaaS for B2B` \u2014 free text in any language) to drive intent-aware onboarding \u2014 the LLM dispatcher then produces domain-aware capabilities/architecture/project-context plus product-level follow-up questions. Bare `clad init` keeps the v0.3.42 behaviour (greenfield seeds, or observed scan when \u22653 source files exist).").option("-n, --name ","Project name (default: cwd basename)").option("-f, --force","Overwrite existing spec.yaml").option("--scan","Force-walk the existing codebase. Default auto-detects (\u22653 source files trigger scan). Use --no-scan to skip even when source is present.").option("--no-llm","Force the deterministic interpreter (skip the LLM dispatcher chain). Intent text falls back to a deterministic quote in project-context.md.").option("--roots ","Override scanner source roots, comma-separated (e.g. packages/a/src,packages/b/src). Otherwise inferred from manifests + directory heuristics.").option("--with-hook","Install git pre-commit (cheap tier) AND pre-push (strict tier) hooks. Opt-in; cladding never touches .git without it.").option("--with-ci","Scaffold .github/workflows/cladding.yml running the strict pre-push gate \u2014 the authoritative enforcement layer.").option("--json","emit the raw InitResult for tooling; default is the human-readable surface").action(Y8e),t.command("run [goal]").description("(experimental) Headless autonomous loop \u2014 iterate ready features, dispatch developer + reviewer personas, run L1 gates, record evidence. The supported, exercised path is host-delegated (clad serve + your AI host loops the cadence); this loop needs a real LLM transport and is not auto-invoked").option("--cwd ","target project directory (default cwd)").option("--max-iterations ","cap iterations (default 50)","50").option("--max-wall-clock-ms ","cap wall clock (default 600000)","600000").option("--max-retries ","cap retries per feature (default 3)","3").option("--json","emit the raw internal result (Iron Core view); default is a plain Soft Shell summary").action(X8e),t.command("sync").description("Validate spec.yaml against schema and report").option("--propose-archive","list STALE_SPECIFICATION findings whose suggestion.action is propose-archive (Phased Decommissioning Tier 2)").action(Q8e),t.command("setup").description("Activate Cladding only for the current project (Claude Code / Codex / Gemini / Antigravity / Cursor)").option("--project ","activate a project other than the current directory").option("--host ","activate detected hosts (default), all, or one of: claude, codex, gemini, antigravity, cursor").option("--force","replace an existing conflicting cladding-owned project entry").option("--quiet","suppress stdout output").action(r5e),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: refresh project host wiring + sync inventory + refresh managed CLAUDE.md/AGENTS.md, then report stricter detector findings").action(n5e),t.command("check").description("Run every Iron Law stage and the drift detector suite").option("--internal","show stage codes (`stage_1.1`) instead of names (`Type`)").option("--strict","promote warn-severity drift findings to errors (CI / pre-publish gate)").option("--tier ","run only the stages for a trigger: pre-commit (drift/arch/secret) | pre-push (+ type/lint/unit/cov/spec-conformance/deliverable-smoke) | all (default; full 15-stage gate, used by CI)").option("--json","emit structured per-stage results (machine-readable: findings with file/line/suggestion, untruncated) \u2014 for agents/CI; cuts RED\u2192fix round-trips").option("--feature ","scope the gate to this feature's modules[] (Gradle monorepos): runs only :project: tasks instead of the root aggregate. No-op for non-Gradle repos or modules-less features").action(l5e),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(e5e),t.command("done ").description("Mark a feature done ONLY if `clad check --tier=pre-push --strict` is GREEN (flip \u2192 gate \u2192 revert-on-red). Keeps `done` honest.").action(u5e),t.command("oracle [featureId]").description("Print the impl-blind oracle authoring brief (acceptance criteria + signatures, never the implementation). Hand it to a fresh blind sub-agent; record the result with clad_author_oracle. cladding calls no LLM. Use --required to list which done ACs the project policy needs an oracle for.").option("--ac ","restrict the brief to a single acceptance criterion").option("--required","list the done ACs the oracle_policy / require_oracles requires an oracle for (worklist), instead of a brief").option("--cwd ","project root (defaults to .)").action((r,n)=>d5e(r,n)),t.command("rollback ").description("Record a rollback event and print the maintainer-runnable git command for the latest checkpoint").option("-r, --reason ","optional free-text reason recorded on the event payload").action(t5e),t.command("status").description("Render the feature \xD7 stage integrity matrix (business titles; use --internal for raw F-NNN ids)").option("--internal","show internal F-NNN ids and stage codes").option("--json","emit the row model as JSON \u2014 the same feature \xD7 stage integrity matrix rendered to the terminal (columns + per-feature glyph cells), one SSoT for terminal, JSON, and the audit bundle").action(p5e),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(o5e),t.command("impact ").description("Print the blast radius for a change \u2014 what depends on a feature/file + the tests to re-run (F-7794a6bc)").option("--depth ","bound the dependent walk to N hops (default: the full transitive radius)").action((r,n)=>s5e(r,n)),t.command("verdict").description("One-poll loop decision: DONE|ITERATE|ESCALATE|BLOCKED|BOOTSTRAP over the pre-push strict gate + feature statuses (F-2e28cc72). Single gate touch; DONE requires \u22651 non-liveness proof.").option("--json","emit the verdict object as JSON").option("--tier ","gate tier (default pre-push)").action(r=>CX(r,{checkStages:$A})),t.command("infer-deps").description("Suggest feature depends_on edges from the code import graph \u2014 the dependency edges cladding never auto-produced (F-2be3e3bb). Prints reviewable suggestions; does not write the spec.").option("--ambiguity ","emit edges for imports owned by \u2264 N features (default 1 = unambiguous single-owner only)").action(r=>a5e(r)),t.command("measure").description("Report the search + context efficiency the graph provides per feature \u2014 working-set tokens vs the naive baseline, dependency depth/edges resolved, regression-set coverage (F-16138071). Deterministic; no agent.").option("--json","emit the full report as JSON").option("--sessions","summarize recorded value-delivery telemetry instead \u2014 impact-card fire rate over eligible edits, the per-reason skip histogram, and MCP read-serve counts. Measures DELIVERY (did the surfaces fire), NOT adoption (F-6ba22c5c).").option("--trend [n]","render the last N (default 5) recorded measure snapshots with signed deltas \u2014 spot efficiency drift over time from the deduped .cladding/measure.jsonl ledger (F-39609db4)").action(r=>c5e(r));let e=t.command("graph").description("Render the spec\u2194code\u2194doc knowledge graph for a viewer, or report its shape (F-569f4b37)");return e.command("export").description("Export the graph: mermaid/dot/json to stdout, or an Obsidian vault to --out").option("--format ","mermaid | dot | json | obsidian | html (default: mermaid). html = a single self-contained offline viewer (requires --out)").option("--focus ","restrict to a feature/file node\u2019s neighborhood (id, slug, or module path)").option("--depth ","neighborhood radius around --focus (default: unbounded)").option("--out ","write to a file (or, for obsidian, a vault dir \u2014 default .cladding/graph)").action(r=>ate(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>cte()),e.command("serve").description("Serve a LIVE graph at localhost \u2014 recomputes on each load + auto-reloads on spec/doc changes (F-64a5c159)").option("--port ","port to listen on (default 3000)").action(r=>{lte(r)}),t.command("changelog").description("Render shipped changes since a git ref into human-facing documents (F-904495a5). Default: capability-grouped markdown from feature titles + acceptance sentences (no internal ids). --json emits the deterministic manifest hosts render release notes from; --audit the id-keeping verification table; --catalog the full capability \u2192 feature \u2192 acceptance catalog.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--json","print the deterministic ChangelogManifest as JSON (byte-identical across runs on the same state)").option("--audit","print the audit table \u2014 feature | AC | EARS | verification refs, each marked resolved \u2713/\u2717").option("--catalog","print the full capability \u2192 feature \u2192 acceptance listing of the living spec (no git range)").option("--measure","embed the release's own re-derivable measurement \u2014 but ONLY a snapshot taken at the current HEAD; no match renders a not-measured notice, never an older snapshot (F-ede6fa75)").action(r=>dG(r)),t.command("report").description("Render one deterministic review packet for a git range (F-f6cc5e5a) \u2014 spec-shard movement (from the changelog), changed source files resolved to their owning features via the reverse index, the deduped regression set, and gate + attestation state. For PR reviewers, team-leads, and auditors: it RENDERS, it gates nothing. Byte-identical across two runs on the same repository state.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--format ","md (default, the four-section markdown packet) | sarif (SARIF 2.1.0 \u2014 one result per error/warn drift finding, for code-scanning UIs) | json (the raw deterministic model)").action(r=>SY(r)),t.command("bundle").description("Write ONE self-contained HTML audit bundle (F-e940fffe) a non-coder can double-click \u2014 offline, zero network, no CDN, no scripts. Contains the project header + inventory, the feature \xD7 stage matrix, the capability catalog, shipped changes for the range, the audit table with resolved refs, and the attestation summary, under a provenance banner (git HEAD, date, version). Deterministic modulo the date stamp. If no anchor ref resolves, the changelog + audit sections show an omitted notice while the rest still renders.").requiredOption("--out ","destination path for the HTML bundle").option("--since ","git ref to diff shipped changes from (default: the latest tag via `git describe --tags --abbrev=0`)").action(r=>h5e(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(g5e),t.command("hook ").description("Host hook protocol adapter \u2014 consume one host lifecycle event (SessionStart | UserPromptSubmit | PreToolUse | PostToolUse | Stop) as stdin JSON and print the protocol response on stdout. Always exits 0 so a hook failure never bricks the host session.").action($X),t.command("serve").description("Run cladding as an MCP server over stdio \u2014 tools/resources/prompts for any MCP client").option("--cwd ","project directory exposed to the client (default cwd)").action(J8e),t.command("doctor").description("Summarise .cladding/events.log.jsonl \u2014 sentinel-miss frequency by phase/cause/fallback plus the top missed sentinels (LLM dispatcher health check)").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").option("--hosts","smoke-test host CLIs (Claude Code / Gemini / Antigravity / Codex / Cursor) and project wiring \u2192 dated artifact + docs/dogfood/matrix.md. Live LLM prompts run only with consent (CLAD_HOST_SMOKE=1 or --yes); otherwise not-run").option("--yes","grant live-run consent for --hosts (equivalent to CLAD_HOST_SMOKE=1)").option("--matrix-only","regenerate docs/dogfood/matrix.md from the newest host-smoke artifact without any probing").action(r=>{if(r.hosts||r.matrixOnly){JY({cwd:r.cwd,yes:r.yes,matrixOnly:r.matrixOnly});return}$Y(r)}),t.command("clarify [answer...]").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, free text in any language, e.g. `clad clarify B2B only`); the LLM refines spec/docs based on the full Q-A history and may emit new follow-up questions. Reads/writes `.cladding/onboarding/state.yaml`. Requires `clad init ` to have started a session first.").option("--cwd ","project directory containing .cladding/onboarding/state.yaml (default cwd)").option("--no-llm","force the deterministic interpreter (preserves current artifacts, logs the answer)").option("--json","emit the raw RefineReport for tooling; default is the human-readable surface").action(Hee),t}var _5e=!!globalThis.__CLADDING_BUNDLED,b5e=_5e||import.meta.url===`file://${G.argv[1]}`;b5e&&y5e().parse();export{i5e as TIER_STAGES,y5e as createProgram,h5e as runBundleCommand,l5e as runCheckCommand,$A as runCheckStages,e5e as runCheckpointCommand,o5e as runContextCommand,u5e as runDoneCommand,s5e as runImpactCommand,a5e as runInferDepsCommand,Y8e as runInitCommand,c5e as runMeasureCommand,d5e as runOracleCommand,t5e as runRollbackCommand,g5e as runRouteCommand,X8e as runRunCommand,J8e as runServeCommand,r5e as runSetupCommand,p5e as runStatusCommand,Q8e as runSyncCommand,n5e as runUpdateCommand}; diff --git a/spec.yaml b/spec.yaml index f3cde6c..6e2d98b 100644 --- a/spec.yaml +++ b/spec.yaml @@ -54,7 +54,7 @@ project: # Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand. inventory: - features: 256 + features: 258 scenarios: 2 capabilities: 6 - test_files: 237 + test_files: 240 diff --git a/spec/attestation.yaml b/spec/attestation.yaml index 87931e3..b8ea2bc 100644 --- a/spec/attestation.yaml +++ b/spec/attestation.yaml @@ -17,15 +17,15 @@ attested_modules: .claude/settings.json: d0bba3583aef0960 .github/workflows/ci.yml: 8ea99219cb80df60 .gitignore: 1294975ba3b47043 - CHANGELOG.md: 1524903097b4f9b0 + CHANGELOG.md: 9580bab8d2c2d6f3 CLAUDE.md: 16212c1749e6005d GOVERNANCE.md: 21cc28eaaf637a20 - README.html: dd6c44fc6c151ad4 - README.ja.md: d4de131ac59941f8 - README.ko.html: a494606ab7bfce8e - README.ko.md: 45c1a27b3f25c983 - README.md: 5831410ed5c38337 - README.zh.md: a6aef09c240f2b62 + README.html: 65afa8fb2869af33 + README.ja.md: 76c65fbe8ce375ca + README.ko.html: b2c64abdef027cfe + README.ko.md: ec85f7c80d28aa7f + README.md: f224c6b0c048758e + README.zh.md: cd06282ef042ad3a SECURITY.md: df1d0c80304b2f28 bin/clad: 77b80666665dd1b0 conformance/fixtures.yaml: 4b1b94dae1cd20b0 @@ -113,7 +113,7 @@ attested_modules: skills/serve/SKILL.md: f08bbdbbfeb05041 skills/status/SKILL.md: 09faadc50b3449da skills/sync/SKILL.md: 775c0f990a52a3d9 - spec.yaml: 82491ca5dc73636f + spec.yaml: 877c1ca13475b185 spec/README.md: 7c257426396d435c spec/architecture.yaml: f0888480405a13a8 spec/features/: a4d0f0eb87fed960 @@ -146,14 +146,15 @@ attested_modules: src/cli: a4d0f0eb87fed960 src/cli/benchmark.ts: 77f84d2a898d724f src/cli/changelog.ts: 2de1adb009b89ab4 - src/cli/clad.ts: 00d049c7acb5f761 + src/cli/clad.ts: 8c5e056a4eea223a src/cli/clarify.ts: 393cc93a6feb698a src/cli/doctor-hosts.ts: 1f0c2cec5a310b81 src/cli/doctor.ts: b98b955fe75e7f7e src/cli/done.ts: 02bd4397eaf34fa1 + src/cli/enforcement-advisory.ts: 554a7b56475981c3 src/cli/graph-serve.ts: 23e6e389225d0f98 src/cli/graph.ts: bab410061b8c746a - src/cli/hook.ts: 201f82f4c89e173f + src/cli/hook.ts: 21f22f6e565466d1 src/cli/host-onboarding.ts: b046571d4be7280c src/cli/init.ts: 04135bc767e58e02 src/cli/intent-from-path.ts: e69862821d979f22 @@ -202,7 +203,7 @@ attested_modules: src/hitl/audit.ts: 79b06e904815469a src/hitl/identity.ts: 52ff84aa666f1dab src/init/agents-md.ts: 7dc05f6d82e5c3ce - src/init/git-hook.ts: 4e02f177b3764ae8 + src/init/git-hook.ts: b77910b0df392cbf src/init/host-instructions.ts: 7a066c646f0b6133 src/init/host-setup.ts: 158cc9306a746da1 src/optimizer: a4d0f0eb87fed960 @@ -260,7 +261,7 @@ attested_modules: src/stages/detectors/architecture-from-spec.ts: ee36fa5f94a5be2a src/stages/detectors/architecture-violation.ts: b5035317a61e5ebe src/stages/detectors/capabilities-feature-mapping.ts: fa245f053f98a78a - src/stages/detectors/convention-drift.ts: 450cb86924dfcf82 + src/stages/detectors/convention-drift.ts: 571500224c124e53 src/stages/detectors/coverage-drop.ts: 809d13599596793e src/stages/detectors/deliverable-integrity.ts: d0fbc1dd05bd245a src/stages/detectors/dependency-cycle.ts: 873c8fdde00aa48b @@ -299,16 +300,16 @@ attested_modules: src/stages/detectors/with-spec.ts: dcf3205e8d563574 src/stages/disposition.ts: b7fd2e591235a326 src/stages/drift.ts: d3993f3b168ceb34 - src/stages/finding-parser.ts: 19a10c5fe216059c + src/stages/finding-parser.ts: d9cd56dbe3c3b9a7 src/stages/graph-health.ts: a294f06796b0e293 src/stages/junit-report.ts: f8466dc1e00140f1 - src/stages/lint.ts: c1513a7c710fb13b + src/stages/lint.ts: e9c4505e587e6088 src/stages/perf.ts: 2b27c12427f65b2e src/stages/secret.ts: b90abc0e00c86219 src/stages/skip-policy.ts: 1a6412d708561cf0 src/stages/smoke.ts: cbe55596f6b0a49e src/stages/spec-conformance.ts: 1e9b052a2a268d7a - src/stages/test-run-cache.ts: 46df49ab73a1a72e + src/stages/test-run-cache.ts: 462a5ef1d30eb766 src/stages/toolchain/coverage-tool.ts: 310883060ed6d92e src/stages/toolchain/detect.ts: 36d4947e5567bd5f src/stages/toolchain/gate-config.ts: 818a0a549d875581 @@ -317,9 +318,9 @@ attested_modules: src/stages/toolchain/scoped-command.ts: f2dd6410c063279f src/stages/toolchain/types.ts: 05f018fb3dddc321 src/stages/type.ts: 0ac37e45b407446d - src/stages/types.ts: 24b4dc30ec7d7f33 + src/stages/types.ts: 95e8c9e13187d85b src/stages/uat.ts: 62ec3e37a124f8c5 - src/stages/unit.ts: fe5bf9e4bec1de77 + src/stages/unit.ts: b503350b0e5c7e5a src/stages/util.ts: a024afe34884d653 src/stages/vacuous-tests.ts: 8e71b81e151325af src/stages/visual.ts: 2b60dd991fa8124e @@ -391,7 +392,7 @@ attested_modules: tests/stages/architecture-violation.test.ts: f713ac001d4a797f tests/stages/audit.test.ts: 8785d8fb21008d49 tests/stages/commit.test.ts: e387291e76ffc5d2 - tests/stages/convention-drift.test.ts: f16176d8c9e97753 + tests/stages/convention-drift.test.ts: f5638d887e5533f3 tests/stages/cov.test.ts: c50dda16447f94ab tests/stages/coverage-drop.test.ts: 272d118239cda6be tests/stages/detector-purity.test.ts: cc8d4a60e6956198 @@ -556,6 +557,7 @@ attested_features: F-417ff0: ok F-42af48: ok F-43d8e3: ok + F-4643d99d: ok F-4747ef: ok F-47b8bee5: ok F-49f6f2d2: ok @@ -678,8 +680,10 @@ attested_features: F-f334fa: ok F-f44d1b: ok F-f46d5c61: ok + F-f4e184f7: ok F-f6cc5e5a: ok F-f6d13e: ok + F-f9891175: ok F-fb9b48a5: ok F-fcece7: ok F-fe0f7a96: ok diff --git a/spec/features/enforcement-advisory-f4e184f7.yaml b/spec/features/enforcement-advisory-f4e184f7.yaml new file mode 100644 index 0000000..fbf2b89 --- /dev/null +++ b/spec/features/enforcement-advisory-f4e184f7.yaml @@ -0,0 +1,31 @@ +id: F-f4e184f7 +slug: enforcement-advisory +title: "clad check advisory when the feature cycle has no hook or CI enforcement" +status: done +modules: + - src/cli/enforcement-advisory.ts + - src/init/git-hook.ts + - src/cli/clad.ts +acceptance_criteria: + - id: AC-4566fd98 + test_refs: + - tests/cli/enforcement-advisory.test.ts + ears: event + condition: "when clad check runs in a project that has features not yet done and neither a cladding pre-commit/pre-push hook nor a .github/workflows directory is present" + response: "return one non-blocking advisory that the checks are unenforced" + text: "When clad check runs in a project that has features not yet done and no cladding git hook and no CI workflow is wired, the system shall surface one non-blocking advisory naming how many features are undone and how to wire enforcement." + notes: "The gap: a project can run for months with authored-but-undone features while every commit stays green because pre-commit is not --strict and no hook/CI is installed. Reuses the existsSync('.github/workflows') idiom from clad update; the hook reader matches the `cladding hook` marker." + - id: AC-2fd01eaa + test_refs: + - tests/cli/enforcement-advisory.test.ts + ears: unwanted + condition: "if an enforcing cladding hook is installed, or a CI workflow directory exists, or no feature is undone" + response: "return no advisory" + text: "If an enforcing cladding hook is installed, or a CI workflow directory exists, or no feature is not-yet-done, the system shall return no advisory, so a project that already wired enforcement is never nagged." + notes: "Any ONE of the three suppressors is enough. A missing/invalid spec also yields no advisory — it is not this check's place to speak." + - id: AC-be0cbdaa + test_refs: + - tests/cli/enforcement-advisory.test.ts + ears: ubiquitous + text: "The advisory shall be informational only: it is derived without the gate outcome and shall not change clad check's exit status." + notes: "enforcementAdvisory takes only cwd (never a stage result), so it cannot depend on or alter pass/fail; runCheckCommand prints it but still sets process.exitCode from the gate's worst status." diff --git a/spec/features/lint-multi-finding-4643d99d.yaml b/spec/features/lint-multi-finding-4643d99d.yaml new file mode 100644 index 0000000..6a7a8bd --- /dev/null +++ b/spec/features/lint-multi-finding-4643d99d.yaml @@ -0,0 +1,33 @@ +id: F-4643d99d +slug: lint-multi-finding +title: "check-only formatter lint findings — list every dirty file, with a fix hint" +status: done +modules: + - src/stages/finding-parser.ts + - src/stages/lint.ts + - src/cli/clad.ts +acceptance_criteria: + - id: AC-7b620bf4 + test_refs: + - tests/stages/lint-multi-finding.test.ts + ears: event + condition: "when a check-only formatter fails and its output lists changed files (e.g. `dart format`'s `Changed ` lines)" + response: "produce one structured LINT finding per listed file, each carrying that file's path" + text: "When a check-only formatter fails and its output lists changed files, the lint parser shall produce one structured LINT finding per listed file, each carrying the file path, so every dirty file surfaces at once instead of only the first line." + notes: "The bug: dart format prints `Changed ` per dirty file plus a summary; none match the ESLint stylish regex, so parseToolFindings collapsed 11 files to one pathless synthetic finding (whack-a-mole). The renderer already lists up to 3 + '… and N more' and shows `— ` when a finding has a path." + - id: AC-6c16b63e + test_refs: + - tests/stages/lint-multi-finding.test.ts + ears: state + condition: "while a check-only formatter (dart/dotnet format) fails the lint stage" + response: "attach a one-line remediation hint naming the fix command" + text: "While a recognised check-only formatter fails the lint stage, the stage result shall carry a one-line remediation hint naming the command that fixes the formatting (e.g. `dart format .`), which the check renderer prints under the findings." + notes: "No stage prints a fix hint today; the house style is a backticked command in a short imperative. Derived from the resolved lint command, not hard-coded per project." + - id: AC-83a47b38 + test_refs: + - tests/stages/lint-multi-finding.test.ts + ears: unwanted + condition: "if a failing formatter's output matches no known per-file pattern" + response: "keep the existing single raw-tail synthetic finding" + text: "If a failing formatter's output matches no known per-file pattern, the system shall keep the existing single raw-tail synthetic finding, so an unstructured failure still reads as a problem rather than as silence." + notes: "Preserves F-b7873005 AC-20b69848: 'no structure' never becomes 'no problem'. The per-file parser runs only after the ESLint parser and before the synthetic fallback." diff --git a/spec/features/test-run-dedup-49f6f2d2.yaml b/spec/features/test-run-dedup-49f6f2d2.yaml index 8126a19..7092638 100644 --- a/spec/features/test-run-dedup-49f6f2d2.yaml +++ b/spec/features/test-run-dedup-49f6f2d2.yaml @@ -4,6 +4,7 @@ title: "gate-scoped test-run dedup — run the suite once, without disabling the status: done modules: - src/stages/test-run-cache.ts + - src/stages/unit.ts acceptance_criteria: - id: AC-9a1c4e21 test_refs: @@ -41,3 +42,18 @@ acceptance_criteria: ears: ubiquitous text: "When no gate run is primed (a standalone stage call or the MCP read path), the shared-run cache shall be a pass-through, leaving unit and coverage behavior byte-for-byte unchanged." notes: "Same pass-through discipline as detector-result-cache: a fresh map per gate run, cleared in finally, so the long-lived MCP server never serves a stale test result across requests." + - id: AC-d769e24f + test_refs: + - tests/stages/test-run-dedup.test.ts + ears: state + condition: "while a gate is primed and the coverage runner is pytest" + text: "While a gate run is primed and the coverage runner is pytest, the system shall execute the suite exactly once by having the unit stage run the coverage-instrumented `coverage run -m pytest` and publishing it so the coverage stage folds the same process." + notes: "The Python analogue of #215's vitest dedup: coverage.py's exit code IS pytest's, so one instrumented run yields both the unit pass/fail and the coverage data. cov.ts's peekSharedRun fold is already language-agnostic; the producer gate lives in unit.ts (tryReuseSharedPytestRun)." + - id: AC-f8e85a99 + test_refs: + - tests/stages/test-run-dedup.test.ts + ears: unwanted + condition: "if the unit stage reuses the shared pytest run under --strict" + response: "still evaluate the zero-executed-tests guard against the shared run output before returning a passing unit result" + text: "If the unit stage reuses the shared pytest run under --strict, the system shall evaluate the zero-executed-tests guard against the shared run's own summary and shall never return a passing unit result for a run that collected zero tests." + notes: "Mirrors AC-6b2d81f7 for pytest: the reuse-pass path is not a guard bypass. reportsZeroExecutedTests recognizes pytest's `collected 0 items`, so a coverage-instrumented pytest run that exits 0 yet collected nothing blocks instead of reading as verified." diff --git a/spec/features/unbound-edit-nudge-f9891175.yaml b/spec/features/unbound-edit-nudge-f9891175.yaml new file mode 100644 index 0000000..f2fe6db --- /dev/null +++ b/spec/features/unbound-edit-nudge-f9891175.yaml @@ -0,0 +1,37 @@ +id: F-f9891175 +slug: unbound-edit-nudge +title: "PostToolUse nudge when sustained source edits are bound to no feature" +status: done +modules: + - src/cli/hook.ts +acceptance_criteria: + - id: AC-8542cc63 + test_refs: + - tests/cli/hook-unbound-nudge.test.ts + ears: event + condition: "when watched source edits that resolve to no owning feature reach the nudge threshold within one window" + response: "include exactly one non-blocking nudge line in the PostToolUse card" + text: "When watched source edits that resolve to no owning feature reach the nudge threshold within one window, the PostToolUse card shall include exactly one non-blocking nudge line naming how many recent source edits are unbound and how to start a feature." + notes: "The feature cycle is never TRIGGERED for a stream of edits that touch no feature's modules — cladding stays silent (impact_card_skipped{owner_miss}). This nudge closes that gap without blocking, reusing the owner_miss site in emitCardForPath." + - id: AC-388518f4 + test_refs: + - tests/cli/hook-unbound-nudge.test.ts + ears: unwanted + condition: "if the event is a Read, a non-source path, still below the threshold, or an edit to a file already bound to a feature's modules" + response: "emit no nudge" + text: "If a PostToolUse event is a Read, a non-source path, still below the threshold, or an edit to a file already bound to a feature's modules, the system shall emit no nudge." + notes: "Bound files resolve to an owner (a real card fires) and never reach the owner_miss counter, so binding a file suppresses the nudge for that file with no extra logic." + - id: AC-5d379d4e + test_refs: + - tests/cli/hook-unbound-nudge.test.ts + ears: state + condition: "while a nudge has already fired within the current window" + response: "suppress further nudges until the window rolls over" + text: "While a nudge has already fired within the current window, the system shall suppress further nudges until the window rolls over, so unbound editing cannot spam the card." + notes: "Mirrors the SkipAgg once-per-window discipline: a dedicated .cladding/hook-unbound-agg.json sidecar keyed to a rolling window, flushed/reset the same way." + - id: AC-228fdc15 + test_refs: + - tests/cli/hook-unbound-nudge.test.ts + ears: ubiquitous + text: "The nudge shall never block the tool call, and a sidecar or telemetry failure shall leave the hook's stdout byte-identical to the output produced without the nudge feature." + notes: "Preserves F-6ba22c5c AC-e9d041de (observer-only, byte-identical on failure) and the PostToolUse never-block invariant: the nudge is advisory text appended to the card, wrapped so any sidecar throw returns ''." diff --git a/spec/index.yaml b/spec/index.yaml index 95178bf..48e0816 100644 --- a/spec/index.yaml +++ b/spec/index.yaml @@ -129,9 +129,10 @@ features: F-417ff0: {slug: scan-llm-dispatcher-chain, status: done, modules: 5} F-42af48: {slug: architecture-from-spec, status: done, modules: 2} F-43d8e3: {slug: smoke-probe-token-pass, status: done, modules: 3} + F-4643d99d: {slug: lint-multi-finding, status: done, modules: 3} F-4747ef: {slug: ssot-lifecycle-tests, status: done, modules: 9} F-47b8bee5: {slug: ts-toolchain-jest-and-multiext-arch, status: done, modules: 1} - F-49f6f2d2: {slug: test-run-dedup, status: done, modules: 1} + F-49f6f2d2: {slug: test-run-dedup, status: done, modules: 2} F-49facde9: {slug: loop-engineering-readme, status: done, modules: 4} F-4db939: {slug: ab-evaluation, status: done, modules: 9} F-4ef09f38: {slug: multi-probe-smoke, status: done, modules: 3} @@ -253,8 +254,10 @@ features: F-f334fa: {slug: ab-ext-scenarios-emit, status: done, modules: 3} F-f44d1b: {slug: hollow-governance-detector, status: done, modules: 2} F-f46d5c61: {slug: human-first-cards, status: done, modules: 3} + F-f4e184f7: {slug: enforcement-advisory, status: done, modules: 3} F-f6cc5e5a: {slug: pr-review-packet, status: done, modules: 4} F-f6d13e: {slug: capabilities-in-spec, status: done, modules: 3} + F-f9891175: {slug: unbound-edit-nudge, status: done, modules: 1} F-fb9b48a5: {slug: session-start-guidance, status: done, modules: 1} F-fcece7: {slug: external-docs-update-v0-3-13, status: done, modules: 3} F-fe0f7a96: {slug: removed-verb-guidance, status: done, modules: 2} diff --git a/src/cli/clad.ts b/src/cli/clad.ts index 6cffdd9..2e241e8 100644 --- a/src/cli/clad.ts +++ b/src/cli/clad.ts @@ -20,6 +20,7 @@ import {runReportCommand} from './report.js'; import {runDoctorCommand} from './doctor.js'; import {runDoctorHosts} from './doctor-hosts.js'; import {runDone} from './done.js'; +import {enforcementAdvisory} from './enforcement-advisory.js'; import {runHookCommand} from './hook.js'; import {runVerdictCommand} from './verdict.js'; import {runUpdate} from './update.js'; @@ -822,12 +823,19 @@ export function runCheckCommand(opts: {internal?: boolean; strict?: boolean; tie process.exit(1); } } + const result = runCheckStages({...opts, focusModules}); + // F-f4e184f7: a non-blocking advisory when the feature cycle has undone features + // but neither a hook nor CI enforces the checks. Suppressed under --json. + if (!opts.json) { + const advisory = enforcementAdvisory('.'); + if (advisory) process.stdout.write(`ℹ ${advisory}\n`); + } // Set process.exitCode rather than process.exit(): the machine-output mode // (--json) can write >64KB to stdout, and process.exit() terminates before a // buffered stdout PIPE flushes — truncating the document for any consumer // that pipes (vs. redirects to a file). Letting the event loop drain // guarantees the full payload is emitted, then Node exits with this code. - process.exitCode = runCheckStages({...opts, focusModules}).worst; + process.exitCode = result.worst; } /** @@ -902,6 +910,7 @@ export function runOracleCommand(featureId: string | undefined, opts: {ac?: stri function printStageDetails( r: { stderr?: string; + hint?: string; findings?: readonly {detector: string; severity: string; message: string; path?: string}[]; }, ): void { @@ -920,6 +929,8 @@ function printStageDetails( if (surface.length > 3) { process.stdout.write(` … and ${surface.length - 3} more finding(s)\n`); } + // F-4643d99d: a one-line remediation hint under a failing tool stage. + if (r.hint) process.stdout.write(` fix: run \`${r.hint}\`\n`); return; } if (r.stderr && r.stderr.trim().length > 0) { diff --git a/src/cli/enforcement-advisory.ts b/src/cli/enforcement-advisory.ts new file mode 100644 index 0000000..fba8e40 --- /dev/null +++ b/src/cli/enforcement-advisory.ts @@ -0,0 +1,46 @@ +// Cladding · enforcement advisory (F-f4e184f7) +// +// A project can run for months with authored-but-undone features while every +// commit stays green: the pre-commit tier is not --strict, and if no hook and no +// CI are wired, the gate runs only when someone types `clad check`. Nothing tells +// the user the feature cycle isn't being enforced. This computes a single +// non-blocking advisory for `clad check` to print — derived from cwd alone, never +// from the gate outcome, so it can only inform, never change pass/fail. + +import {existsSync} from 'node:fs'; +import {join} from 'node:path'; + +import {enforcingHookInstalled} from '../init/git-hook.js'; +import {loadSpec} from '../spec/load.js'; + +/** True when a CI workflow directory exists (the authoritative, unbypassable gate). */ +function ciWorkflowPresent(cwd: string): boolean { + return existsSync(join(cwd, '.github', 'workflows')); +} + +// Statuses of a feature still moving through the cycle. This is the advisory's own +// "work in flight" notion (a UX cadence count), NOT the detectors' spec-first +// severity window (isSpecFirstWindow, F-c3747d7d) — kept separate on purpose. +const UNDONE_STATUSES: ReadonlySet = new Set(['planned', 'in_progress']); + +/** + * A one-line advisory when the feature cycle has undone features but no local hook + * and no CI enforce the checks — else `undefined`. Any ONE of {enforcing hook, CI + * workflow, zero undone features, unreadable spec} suppresses it. + */ +export function enforcementAdvisory(cwd = '.'): string | undefined { + let undone: number; + try { + const spec = loadSpec(cwd); + undone = (spec.features ?? []).filter((f) => UNDONE_STATUSES.has(f.status)).length; + } catch { + return undefined; // no / invalid spec → not this check's place to speak + } + if (undone === 0) return undefined; + if (enforcingHookInstalled(cwd) || ciWorkflowPresent(cwd)) return undefined; + return ( + `${undone} feature${undone === 1 ? '' : 's'} not yet done, and nothing enforces the checks ` + + '(no pre-push hook, no CI) — the gate runs only when you ask. ' + + 'Wire it with `clad init --with-hook`, or add a CI workflow.' + ); +} diff --git a/src/cli/hook.ts b/src/cli/hook.ts index 9cf6249..a5e4af6 100644 --- a/src/cli/hook.ts +++ b/src/cli/hook.ts @@ -572,6 +572,78 @@ function recordImpactSkip(cwd: string, reason: ImpactSkipReason): void { recordEvent(cwd, 'impact_card_skipped', {reason}); } +// --- unbound-edit nudge (F-f9891175) ----------------------------------- +// +// When watched source edits keep resolving to no owning feature, the feature +// cycle is never TRIGGERED — cladding otherwise stays silent (owner_miss skips). +// This counts owner_miss edits in a rolling window and, once past a small +// threshold, returns ONE advisory nudge line for the PostToolUse card, fired +// once per window (AC-5d379d4e). Same sidecar discipline as SkipAgg; every path +// is wrapped so a failure returns '' and stdout stays byte-identical (AC-228fdc15). + +const UNBOUND_AGG_FILE = 'hook-unbound-agg.json'; +const UNBOUND_NUDGE_THRESHOLD = 3; +const UNBOUND_WINDOW_MS = 10 * 60_000; // rolling 10-minute accumulation window + +interface UnboundAgg { + windowStart: number; + count: number; + nudged: boolean; +} + +function unboundAggPath(cwd: string): string { + return join(cwd, '.cladding', UNBOUND_AGG_FILE); +} + +/** Read the sidecar; corrupt/missing → a fresh window (never throws). */ +function readUnboundAgg(cwd: string, now: number): UnboundAgg { + try { + const o = JSON.parse(readFileSync(unboundAggPath(cwd), 'utf8')) as Partial; + return { + windowStart: Number.isFinite(o.windowStart) ? Number(o.windowStart) : now, + count: Number.isFinite(o.count) ? Number(o.count) : 0, + nudged: o.nudged === true, + }; + } catch { + return {windowStart: now, count: 0, nudged: false}; + } +} + +function writeUnboundAgg(cwd: string, agg: UnboundAgg): void { + try { + mkdirSync(dirname(unboundAggPath(cwd)), {recursive: true}); + writeFileSync(unboundAggPath(cwd), JSON.stringify(agg), 'utf8'); + } catch { + /* unwritable sidecar → nudge just won't persist; never a throw */ + } +} + +/** + * Counts one owner_miss (unbound) source edit and, when the rolling-window count + * first crosses the threshold, returns ONE advisory nudge line — otherwise ''. + * Observer-only: any failure returns '' so the caller's stdout is byte-identical + * to the output produced without this feature (AC-228fdc15). + */ +function unboundEditNudge(cwd: string): string { + try { + const now = Date.now(); + let agg = readUnboundAgg(cwd, now); + if (now - agg.windowStart >= UNBOUND_WINDOW_MS) agg = {windowStart: now, count: 0, nudged: false}; + agg.count += 1; + let line = ''; + if (agg.count >= UNBOUND_NUDGE_THRESHOLD && !agg.nudged) { + agg.nudged = true; + line = + `cladding: ${agg.count} recent source edits aren't tracked by any feature — ` + + "start a feature for this work (or add these files to one you've already started) so the spec-first cycle covers them."; + } + writeUnboundAgg(cwd, agg); + return line; + } catch { + return ''; + } +} + /** Records one impact_card_fired + closes the aggregate window. `tier` is optional so the * shipped fallback path (AC-38141a9e) emits the byte-identical pre-tier payload. */ function recordFiredEvent(cwd: string, payload: Record): void { @@ -738,12 +810,15 @@ function emitCardForPath(cwd: string, sessionId: string, rel: string, lane?: 'ba const slice = buildImpactSlice(spec, rel); if ('not_found' in slice) { recordImpactSkip(cwd, 'owner_miss'); - return ''; + return lane ? '' : unboundEditNudge(cwd); } const card = formatImpactCard(slice, rel); - if (card) recordImpactFired(cwd, rel, slice, lane); - else recordImpactSkip(cwd, 'owner_miss'); // found slice but no primary owner → no output - return card; + if (card) { + recordImpactFired(cwd, rel, slice, lane); + return card; + } + recordImpactSkip(cwd, 'owner_miss'); // found slice but no primary owner → no output + return lane ? '' : unboundEditNudge(cwd); } catch { recordImpactSkip(cwd, 'spec_unreadable'); // spec unreadable → no card return ''; diff --git a/src/init/git-hook.ts b/src/init/git-hook.ts index c6d2f02..8925683 100644 --- a/src/init/git-hook.ts +++ b/src/init/git-hook.ts @@ -23,6 +23,23 @@ import {join} from 'node:path'; /** Marker prefix identifying a hook as cladding-authored (for idempotency). */ const HOOK_MARKER_PREFIX = 'cladding '; +/** + * True when a cladding-owned pre-commit or pre-push hook is installed (its marker + * line present). Used by the enforcement advisory (F-f4e184f7) to tell whether + * local git enforcement is wired, without installing or modifying anything. + */ +export function enforcingHookInstalled(cwd: string): boolean { + for (const kind of ['pre-commit', 'pre-push'] as const) { + try { + const body = readFileSync(join(cwd, '.git', 'hooks', kind), 'utf8'); + if (body.includes(`${HOOK_MARKER_PREFIX}${kind} hook`)) return true; + } catch { + /* hook file missing/unreadable → not installed for this kind */ + } + } + return false; +} + export type HookKind = 'pre-commit' | 'pre-push'; /** Per-kind gate invocation. pre-push carries --strict: it is the local diff --git a/src/stages/detectors/convention-drift.ts b/src/stages/detectors/convention-drift.ts index 177ded8..4862986 100644 --- a/src/stages/detectors/convention-drift.ts +++ b/src/stages/detectors/convention-drift.ts @@ -5,8 +5,8 @@ // behind the `reviewer` agent in v0.2. This brick ships the // deterministic v0.1 floor: // -// For every features[].modules[] file ending in `.ts`, verify the -// first non-empty line begins a comment (line or block). The intent +// For every feature module in the project's configured language, verify the +// first non-empty line begins a language-appropriate comment or docstring. The intent // is the "Documentation: Why > What" guardrail from // ironclad-design/13-philosophical-guardrails.md — code without a // header comment is the cheapest, highest-signal style violation @@ -24,7 +24,13 @@ const NAME = 'CONVENTION_DRIFT'; function startsWithComment(content: string): boolean { const trimmed = content.trimStart(); - return trimmed.startsWith('//') || trimmed.startsWith('/*'); + return ( + trimmed.startsWith('//') || + trimmed.startsWith('/*') || + trimmed.startsWith('#') || + trimmed.startsWith('"""') || + trimmed.startsWith("'''") + ); } function runConventionDrift(opts: CommandStageOptions): readonly DriftFinding[] { diff --git a/src/stages/finding-parser.ts b/src/stages/finding-parser.ts index 62ac63a..dac6e00 100644 --- a/src/stages/finding-parser.ts +++ b/src/stages/finding-parser.ts @@ -248,6 +248,30 @@ const KIND_DETECTOR: Record<'type' | 'lint' | 'unit', string> = { unit: 'UNIT', }; +// Check-only formatters (dart format --set-exit-if-changed, and peers) print one +// `Changed ` line per dirty file plus a summary. None match the ESLint +// stylish regex, so the raw-tail fallback used to collapse the whole set to a +// single pathless finding (whack-a-mole: fix one, re-run, the next appears). This +// lifts each listed file to its own LINT finding so every dirty file surfaces at +// once (F-4643d99d AC-7b620bf4). +const CHANGED_FILE = /^Changed\s+(.+)$/; // dart format --output=none + +function parseFormatterFindings(text: string): DriftFinding[] { + const out: DriftFinding[] = []; + for (const line of text.split(/\r?\n/)) { + const m = CHANGED_FILE.exec(stripAnsi(line).trim()); + if (m && m[1]) { + out.push({ + detector: 'LINT', + severity: 'error', + path: m[1], + message: 'not formatting-clean — differs from the formatter output', + }); + } + } + return out; +} + /** * Routes a tool stage's captured output to its parser and applies the AC-20b69848 * synthetic raw-tail fallback: when the stage FAILED (exitCode ≠ 0) but no @@ -280,6 +304,9 @@ export function parseToolFindings( break; case 'lint': findings = parseEslintFindings(combined); + // Check-only formatters (dart/dotnet) list dirty files, not ESLint rows — + // parse them per-file before the single raw-tail fallback (AC-7b620bf4). + if (findings.length === 0) findings = parseFormatterFindings(combined); break; case 'unit': findings = parseVitestFindings(combined); diff --git a/src/stages/lint.ts b/src/stages/lint.ts index 9c51e23..5fa08b8 100644 --- a/src/stages/lint.ts +++ b/src/stages/lint.ts @@ -19,6 +19,17 @@ import {missingToolSkip, ranToolResult} from './util.js'; const STAGE = 'stage_1.2'; +/** + * Fix command for a recognised check-only formatter, else undefined. These tools + * verify formatting and exit non-zero on any diff but do not fix in place; the + * hint tells the user which one command makes the stage green (F-4643d99d). + */ +function formatterFixHint(cmd: string, args: readonly string[]): string | undefined { + if (cmd === 'dart' && args[0] === 'format') return 'dart format .'; + if (cmd === 'dotnet' && args.includes('format')) return 'dotnet format'; + return undefined; +} + /** * Runs the project's linter and returns an Ironclad-shaped stage result. * @@ -60,7 +71,14 @@ export function runLint(opts: CommandStageOptions = {}): StageResult { // any non-zero exit → blocking fail (1), never the tool's raw 2 (= skip). // ADDITIVE (F-b7873005): on failure, attach structured findings parsed from // the linter's own output — the raw stderr is preserved unchanged. - return withFindings('lint', ranToolResult(STAGE, proc), proc); + const result = withFindings('lint', ranToolResult(STAGE, proc), proc); + // ADDITIVE (F-4643d99d): on a failing check-only formatter, carry a one-line + // fix hint the renderer prints under the per-file findings. + if (!result.pass) { + const hint = formatterFixHint(cmd, args); + if (hint) return {...result, hint}; + } + return result; } // CLI entry — `tsx stages/lint.ts` or `npm run stage:lint`. diff --git a/src/stages/test-run-cache.ts b/src/stages/test-run-cache.ts index 7b0fa2b..bb149b6 100644 --- a/src/stages/test-run-cache.ts +++ b/src/stages/test-run-cache.ts @@ -1,11 +1,11 @@ // Cladding · stages · shared test-run cache — run-scoped, gate-seam-lifetimed // -// WHY (issue #215). One `clad check --tier=pre-push` runs the SAME vitest suite -// TWICE: stage_2.1 (unit) spawns `vitest run` and stage_2.2 (coverage) spawns -// `vitest run --coverage`. On cladding's own ~1600-test suite that is the single +// WHY (issue #215). One `clad check --tier=pre-push` can run the SAME suite +// TWICE: stage_2.1 (unit) spawns the test runner and stage_2.2 (coverage) spawns +// it again under coverage. On large Vitest and pytest suites that is the single // biggest chunk of gate wall-clock. This module lets the unit stage spawn the // COVERAGE command ONCE — augmented with the vacuous-test guard's dual json -// reporter — and publish that one process so the coverage stage folds the cached +// reporter when applicable — and publish that one process so the coverage stage folds the cached // exit signal instead of re-spawning vitest. // // GUARD-COMPATIBLE (the reason PR #216 was rejected). #216 deduped by having the diff --git a/src/stages/types.ts b/src/stages/types.ts index 00df594..2a6ad7d 100644 --- a/src/stages/types.ts +++ b/src/stages/types.ts @@ -55,6 +55,12 @@ export interface StageResult { * verdict reducer prefers the first path-bearing finding for `next_action`. */ readonly findings?: readonly DriftFinding[]; + /** + * NEW (F-4643d99d) — a one-line remediation hint the check renderer prints + * under a failing tool stage's findings (e.g. `dart format .`). Additive; + * absent on green stages and on stages with no known fix command. + */ + readonly hint?: string; } /** Shared options for any stage that wraps an external command. */ diff --git a/src/stages/unit.ts b/src/stages/unit.ts index 39a6007..192b188 100644 --- a/src/stages/unit.ts +++ b/src/stages/unit.ts @@ -41,6 +41,11 @@ function isVitestRunner(cmd: string, args: readonly string[]): boolean { return cmd === 'vitest' || cmd.endsWith('/vitest') || args.includes('vitest'); } +/** True when a command directly or indirectly invokes pytest. */ +function isPytestRunner(cmd: string, args: readonly string[]): boolean { + return [cmd, ...args].some((part) => part === 'pytest' || part.endsWith('/pytest')); +} + /** * Returns true only when a successful runner output definitively reports that * every aggregate test count was zero. Multiple summaries can occur in npm @@ -53,6 +58,9 @@ function reportsZeroExecutedTests(proc: {readonly stdout?: unknown; readonly std /^\s*#\s*tests\s+(\d+)\s*$/gim, /^\s*ℹ\s+tests\s+(\d+)\s*$/gim, /^\s*Tests:\s+.*?\b(\d+)\s+total\b.*$/gim, + // pytest / coverage.py: "collected 0 items" is the zero-executed signal a + // green exit can still carry (e.g. an over-narrow -k / testpaths selection). + /^\s*collected\s+(\d+)\s+items?\b.*$/gim, ]; for (const pattern of patterns) { for (const match of output.matchAll(pattern)) counts.push(Number(match[1])); @@ -120,6 +128,47 @@ function tryReuseSharedRun(opts: UnitStageOptions, cwd: string, guardOn: boolean return {stage: STAGE, pass: true, exitCode: 0}; } +/** + * Shares one coverage-instrumented pytest run across Unit and Coverage. + * + * Pytest has no Cladding per-test json reporter equivalent, so the reuse path is + * limited to a green coverage command that itself invokes pytest. A non-green run + * falls back to the tests-only command for sound failure attribution, while + * Coverage later reuses the cached failing result. Under --strict the shared run's + * own summary still feeds the zero-executed-tests guard (AC-f8e85a99), so the + * dedup can never turn a vacuous pytest run into a passing unit result — the same + * discipline AC-6b2d81f7 pins for the vitest reuse path. + */ +function tryReuseSharedPytestRun(opts: UnitStageOptions, cwd: string): StageResult | null { + const {strict = false} = opts; + let covCmd: string | undefined; + let covArgs: readonly string[] | undefined; + try { + ({cmd: covCmd, args: covArgs} = resolveStageCommand('coverage', opts)); + } catch { + return null; + } + if (!covCmd || !covArgs || !isPytestRunner(covCmd, covArgs)) return null; + const runCmd = covCmd; + const runArgs = covArgs; + const shared = getOrRunSharedCoverage(cwd, () => + execaSync(runCmd, [...runArgs], {cwd, reject: false}), + ); + if (!shared) return null; + if (missingToolSkip(STAGE, runCmd, shared.proc, runArgs)) return null; + const covResult = ranToolResult(STAGE, shared.proc); + if (unitActionFromCoverage(covResult) === 'fallback') return null; + if (strict && reportsZeroExecutedTests(shared.proc)) { + const finding = { + detector: 'VACUOUS_TESTS', + severity: 'error' as const, + message: 'The unit test command exited successfully but reported zero executed tests.', + }; + return {stage: STAGE, pass: false, exitCode: 1, findings: [finding], stderr: finding.message}; + } + return {stage: STAGE, pass: true, exitCode: 0}; +} + /** * Runs the project's unit-test suite and returns an Ironclad-shaped result. * @@ -156,6 +205,7 @@ export function runUnit(opts: UnitStageOptions = {}): StageResult { // Guard applies only under --strict on a vitest runner (the only path we can // capture per-file json for). Otherwise the invocation is unchanged. const testIsVitest = isVitestRunner(cmd, args); + const testIsPytest = isPytestRunner(cmd, args); const guardOn = strict && testIsVitest; // Dedup fast path (F-49f6f2d2): on a primed vitest gate, reuse the ONE shared // coverage+dual-json run stage_2.2 also folds, so the suite runs once (#215). @@ -165,6 +215,10 @@ export function runUnit(opts: UnitStageOptions = {}): StageResult { const reused = tryReuseSharedRun(opts, cwd, guardOn); if (reused) return reused; } + if (isTestRunPrimed() && testIsPytest) { + const reused = tryReuseSharedPytestRun(opts, cwd); + if (reused) return reused; + } let jsonFile: string | undefined; let runArgs: readonly string[] = args; if (guardOn) { diff --git a/tests/cli/enforcement-advisory.test.ts b/tests/cli/enforcement-advisory.test.ts new file mode 100644 index 0000000..9621454 --- /dev/null +++ b/tests/cli/enforcement-advisory.test.ts @@ -0,0 +1,102 @@ +// Cladding · F-f4e184f7 — enforcement advisory for the feature cycle. +// +// enforcementAdvisory(cwd) returns one non-blocking line when a project has +// features not yet done but neither a cladding hook nor CI enforces the checks — +// and undefined when any suppressor holds. It is derived from cwd alone (never a +// gate result), so it can only inform. + +import {mkdirSync, mkdtempSync, rmSync, writeFileSync} from 'node:fs'; +import {tmpdir} from 'node:os'; +import {join} from 'node:path'; + +import {afterEach, beforeEach, describe, expect, test} from 'vitest'; + +import {enforcementAdvisory} from '../../src/cli/enforcement-advisory.js'; + +const spec = (status: string): string => + [ + 'schema: "0.1"', + 'project: {name: t, language: typescript}', + 'features:', + ' - id: F-aaa111', + ' slug: alpha', + ' title: alpha', + ` status: ${status}`, + ' modules: [src/foo.ts]', + ' acceptance_criteria:', + ' - id: AC-001', + ' ears: ubiquitous', + ' text: t', + '', + ].join('\n'); + +let cwd: string; +beforeEach(() => { + cwd = mkdtempSync(join(tmpdir(), 'clad-enf-adv-')); +}); +afterEach(() => rmSync(cwd, {recursive: true, force: true})); + +function writeSpec(status: string): void { + writeFileSync(join(cwd, 'spec.yaml'), spec(status), 'utf8'); +} +function installHook(kind: 'pre-commit' | 'pre-push'): void { + mkdirSync(join(cwd, '.git', 'hooks'), {recursive: true}); + writeFileSync(join(cwd, '.git', 'hooks', kind), `#!/bin/sh\n# cladding ${kind} hook — installed by clad init\nexit 0\n`); +} +function addCiWorkflow(): void { + mkdirSync(join(cwd, '.github', 'workflows'), {recursive: true}); + writeFileSync(join(cwd, '.github', 'workflows', 'ci.yml'), 'name: ci\n'); +} + +describe('F-f4e184f7 — enforcement advisory', () => { + test('AC-4566fd98 — undone features + no hook + no CI → an advisory naming the count', () => { + writeSpec('in_progress'); + const out = enforcementAdvisory(cwd); + expect(out).toBeTypeOf('string'); + expect(out).toContain('1 feature'); + expect(out).toContain('nothing enforces the checks'); + }); + + test('planned (spec-first) features also count as not-yet-done', () => { + writeSpec('planned'); + expect(enforcementAdvisory(cwd)).toContain('not yet done'); + }); + + describe('AC-2fd01eaa — any one suppressor silences it', () => { + test('an installed pre-push hook suppresses it', () => { + writeSpec('in_progress'); + installHook('pre-push'); + expect(enforcementAdvisory(cwd)).toBeUndefined(); + }); + + test('an installed pre-commit hook suppresses it', () => { + writeSpec('in_progress'); + installHook('pre-commit'); + expect(enforcementAdvisory(cwd)).toBeUndefined(); + }); + + test('a CI workflow directory suppresses it', () => { + writeSpec('in_progress'); + addCiWorkflow(); + expect(enforcementAdvisory(cwd)).toBeUndefined(); + }); + + test('no undone features → no advisory', () => { + writeSpec('done'); + expect(enforcementAdvisory(cwd)).toBeUndefined(); + }); + + test('a missing/invalid spec → no advisory (not this check to speak)', () => { + expect(enforcementAdvisory(cwd)).toBeUndefined(); // no spec.yaml written + writeFileSync(join(cwd, 'spec.yaml'), 'not: a valid spec\n'); + expect(enforcementAdvisory(cwd)).toBeUndefined(); + }); + }); + + test('AC-be0cbdaa — a foreign (non-cladding) hook does NOT suppress it', () => { + writeSpec('in_progress'); + mkdirSync(join(cwd, '.git', 'hooks'), {recursive: true}); + writeFileSync(join(cwd, '.git', 'hooks', 'pre-push'), '#!/bin/sh\n# someone elses hook\nexit 0\n'); + expect(enforcementAdvisory(cwd)).toContain('not yet done'); + }); +}); diff --git a/tests/cli/hook-telemetry.test.ts b/tests/cli/hook-telemetry.test.ts index 3cd93e8..ae7ed2b 100644 --- a/tests/cli/hook-telemetry.test.ts +++ b/tests/cli/hook-telemetry.test.ts @@ -85,6 +85,12 @@ function clearStamp(): void { function clearPushLedger(): void { rmSync(join(cwd, '.cladding', 'hook-push-ledger.json'), {force: true}); } +// F-f9891175: owner_miss edits also feed the unbound-edit nudge accumulator. This +// corpus isolates the skip-event accounting, so reset that sidecar per iteration +// (the nudge's own once-per-window behavior is covered in hook-unbound-nudge.test.ts). +function clearUnboundAgg(): void { + rmSync(join(cwd, '.cladding', 'hook-unbound-agg.json'), {force: true}); +} function freshStamp(): void { mkdirSync(join(cwd, '.cladding'), {recursive: true}); writeFileSync(stamp(), String(Date.now()), 'utf8'); @@ -145,6 +151,7 @@ describe('PostToolUse telemetry — accounting completeness', () => { // 4) owner_miss — a watched source path owned by no feature for (let i = 0; i < N.owner_miss; i++) { clearStamp(); + clearUnboundAgg(); // isolate skip accounting from the unbound-edit nudge (F-f9891175) expect(post(sourceEdit('src/orphan.ts', 60))).toBe(''); } // 5) fired — an owned module, substantive edit; the FIRST fired flushes the diff --git a/tests/cli/hook-unbound-nudge.test.ts b/tests/cli/hook-unbound-nudge.test.ts new file mode 100644 index 0000000..5729579 --- /dev/null +++ b/tests/cli/hook-unbound-nudge.test.ts @@ -0,0 +1,136 @@ +// Cladding · F-f9891175 — PostToolUse nudge when sustained source edits are +// bound to no feature. +// +// Drives runHookEvent as a FUNCTION (no host, no subprocess). drift/arch/secret +// are stubbed so PostToolUse never spawns a toolchain; the impact-slice path runs +// for real against a throwaway fixture. An edit to a path in no feature's modules +// is an owner_miss; once such edits reach the threshold in a window, the card +// carries one non-blocking nudge. +// +// Covers: +// AC-8542cc63 the nudge fires once the unbound-edit count crosses the threshold +// AC-388518f4 no nudge for a Read, a bound edit, or a sub-threshold count +// AC-5d379d4e once per window — a further unbound edit does not repeat it +// AC-228fdc15 never blocks; a sidecar failure leaves stdout byte-identical + +import {mkdtempSync, rmSync, writeFileSync} from 'node:fs'; +import {tmpdir} from 'node:os'; +import {join} from 'node:path'; + +import {afterEach, beforeEach, describe, expect, test, vi} from 'vitest'; + +type StageResult = {pass: boolean; exitCode: number; stderr?: string}; +type DriftFinding = {detector: string; severity: 'error' | 'warn' | 'info'; path?: string; message: string}; +type DriftReport = StageResult & {findings: DriftFinding[]}; + +const DRIFT_CLEAN: DriftReport = {pass: true, exitCode: 0, findings: []}; +const driftStub = vi.fn((): DriftReport => DRIFT_CLEAN); +const archStub = vi.fn((): StageResult => ({pass: true, exitCode: 0})); +const secretStub = vi.fn((): StageResult => ({pass: true, exitCode: 0})); + +vi.mock('../../src/stages/drift.js', () => ({runDrift: (...a: unknown[]) => driftStub(...(a as []))})); +vi.mock('../../src/stages/arch.js', () => ({runArch: (...a: unknown[]) => archStub(...(a as []))})); +vi.mock('../../src/stages/secret.js', () => ({runSecret: (...a: unknown[]) => secretStub(...(a as []))})); + +const {runHookEvent} = await import('../../src/cli/hook.js'); + +// F-aaa111 owns src/foo.ts; any OTHER src path (e.g. src/orphan.ts) is unbound. +const VALID_SPEC = [ + 'schema: "0.1"', + 'project: {name: t, language: typescript}', + 'features:', + ' - id: F-aaa111', + ' slug: alpha', + ' title: alpha', + ' status: done', + ' modules: [src/foo.ts]', + ' acceptance_criteria:', + ' - id: AC-001', + ' ears: ubiquitous', + ' text: t', + ' test_refs: [tests/foo.test.ts]', + '', +].join('\n'); + +const NUDGE = "recent source edits aren't tracked by any feature"; +const LONG = 'x'.repeat(60); // > MIN_EDIT_CHARS so the edit is not a trivial skip + +let cwd: string; + +function clearStamp(): void { + rmSync(join(cwd, '.cladding', 'hook-drift-ts'), {force: true}); +} +function post(input: unknown): string { + return runHookEvent('PostToolUse', input, cwd); +} +/** An Edit to an UNBOUND path, debounce cleared so it is not rate-limited. */ +function editUnbound(path = 'src/orphan.ts'): string { + clearStamp(); + return post({tool_name: 'Edit', tool_input: {file_path: path, old_string: '', new_string: LONG}}); +} + +beforeEach(() => { + cwd = mkdtempSync(join(tmpdir(), 'clad-vt-nudge-')); + writeFileSync(join(cwd, 'spec.yaml'), VALID_SPEC, 'utf8'); + driftStub.mockImplementation(() => DRIFT_CLEAN); +}); +afterEach(() => { + rmSync(cwd, {recursive: true, force: true}); + vi.clearAllMocks(); +}); + +describe('AC-8542cc63 — the nudge fires once unbound edits cross the threshold', () => { + test('third unbound edit carries the nudge; the first two are silent', () => { + expect(editUnbound()).not.toContain(NUDGE); // 1 + expect(editUnbound()).not.toContain(NUDGE); // 2 + const third = editUnbound(); // 3 → threshold + expect(third).toContain(NUDGE); + expect(third).toContain('3 recent source edits'); + expect(third).toContain('start a feature for this work'); + }); +}); + +describe('AC-388518f4 — no false nudge', () => { + test('a Read never nudges', () => { + for (let i = 0; i < 5; i++) { + clearStamp(); + expect(post({tool_name: 'Read', tool_input: {file_path: 'src/orphan.ts'}})).not.toContain(NUDGE); + } + }); + + test('edits to a BOUND file never nudge (they resolve to an owner)', () => { + for (let i = 0; i < 5; i++) { + clearStamp(); + const out = post({tool_name: 'Edit', tool_input: {file_path: 'src/foo.ts', old_string: '', new_string: LONG}}); + expect(out).not.toContain(NUDGE); + } + }); + + test('a single unbound edit (sub-threshold) is silent', () => { + expect(editUnbound()).not.toContain(NUDGE); + }); +}); + +describe('AC-5d379d4e — once per window', () => { + test('a further unbound edit after the nudge does not repeat it', () => { + editUnbound(); + editUnbound(); + expect(editUnbound()).toContain(NUDGE); // fires on the 3rd + expect(editUnbound()).not.toContain(NUDGE); // 4th — suppressed this window + expect(editUnbound()).not.toContain(NUDGE); // 5th — still suppressed + }); +}); + +describe('AC-228fdc15 — never blocks; byte-identical on sidecar failure', () => { + test('a sabotaged .cladding leaves the nudge silent (no throw, no block)', () => { + // Make .cladding a FILE so every sidecar read/write throws. + rmSync(join(cwd, '.cladding'), {recursive: true, force: true}); + writeFileSync(join(cwd, '.cladding'), 'x', 'utf8'); + let out = ''; + expect(() => { + out = post({tool_name: 'Edit', tool_input: {file_path: 'src/orphan.ts', old_string: '', new_string: LONG}}); + }).not.toThrow(); + // Without a persistable counter the nudge can never accumulate → byte-identical '' (no block). + expect(out).toBe(''); + }); +}); diff --git a/tests/stages/convention-drift.test.ts b/tests/stages/convention-drift.test.ts index 5d50be0..9cf214f 100644 --- a/tests/stages/convention-drift.test.ts +++ b/tests/stages/convention-drift.test.ts @@ -2,8 +2,8 @@ // // Detector under test enforces the "Documentation: Why > What" guardrail // from ironclad-design/13-philosophical-guardrails.md. For every -// features[].modules[] file ending in `.ts`, the first non-empty line -// must begin a comment (line `//` or block `/*`). Missing header → warn. +// features[].modules[] source file for the configured language, the first non-empty line +// must begin a language-appropriate comment or Python docstring. Missing header → warn. // // The detector intentionally: // - skips non-`.ts` modules (yaml, json, md are out of scope) @@ -62,6 +62,40 @@ describe('CONVENTION_DRIFT detector', () => { expect(conventionDrift.run({cwd: dir})).toEqual([]); }); + test.each([ + ['hash comment', '# Why this exists: intent stated up front.\nVALUE = 1\n'], + ['double-quoted module docstring', '"""Why this module exists."""\nVALUE = 1\n'], + ['single-quoted module docstring', "'''Why this module exists.'''\nVALUE = 1\n"], + ])('Python module with a leading %s → no finding', (_label, source) => { + writeFileSync( + join(dir, 'spec.yaml'), + 'schema: "0.1"\nproject: {name: x, language: python}\nfeatures: []\n', + ); + mkdirSync(join(dir, 'backend'), {recursive: true}); + writeFileSync(join(dir, 'backend', 'good.py'), source); + writeFileSync( + join(dir, 'spec', 'features', 'F-001.yaml'), + 'id: F-001\ntitle: t\nstatus: done\nmodules: [backend/good.py]\n', + ); + expect(conventionDrift.run({cwd: dir})).toEqual([]); + }); + + test('Python module without a header comment or docstring → warn finding', () => { + writeFileSync( + join(dir, 'spec.yaml'), + 'schema: "0.1"\nproject: {name: x, language: python}\nfeatures: []\n', + ); + mkdirSync(join(dir, 'backend'), {recursive: true}); + writeFileSync(join(dir, 'backend', 'bare.py'), 'VALUE = 1\n'); + writeFileSync( + join(dir, 'spec', 'features', 'F-001.yaml'), + 'id: F-001\ntitle: t\nstatus: done\nmodules: [backend/bare.py]\n', + ); + const findings = conventionDrift.run({cwd: dir}); + expect(findings).toHaveLength(1); + expect(findings[0].path).toBe('backend/bare.py'); + }); + test('TS module without any header comment → warn finding', () => { writeFileSync(join(dir, 'stages', 'bare.ts'), 'export const x = 1;\n'); writeFileSync( diff --git a/tests/stages/lint-multi-finding.test.ts b/tests/stages/lint-multi-finding.test.ts new file mode 100644 index 0000000..3646b5c --- /dev/null +++ b/tests/stages/lint-multi-finding.test.ts @@ -0,0 +1,76 @@ +// Cladding · F-4643d99d — check-only formatter lint findings. +// +// A check-only formatter (dart format --set-exit-if-changed, dotnet format +// --verify-no-changes) prints one `Changed ` line per dirty file. Those +// don't match the ESLint stylish regex, so the raw-tail fallback used to collapse +// the whole set to a single pathless finding (whack-a-mole). This proves every +// dirty file now surfaces with its path, plus a one-line fix hint. + +import {mkdtempSync, rmSync, writeFileSync} from 'node:fs'; +import {tmpdir} from 'node:os'; +import {join} from 'node:path'; + +import {afterEach, beforeEach, describe, expect, test, vi} from 'vitest'; + +import {parseToolFindings} from '../../src/stages/finding-parser.js'; + +vi.mock('execa', () => ({execaSync: vi.fn()})); +const {runLint} = await import('../../src/stages/lint.js'); +const execaMod = await import('execa'); +const execaSyncMock = execaMod.execaSync as unknown as ReturnType; + +describe('F-4643d99d — check-only formatter lint findings', () => { + test('AC-7b620bf4 — dart `Changed ` lines → one finding per file, each with a path', () => { + const out = [ + 'Changed lib/a.dart', + 'Changed lib/nested/b.dart', + 'Changed test/c_test.dart', + 'Formatted 12 files (3 changed) in 0.40 seconds.', + ].join('\n'); + const findings = parseToolFindings('lint', out, '', 1); + expect(findings).toHaveLength(3); + expect(findings.map((f) => f.path)).toEqual(['lib/a.dart', 'lib/nested/b.dart', 'test/c_test.dart']); + expect(findings.every((f) => f.detector === 'LINT' && f.severity === 'error')).toBe(true); + }); + + test('AC-83a47b38 — an unstructured formatter failure keeps ONE raw-tail synthetic finding', () => { + const findings = parseToolFindings('lint', 'panic: could not run formatter\n at main', '', 1); + expect(findings).toHaveLength(1); + expect(findings[0].detector).toBe('LINT'); + expect(findings[0].path).toBeUndefined(); + expect(findings[0].message).toContain('panic'); + }); + + test('a green stage (exit 0) yields no findings', () => { + expect(parseToolFindings('lint', 'Formatted 5 files (0 changed).', '', 0)).toEqual([]); + }); + + describe('AC-6c16b63e — fix hint on a failing check-only formatter (lint stage)', () => { + let dir: string; + beforeEach(() => { + dir = mkdtempSync(join(tmpdir(), 'clad-lint-mf-')); + writeFileSync(join(dir, 'pubspec.yaml'), 'name: x\nversion: 0.0.0\n'); // plain dart → `dart format` + execaSyncMock.mockReset(); + }); + afterEach(() => rmSync(dir, {recursive: true, force: true})); + + test('dart format failure → hint `dart format .` and every dirty file listed', () => { + execaSyncMock.mockReturnValue({ + exitCode: 1, + stdout: 'Changed lib/a.dart\nChanged lib/b.dart\nFormatted 5 files (2 changed).', + stderr: '', + }); + const r = runLint({cwd: dir}); + expect(r.pass).toBe(false); + expect(r.hint).toBe('dart format .'); + expect(r.findings?.map((f) => f.path)).toEqual(['lib/a.dart', 'lib/b.dart']); + }); + + test('a green dart run → no hint, no findings', () => { + execaSyncMock.mockReturnValue({exitCode: 0, stdout: 'Formatted 5 files (0 changed).', stderr: ''}); + const r = runLint({cwd: dir}); + expect(r.pass).toBe(true); + expect(r.hint).toBeUndefined(); + }); + }); +}); diff --git a/tests/stages/test-run-dedup.test.ts b/tests/stages/test-run-dedup.test.ts index a228fbd..52bbefc 100644 --- a/tests/stages/test-run-dedup.test.ts +++ b/tests/stages/test-run-dedup.test.ts @@ -51,6 +51,13 @@ function vitestProject(prefix: string): string { return dir; } +/** A temp dir that resolves to the Python pytest + coverage.py toolchain. */ +function pytestProject(prefix: string): string { + const dir = mkdtempSync(join(tmpdir(), prefix)); + writeFileSync(join(dir, 'pyproject.toml'), '[project]\nname = "x"\nversion = "0.0.0"\n'); + return dir; +} + const CLEAN = {exitCode: 0, stdout: '', stderr: ''}; /** vitest `--reporter=json` document shape (mirrors vacuous-tests.test.ts). */ @@ -289,6 +296,43 @@ describe('AC-9a1c4e21 / AC-3f7e0c94 — primed vitest gate: the suite runs ONCE }); }); +describe('primed pytest gate: Unit and Coverage share one coverage-instrumented run', () => { + let dir: string; + beforeEach(() => { + dir = pytestProject('clad-trd-pytest-'); + primeTestRunCache(dir); + }); + afterEach(() => rmSync(dir, {recursive: true, force: true})); + + test('runUnit then runCov spawn pytest exactly once through coverage.py', () => { + execaSyncMock.mockReturnValueOnce(CLEAN); + const unitResult = runUnit({cwd: dir, strict: true}); + const covResult = runCov({cwd: dir}); + + expect(unitResult.pass).toBe(true); + expect(covResult.pass).toBe(true); + expect(execaSyncMock).toHaveBeenCalledTimes(1); + const [cmd, args] = execaSyncMock.mock.calls[0] as [string, string[]]; + expect(cmd).toBe('coverage'); + expect(args).toEqual(['run', '-m', 'pytest']); + }); + + test('AC-f8e85a99 — a green shared run that collected ZERO tests blocks under --strict (guard not bypassed)', () => { + // coverage.py exits 0 but pytest collected nothing (e.g. an over-narrow selection). + execaSyncMock.mockReturnValueOnce({ + exitCode: 0, + stdout: 'collected 0 items\n\nno tests ran in 0.01s\n', + stderr: '', + }); + const unitResult = runUnit({cwd: dir, strict: true}); + + expect(unitResult.pass).toBe(false); + expect(unitResult.findings?.[0]?.detector).toBe('VACUOUS_TESTS'); + // still one spawn — the guard reads the shared run's own summary, no re-run. + expect(execaSyncMock).toHaveBeenCalledTimes(1); + }); +}); + // ─── AC-8c5a2fb0 (stage level) — a non-green shared run falls back, sound attribution ─── describe('AC-8c5a2fb0 — non-green shared run: unit falls back to its own tests-only run', () => { From 659bc0e7a1255e3a4ea060563118c9a84dc55e95 Mon Sep 17 00:00:00 2001 From: qwerfunch Date: Mon, 20 Jul 2026 22:58:00 +0900 Subject: [PATCH 3/6] fix(soft-shell): close user-facing jargon leaks + tighten the enforcement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The plain-language audit found the Soft Shell discipline (plain, host- relayable user output; internal terms only in the Iron Core) is real and tested, but the two enforcing tests had blind spots — they scanned only DETECTOR_PLAIN `action` (not `lead`) and banned MCP names + "shard" but not raw detector-name / stage-id leads. Several leaks slipped through. Closed (user-facing only; code comments, field names, and the structured Tier-A provenance banner stay Iron Core by design): - softShell.ts: INVENTORY_DRIFT lead said "shard files" → "spec files". - clad.ts: the `clad check` footer said "spec shards" / "the offending detector"; the `clad sync` note leaked a raw `stage_2.4`. - done.ts: the git-op and no-feature refusals said "shard". - hook.ts: the SessionStart stop-block line led with a raw detector name (AC_DRIFT) — now rendered via plainLead. - init.ts: the scenarios README prose named `clad_create_feature`. Tightened so it can't recur: - plain-render.test.ts now scans each `lead` for "shard" and MCP names. - human-first-cards.test.ts asserts the seeded stop-block detector is rendered as its plain lead, never the raw id. Per-language: the behavior-triggered signals (unbound nudge, enforcement advisory) fire from one English source regardless of the user's language (proven with a Korean-titled spec + Korean-named path; slugs stay ASCII machine ids by schema, human titles/paths are any language). Three host- relay checks (ko/ja/zh) confirmed the emitted English relays cleanly with no jargon leak. New feature F-ebbb20af, authored spec-first; strict pre-push gate GREEN — 2593 tests, 41 detectors, 259 features (256 done). AB report metrics refreshed for the shorter scenarios README. Co-Authored-By: Claude Opus 4.8 --- README.html | 8 +- README.ja.md | 4 +- README.ko.html | 8 +- README.ko.md | 4 +- README.md | 4 +- README.zh.md | 4 +- docs/ab-evaluation/case-existing-adoption.md | 10 +- docs/ab-evaluation/case-payment-saas.md | 10 +- plugins/claude-code/dist/clad.js | 256 +++++++++--------- spec.yaml | 4 +- spec/attestation.yaml | 29 +- .../soft-shell-leak-closure-ebbb20af.yaml | 50 ++++ spec/index.yaml | 1 + src/cli/clad.ts | 4 +- src/cli/done.ts | 4 +- src/cli/hook.ts | 4 +- src/cli/init.ts | 10 +- src/ui/softShell.ts | 2 +- tests/cli/done.test.ts | 6 +- tests/cli/hook.test.ts | 2 +- tests/human-first-cards.test.ts | 3 + tests/plain-render.test.ts | 14 + tests/soft-shell-leak-closure.test.ts | 106 ++++++++ 23 files changed, 361 insertions(+), 186 deletions(-) create mode 100644 spec/features/soft-shell-leak-closure-ebbb20af.yaml create mode 100644 tests/soft-shell-leak-closure.test.ts diff --git a/README.html b/README.html index 0b5e4e4..6d96be0 100644 --- a/README.html +++ b/README.html @@ -233,7 +233,7 @@

cladding

ironclad spec - tests + tests detectors license

@@ -548,7 +548,7 @@

Status

tests
-
2586/2586
+
2593/2593
all pass
@@ -558,8 +558,8 @@

Status

features
-
258
-
255 done · self-spec
+
259
+
256 done · self-spec
diff --git a/README.ja.md b/README.ja.md index 9982ac7..a09ad19 100644 --- a/README.ja.md +++ b/README.ja.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -339,7 +339,7 @@ clad update # 3. プロジェクト接続と派生状態を更新 | Version | 準拠レベル | Tests | Gate | Features | |---|---|---|---|---| -| v0.9.0(2026-07) | L4 · [自己申告](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2586 / 2586 | 15 段階 · 41 detectors | 258(255 done) | +| v0.9.0(2026-07) | L4 · [自己申告](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2593 / 2593 | 15 段階 · 41 detectors | 259(256 done) | 236 test files · capability 6 個 · カバレッジ低下は COVERAGE_DROP detector がブロック diff --git a/README.ko.html b/README.ko.html index 669f7b0..70669f3 100644 --- a/README.ko.html +++ b/README.ko.html @@ -275,7 +275,7 @@

cladding

ironclad spec - tests + tests detectors license

@@ -584,7 +584,7 @@

Status

tests
-
2586/2586
+
2593/2593
all pass
@@ -594,8 +594,8 @@

Status

features
-
258
-
255 done · 자기 스펙
+
259
+
256 done · 자기 스펙
diff --git a/README.ko.md b/README.ko.md index 6df6114..adb9e99 100644 --- a/README.ko.md +++ b/README.ko.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -338,7 +338,7 @@ clad update # 3. 프로젝트 연결과 파생 데이터를 함께 | version | 준수 등급 | tests | gate | features | |---|---|---|---|---| -| v0.9.0 · 2026-07 | L4 · [L0–L4 중 최고 · 자가 선언](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2586 / 2586 · all pass | 15 단계 · 41 detectors | 258 · 255 done · 자기 스펙 | +| v0.9.0 · 2026-07 | L4 · [L0–L4 중 최고 · 자가 선언](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2593 / 2593 · all pass | 15 단계 · 41 detectors | 259 · 256 done · 자기 스펙 | 236 test files · capability 6개 · coverage는 COVERAGE_DROP detector가 하락 차단 diff --git a/README.md b/README.md index f164936..cc30760 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -352,7 +352,7 @@ Reconcile the drift the update flagged. | Version | Conformance | Tests | Gate | Features | |---|---|---|---|---| -| v0.9.0 (2026-07) | L4 · [self-declared](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2586 / 2586 | 15 stages · 41 detectors | 258 (255 done) | +| v0.9.0 (2026-07) | L4 · [self-declared](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2593 / 2593 | 15 stages · 41 detectors | 259 (256 done) | 236 test files · 6 capabilities · coverage drop blocked by the COVERAGE_DROP detector diff --git a/README.zh.md b/README.zh.md index dff870e..efe9b31 100644 --- a/README.zh.md +++ b/README.zh.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -335,7 +335,7 @@ clad update # 3. 刷新项目连接和派生状态 | 版本 | 一致性 | Tests | Gate | Features | |---|---|---|---|---| -| v0.9.0(2026-07) | L4 · [自我声明](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2586 / 2586 | 15 阶段 · 41 检测器 | 258(255 done) | +| v0.9.0(2026-07) | L4 · [自我声明](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2593 / 2593 | 15 阶段 · 41 检测器 | 259(256 done) | 236 个测试文件 · 6 项 capability · 覆盖率下降由 COVERAGE_DROP 检测器拦下 diff --git a/docs/ab-evaluation/case-existing-adoption.md b/docs/ab-evaluation/case-existing-adoption.md index 536de8a..918a367 100644 --- a/docs/ab-evaluation/case-existing-adoption.md +++ b/docs/ab-evaluation/case-existing-adoption.md @@ -51,8 +51,8 @@ No spec, no architecture invariants — just code on the existing tree. | Test files | 1 | 1 | +0 | | Test LoC | 14 | 14 | +0 | | Test cases | 1 | 1 | +0 | -| Total chars (artifacts + code) | 11212 | 3864 | +7348 | -| Estimated tokens | 2805 | 967 | +1838 | +| Total chars (artifacts + code) | 11160 | 3864 | +7296 | +| Estimated tokens | 2792 | 967 | +1825 | **Detector outcomes** (META_INTEGRITY + HARDCODED_SECRET excluded — toolchain-only checks): @@ -90,8 +90,8 @@ B (Vanilla) — errors: 1 warns: 3 infos: 28 | Test files | 2 | 2 | +0 | | Test LoC | 27 | 27 | +0 | | Test cases | 3 | 3 | +0 | -| Total chars (artifacts + code) | 12732 | 5115 | +7617 | -| Estimated tokens | 3185 | 1280 | +1905 | +| Total chars (artifacts + code) | 12703 | 5115 | +7588 | +| Estimated tokens | 3178 | 1280 | +1898 | **Detector outcomes** (META_INTEGRITY + HARDCODED_SECRET excluded — toolchain-only checks): @@ -111,7 +111,7 @@ B (Vanilla) — errors: 1 warns: 3 infos: 28 - **Spec ↔ code traceability**: cladding emits 1 feature(s), 2 AC(s), 1 scenario(s), 3 capability(s); vanilla has 0 of each. - **Architecture enforcement**: cladding declares 3 layer(s) with 0 forbidden-import rule(s); vanilla has 0. - **Detector behavior**: cladding-managed tree → 1 error(s) / 1 warn(s) / 11 info(s). Vanilla tree → 1 / 3 / 28. The detectors that gate against spec (REFERENCE_INTEGRITY, MISSING_IMPLEMENTATION, ARCHITECTURE_FROM_SPEC, CAPABILITIES_FEATURE_MAPPING) need cladding's artifacts to evaluate — without them they silently pass. The "0 errors on vanilla" therefore is **absence of signal**, not absence of drift. -- **Token cost**: cladding's cumulative artifact + code consumes ~3185 tokens vs vanilla's ~1280 (heuristic chars/4) — Δ ≈ 1905 tokens, the price of structure. +- **Token cost**: cladding's cumulative artifact + code consumes ~3178 tokens vs vanilla's ~1280 (heuristic chars/4) — Δ ≈ 1898 tokens, the price of structure. - **Code surface**: vanilla writes 9 source file(s) / 144 LoC + 2 test file(s) / 3 test case(s); cladding writes 9 / 128 + 2 / 3. (Vanilla front-loads code, cladding front-loads spec — both converge by M2.) ## Outcome Quality (F-ba2e05) diff --git a/docs/ab-evaluation/case-payment-saas.md b/docs/ab-evaluation/case-payment-saas.md index 549a169..6c64f93 100644 --- a/docs/ab-evaluation/case-payment-saas.md +++ b/docs/ab-evaluation/case-payment-saas.md @@ -50,8 +50,8 @@ no spec, no scenarios, no architecture invariants. | Test files | 0 | 1 | -1 | | Test LoC | 0 | 20 | -20 | | Test cases | 0 | 2 | -2 | -| Total chars (artifacts + code) | 6708 | 3463 | +3245 | -| Estimated tokens | 1679 | 867 | +812 | +| Total chars (artifacts + code) | 6600 | 3463 | +3137 | +| Estimated tokens | 1652 | 867 | +785 | **Detector outcomes** (META_INTEGRITY + HARDCODED_SECRET excluded — toolchain-only checks): @@ -89,8 +89,8 @@ B (Vanilla) — errors: 1 warns: 3 infos: 28 | Test files | 1 | 2 | -1 | | Test LoC | 8 | 33 | -25 | | Test cases | 1 | 4 | -3 | -| Total chars (artifacts + code) | 7872 | 5592 | +2280 | -| Estimated tokens | 1970 | 1399 | +571 | +| Total chars (artifacts + code) | 7764 | 5592 | +2172 | +| Estimated tokens | 1943 | 1399 | +544 | **Detector outcomes** (META_INTEGRITY + HARDCODED_SECRET excluded — toolchain-only checks): @@ -110,7 +110,7 @@ B (Vanilla) — errors: 1 warns: 3 infos: 28 - **Spec ↔ code traceability**: cladding emits 1 feature(s), 2 AC(s), 2 scenario(s), 3 capability(s); vanilla has 0 of each. - **Architecture enforcement**: cladding declares 3 layer(s) with 2 forbidden-import rule(s); vanilla has 0. - **Detector behavior**: cladding-managed tree → 1 error(s) / 3 warn(s) / 15 info(s). Vanilla tree → 1 / 3 / 28. The detectors that gate against spec (REFERENCE_INTEGRITY, MISSING_IMPLEMENTATION, ARCHITECTURE_FROM_SPEC, CAPABILITIES_FEATURE_MAPPING) need cladding's artifacts to evaluate — without them they silently pass. The "0 errors on vanilla" therefore is **absence of signal**, not absence of drift. -- **Token cost**: cladding's cumulative artifact + code consumes ~1970 tokens vs vanilla's ~1399 (heuristic chars/4) — Δ ≈ 571 tokens, the price of structure. +- **Token cost**: cladding's cumulative artifact + code consumes ~1943 tokens vs vanilla's ~1399 (heuristic chars/4) — Δ ≈ 544 tokens, the price of structure. - **Code surface**: vanilla writes 5 source file(s) / 126 LoC + 2 test file(s) / 4 test case(s); cladding writes 1 / 11 + 1 / 1. (Vanilla front-loads code, cladding front-loads spec — both converge by M2.) ## Outcome Quality (F-ba2e05) diff --git a/plugins/claude-code/dist/clad.js b/plugins/claude-code/dist/clad.js index 38529e0..53ca56f 100755 --- a/plugins/claude-code/dist/clad.js +++ b/plugins/claude-code/dist/clad.js @@ -4,11 +4,11 @@ const require = __claddingCreateRequire(import.meta.url); // Marker for stages/*.ts: when true, the per-stage CLI-entry guard // short-circuits so the bundle doesn't fire every stage at startup. globalThis.__CLADDING_BUNDLED = true; -var Mde=Object.create;var kA=Object.defineProperty;var Fde=Object.getOwnPropertyDescriptor;var Lde=Object.getOwnPropertyNames;var zde=Object.getPrototypeOf,Ude=Object.prototype.hasOwnProperty;var Ge=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pr=(t,e)=>{for(var r in e)kA(t,r,{get:e[r],enumerable:!0})},qde=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Lde(e))!Ude.call(t,i)&&i!==r&&kA(t,i,{get:()=>e[i],enumerable:!(n=Fde(e,i))||n.enumerable});return t};var St=(t,e,r)=>(r=t!=null?Mde(zde(t)):{},qde(e||!t||!t.__esModule?kA(r,"default",{value:t,enumerable:!0}):r,t));var rf=v(AA=>{var _y=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},EA=class extends _y{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};AA.CommanderError=_y;AA.InvalidArgumentError=EA});var by=v(OA=>{var{InvalidArgumentError:Bde}=rf(),TA=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Bde(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Hde(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}OA.Argument=TA;OA.humanReadableArgName=Hde});var PA=v(IA=>{var{humanReadableArgName:Gde}=by(),RA=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Gde(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),s.join(` +var Mde=Object.create;var kA=Object.defineProperty;var Fde=Object.getOwnPropertyDescriptor;var Lde=Object.getOwnPropertyNames;var zde=Object.getPrototypeOf,Ude=Object.prototype.hasOwnProperty;var Ge=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pr=(t,e)=>{for(var r in e)kA(t,r,{get:e[r],enumerable:!0})},qde=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Lde(e))!Ude.call(t,i)&&i!==r&&kA(t,i,{get:()=>e[i],enumerable:!(n=Fde(e,i))||n.enumerable});return t};var St=(t,e,r)=>(r=t!=null?Mde(zde(t)):{},qde(e||!t||!t.__esModule?kA(r,"default",{value:t,enumerable:!0}):r,t));var nf=v(AA=>{var _y=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},EA=class extends _y{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};AA.CommanderError=_y;AA.InvalidArgumentError=EA});var by=v(OA=>{var{InvalidArgumentError:Bde}=nf(),TA=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Bde(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Hde(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}OA.Argument=TA;OA.humanReadableArgName=Hde});var PA=v(IA=>{var{humanReadableArgName:Gde}=by(),RA=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Gde(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),s.join(` `)}displayWidth(e){return l4(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),c=2,u=(this.helpWidth??80)-r-c-2,d;return u{let a=s.match(i);if(a===null){o.push("");return}let c=[a.shift()],l=this.displayWidth(c[0]);a.forEach(u=>{let d=this.displayWidth(u);if(l+d<=r){c.push(u),l+=d;return}o.push(c.join(""));let f=u.trimStart();c=[f],l=this.displayWidth(f)}),o.push(c.join(""))}),o.join(` -`)}};function l4(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}IA.Help=RA;IA.stripColor=l4});var jA=v(NA=>{var{InvalidArgumentError:Zde}=rf(),CA=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Vde(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Zde(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?u4(this.name().replace(/^no-/,"")):u4(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},DA=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function u4(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Vde(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a} +`)}};function l4(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}IA.Help=RA;IA.stripColor=l4});var jA=v(NA=>{var{InvalidArgumentError:Zde}=nf(),CA=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Vde(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Zde(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?u4(this.name().replace(/^no-/,"")):u4(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},DA=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function u4(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Vde(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a} - a short flag is a single dash and a single character - either use a single dash and a single character (for a short flag) - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a} @@ -16,7 +16,7 @@ ${s}`)}boxWrap(e,r){if(r{function Wde(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function Kde(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=Wde(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(as.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?` (Did you mean one of ${n.join(", ")}?)`:n.length===1?` -(Did you mean ${n[0]}?)`:""}d4.suggestSimilar=Kde});var g4=v(UA=>{var Jde=Ge("node:events").EventEmitter,MA=Ge("node:child_process"),fo=Ge("node:path"),vy=Ge("node:fs"),Be=Ge("node:process"),{Argument:Yde,humanReadableArgName:Xde}=by(),{CommanderError:FA}=rf(),{Help:Qde,stripColor:efe}=PA(),{Option:p4,DualOptions:tfe}=jA(),{suggestSimilar:m4}=f4(),LA=class t extends Jde{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>Be.stdout.write(r),writeErr:r=>Be.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>Be.stdout.isTTY?Be.stdout.columns:void 0,getErrHelpWidth:()=>Be.stderr.isTTY?Be.stderr.columns:void 0,getOutHasColors:()=>zA()??(Be.stdout.isTTY&&Be.stdout.hasColors?.()),getErrHasColors:()=>zA()??(Be.stderr.isTTY&&Be.stderr.hasColors?.()),stripColor:r=>efe(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return i&&(c.description(i),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Qde,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name +(Did you mean ${n[0]}?)`:""}d4.suggestSimilar=Kde});var g4=v(UA=>{var Jde=Ge("node:events").EventEmitter,MA=Ge("node:child_process"),fo=Ge("node:path"),vy=Ge("node:fs"),Be=Ge("node:process"),{Argument:Yde,humanReadableArgName:Xde}=by(),{CommanderError:FA}=nf(),{Help:Qde,stripColor:efe}=PA(),{Option:p4,DualOptions:tfe}=jA(),{suggestSimilar:m4}=f4(),LA=class t extends Jde{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>Be.stdout.write(r),writeErr:r=>Be.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>Be.stdout.isTTY?Be.stdout.columns:void 0,getErrHelpWidth:()=>Be.stderr.isTTY?Be.stderr.columns:void 0,getOutHasColors:()=>zA()??(Be.stdout.isTTY&&Be.stdout.hasColors?.()),getErrHasColors:()=>zA()??(Be.stderr.isTTY&&Be.stderr.hasColors?.()),stripColor:r=>efe(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return i&&(c.description(i),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Qde,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new Yde(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'. Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new FA(e,r,n)),Be.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new p4(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}' - already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,s):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof p4)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,l)=>{let u=a.exec(c);return u?u[0]:l},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){Be.versions?.electron&&(r.from="electron");let i=Be.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=Be.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":Be.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true. @@ -29,23 +29,23 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life `),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Be.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Be.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new tfe(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),u=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||s},i=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=m4(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=m4(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e} `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Xde(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=fo.basename(e,fo.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(Be.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s} -`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function h4(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function zA(){if(Be.env.NO_COLOR||Be.env.FORCE_COLOR==="0"||Be.env.FORCE_COLOR==="false")return!1;if(Be.env.FORCE_COLOR||Be.env.CLICOLOR_FORCE!==void 0)return!0}UA.Command=LA;UA.useColor=zA});var v4=v(kn=>{var{Argument:y4}=by(),{Command:qA}=g4(),{CommanderError:rfe,InvalidArgumentError:_4}=rf(),{Help:nfe}=PA(),{Option:b4}=jA();kn.program=new qA;kn.createCommand=t=>new qA(t);kn.createOption=(t,e)=>new b4(t,e);kn.createArgument=(t,e)=>new y4(t,e);kn.Command=qA;kn.Option=b4;kn.Argument=y4;kn.Help=nfe;kn.CommanderError=rfe;kn.InvalidArgumentError=_4;kn.InvalidOptionArgumentError=_4});var De=v(Qt=>{"use strict";var HA=Symbol.for("yaml.alias"),$4=Symbol.for("yaml.document"),Sy=Symbol.for("yaml.map"),k4=Symbol.for("yaml.pair"),GA=Symbol.for("yaml.scalar"),wy=Symbol.for("yaml.seq"),po=Symbol.for("yaml.node.type"),lfe=t=>!!t&&typeof t=="object"&&t[po]===HA,ufe=t=>!!t&&typeof t=="object"&&t[po]===$4,dfe=t=>!!t&&typeof t=="object"&&t[po]===Sy,ffe=t=>!!t&&typeof t=="object"&&t[po]===k4,E4=t=>!!t&&typeof t=="object"&&t[po]===GA,pfe=t=>!!t&&typeof t=="object"&&t[po]===wy;function A4(t){if(t&&typeof t=="object")switch(t[po]){case Sy:case wy:return!0}return!1}function mfe(t){if(t&&typeof t=="object")switch(t[po]){case HA:case Sy:case GA:case wy:return!0}return!1}var hfe=t=>(E4(t)||A4(t))&&!!t.anchor;Qt.ALIAS=HA;Qt.DOC=$4;Qt.MAP=Sy;Qt.NODE_TYPE=po;Qt.PAIR=k4;Qt.SCALAR=GA;Qt.SEQ=wy;Qt.hasAnchor=hfe;Qt.isAlias=lfe;Qt.isCollection=A4;Qt.isDocument=ufe;Qt.isMap=dfe;Qt.isNode=mfe;Qt.isPair=ffe;Qt.isScalar=E4;Qt.isSeq=pfe});var nf=v(ZA=>{"use strict";var Ut=De(),Cr=Symbol("break visit"),T4=Symbol("skip children"),Ai=Symbol("remove node");function xy(t,e){let r=O4(e);Ut.isDocument(t)?Qc(null,t.contents,r,Object.freeze([t]))===Ai&&(t.contents=null):Qc(null,t,r,Object.freeze([]))}xy.BREAK=Cr;xy.SKIP=T4;xy.REMOVE=Ai;function Qc(t,e,r,n){let i=R4(t,e,r,n);if(Ut.isNode(i)||Ut.isPair(i))return I4(t,n,i),Qc(t,i,r,n);if(typeof i!="symbol"){if(Ut.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o{"use strict";var P4=De(),gfe=nf(),yfe={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_fe=t=>t.replace(/[!,[\]{}]/g,e=>yfe[e]),of=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+_fe(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&P4.isNode(e.contents)){let o={};gfe.visit(e.contents,(s,a)=>{P4.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(` -`)}};of.defaultYaml={explicit:!1,version:"1.2"};of.defaultTags={"!!":"tag:yaml.org,2002:"};C4.Directives=of});var ky=v(sf=>{"use strict";var D4=De(),bfe=nf();function vfe(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function N4(t){let e=new Set;return bfe.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function j4(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function Sfe(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=N4(t));let s=j4(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(D4.isScalar(s.node)||D4.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}sf.anchorIsValid=vfe;sf.anchorNames=N4;sf.createNodeAnchors=Sfe;sf.findNewAnchor=j4});var WA=v(M4=>{"use strict";function af(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i{"use strict";var wfe=De();function F4(t,e,r){if(Array.isArray(t))return t.map((n,i)=>F4(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!wfe.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}L4.toJS=F4});var Ey=v(U4=>{"use strict";var xfe=WA(),z4=De(),$fe=Zo(),KA=class{constructor(e){Object.defineProperty(this,z4.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!z4.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=$fe.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?xfe.applyReviver(o,{"":a},"",a):a}};U4.NodeBase=KA});var cf=v(q4=>{"use strict";var kfe=ky(),Efe=nf(),tl=De(),Afe=Ey(),Tfe=Zo(),JA=class extends Afe.NodeBase{constructor(e){super(tl.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Efe.visit(e,{Node:(o,s)=>{(tl.isAlias(s)||tl.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(Tfe.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Ay(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(kfe.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function Ay(t,e,r){if(tl.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(tl.isCollection(e)){let n=0;for(let i of e.items){let o=Ay(t,i,r);o>n&&(n=o)}return n}else if(tl.isPair(e)){let n=Ay(t,e.key,r),i=Ay(t,e.value,r);return Math.max(n,i)}return 1}q4.Alias=JA});var Dt=v(YA=>{"use strict";var Ofe=De(),Rfe=Ey(),Ife=Zo(),Pfe=t=>!t||typeof t!="function"&&typeof t!="object",Vo=class extends Rfe.NodeBase{constructor(e){super(Ofe.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Ife.toJS(this.value,e,r)}toString(){return String(this.value)}};Vo.BLOCK_FOLDED="BLOCK_FOLDED";Vo.BLOCK_LITERAL="BLOCK_LITERAL";Vo.PLAIN="PLAIN";Vo.QUOTE_DOUBLE="QUOTE_DOUBLE";Vo.QUOTE_SINGLE="QUOTE_SINGLE";YA.Scalar=Vo;YA.isScalarValue=Pfe});var lf=v(H4=>{"use strict";var Cfe=cf(),da=De(),B4=Dt(),Dfe="tag:yaml.org,2002:";function Nfe(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function jfe(t,e,r){if(da.isDocument(t)&&(t=t.contents),da.isNode(t))return t;if(da.isPair(t)){let d=r.schema[da.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new Cfe.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Dfe+e.slice(2));let l=Nfe(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new B4.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?s[da.MAP]:Symbol.iterator in Object(t)?s[da.SEQ]:s[da.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new B4.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}H4.createNode=jfe});var Oy=v(Ty=>{"use strict";var Mfe=lf(),Ti=De(),Ffe=Ey();function XA(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return Mfe.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var G4=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,QA=class extends Ffe.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Ti.isNode(n)||Ti.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(G4(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(Ti.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,XA(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Ti.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&Ti.isScalar(o)?o.value:o:Ti.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ti.isPair(r))return!1;let n=r.value;return n==null||e&&Ti.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Ti.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(Ti.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,XA(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Ty.Collection=QA;Ty.collectionFromPath=XA;Ty.isEmptyPath=G4});var uf=v(Ry=>{"use strict";var Lfe=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function eT(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var zfe=(t,e,r)=>t.endsWith(` +`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function h4(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function zA(){if(Be.env.NO_COLOR||Be.env.FORCE_COLOR==="0"||Be.env.FORCE_COLOR==="false")return!1;if(Be.env.FORCE_COLOR||Be.env.CLICOLOR_FORCE!==void 0)return!0}UA.Command=LA;UA.useColor=zA});var v4=v(kn=>{var{Argument:y4}=by(),{Command:qA}=g4(),{CommanderError:rfe,InvalidArgumentError:_4}=nf(),{Help:nfe}=PA(),{Option:b4}=jA();kn.program=new qA;kn.createCommand=t=>new qA(t);kn.createOption=(t,e)=>new b4(t,e);kn.createArgument=(t,e)=>new y4(t,e);kn.Command=qA;kn.Option=b4;kn.Argument=y4;kn.Help=nfe;kn.CommanderError=rfe;kn.InvalidArgumentError=_4;kn.InvalidOptionArgumentError=_4});var De=v(Qt=>{"use strict";var HA=Symbol.for("yaml.alias"),$4=Symbol.for("yaml.document"),Sy=Symbol.for("yaml.map"),k4=Symbol.for("yaml.pair"),GA=Symbol.for("yaml.scalar"),wy=Symbol.for("yaml.seq"),po=Symbol.for("yaml.node.type"),lfe=t=>!!t&&typeof t=="object"&&t[po]===HA,ufe=t=>!!t&&typeof t=="object"&&t[po]===$4,dfe=t=>!!t&&typeof t=="object"&&t[po]===Sy,ffe=t=>!!t&&typeof t=="object"&&t[po]===k4,E4=t=>!!t&&typeof t=="object"&&t[po]===GA,pfe=t=>!!t&&typeof t=="object"&&t[po]===wy;function A4(t){if(t&&typeof t=="object")switch(t[po]){case Sy:case wy:return!0}return!1}function mfe(t){if(t&&typeof t=="object")switch(t[po]){case HA:case Sy:case GA:case wy:return!0}return!1}var hfe=t=>(E4(t)||A4(t))&&!!t.anchor;Qt.ALIAS=HA;Qt.DOC=$4;Qt.MAP=Sy;Qt.NODE_TYPE=po;Qt.PAIR=k4;Qt.SCALAR=GA;Qt.SEQ=wy;Qt.hasAnchor=hfe;Qt.isAlias=lfe;Qt.isCollection=A4;Qt.isDocument=ufe;Qt.isMap=dfe;Qt.isNode=mfe;Qt.isPair=ffe;Qt.isScalar=E4;Qt.isSeq=pfe});var of=v(ZA=>{"use strict";var Ut=De(),Cr=Symbol("break visit"),T4=Symbol("skip children"),Ai=Symbol("remove node");function xy(t,e){let r=O4(e);Ut.isDocument(t)?Qc(null,t.contents,r,Object.freeze([t]))===Ai&&(t.contents=null):Qc(null,t,r,Object.freeze([]))}xy.BREAK=Cr;xy.SKIP=T4;xy.REMOVE=Ai;function Qc(t,e,r,n){let i=R4(t,e,r,n);if(Ut.isNode(i)||Ut.isPair(i))return I4(t,n,i),Qc(t,i,r,n);if(typeof i!="symbol"){if(Ut.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o{"use strict";var P4=De(),gfe=of(),yfe={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_fe=t=>t.replace(/[!,[\]{}]/g,e=>yfe[e]),sf=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+_fe(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&P4.isNode(e.contents)){let o={};gfe.visit(e.contents,(s,a)=>{P4.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(` +`)}};sf.defaultYaml={explicit:!1,version:"1.2"};sf.defaultTags={"!!":"tag:yaml.org,2002:"};C4.Directives=sf});var ky=v(af=>{"use strict";var D4=De(),bfe=of();function vfe(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function N4(t){let e=new Set;return bfe.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function j4(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function Sfe(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=N4(t));let s=j4(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(D4.isScalar(s.node)||D4.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}af.anchorIsValid=vfe;af.anchorNames=N4;af.createNodeAnchors=Sfe;af.findNewAnchor=j4});var WA=v(M4=>{"use strict";function cf(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i{"use strict";var wfe=De();function F4(t,e,r){if(Array.isArray(t))return t.map((n,i)=>F4(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!wfe.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}L4.toJS=F4});var Ey=v(U4=>{"use strict";var xfe=WA(),z4=De(),$fe=Zo(),KA=class{constructor(e){Object.defineProperty(this,z4.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!z4.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=$fe.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?xfe.applyReviver(o,{"":a},"",a):a}};U4.NodeBase=KA});var lf=v(q4=>{"use strict";var kfe=ky(),Efe=of(),tl=De(),Afe=Ey(),Tfe=Zo(),JA=class extends Afe.NodeBase{constructor(e){super(tl.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Efe.visit(e,{Node:(o,s)=>{(tl.isAlias(s)||tl.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(Tfe.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Ay(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(kfe.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function Ay(t,e,r){if(tl.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(tl.isCollection(e)){let n=0;for(let i of e.items){let o=Ay(t,i,r);o>n&&(n=o)}return n}else if(tl.isPair(e)){let n=Ay(t,e.key,r),i=Ay(t,e.value,r);return Math.max(n,i)}return 1}q4.Alias=JA});var Dt=v(YA=>{"use strict";var Ofe=De(),Rfe=Ey(),Ife=Zo(),Pfe=t=>!t||typeof t!="function"&&typeof t!="object",Vo=class extends Rfe.NodeBase{constructor(e){super(Ofe.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Ife.toJS(this.value,e,r)}toString(){return String(this.value)}};Vo.BLOCK_FOLDED="BLOCK_FOLDED";Vo.BLOCK_LITERAL="BLOCK_LITERAL";Vo.PLAIN="PLAIN";Vo.QUOTE_DOUBLE="QUOTE_DOUBLE";Vo.QUOTE_SINGLE="QUOTE_SINGLE";YA.Scalar=Vo;YA.isScalarValue=Pfe});var uf=v(H4=>{"use strict";var Cfe=lf(),da=De(),B4=Dt(),Dfe="tag:yaml.org,2002:";function Nfe(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function jfe(t,e,r){if(da.isDocument(t)&&(t=t.contents),da.isNode(t))return t;if(da.isPair(t)){let d=r.schema[da.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new Cfe.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Dfe+e.slice(2));let l=Nfe(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new B4.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?s[da.MAP]:Symbol.iterator in Object(t)?s[da.SEQ]:s[da.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new B4.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}H4.createNode=jfe});var Oy=v(Ty=>{"use strict";var Mfe=uf(),Ti=De(),Ffe=Ey();function XA(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return Mfe.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var G4=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,QA=class extends Ffe.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Ti.isNode(n)||Ti.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(G4(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(Ti.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,XA(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Ti.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&Ti.isScalar(o)?o.value:o:Ti.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ti.isPair(r))return!1;let n=r.value;return n==null||e&&Ti.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Ti.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(Ti.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,XA(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Ty.Collection=QA;Ty.collectionFromPath=XA;Ty.isEmptyPath=G4});var df=v(Ry=>{"use strict";var Lfe=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function eT(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var zfe=(t,e,r)=>t.endsWith(` `)?eT(r,e):r.includes(` `)?` -`+eT(r,e):(t.endsWith(" ")?"":" ")+r;Ry.indentComment=eT;Ry.lineComment=zfe;Ry.stringifyComment=Lfe});var V4=v(df=>{"use strict";var Ufe="flow",tT="block",Iy="quoted";function qfe(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,o)?l.push(0):d=i-n);let f,p,m=!1,h=-1,g=-1,b=-1;r===tT&&(h=Z4(t,h,e.length),h!==-1&&(d=h+c));for(let S;S=t[h+=1];){if(r===Iy&&S==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(S===` +`+eT(r,e):(t.endsWith(" ")?"":" ")+r;Ry.indentComment=eT;Ry.lineComment=zfe;Ry.stringifyComment=Lfe});var V4=v(ff=>{"use strict";var Ufe="flow",tT="block",Iy="quoted";function qfe(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,o)?l.push(0):d=i-n);let f,p,m=!1,h=-1,g=-1,b=-1;r===tT&&(h=Z4(t,h,e.length),h!==-1&&(d=h+c));for(let S;S=t[h+=1];){if(r===Iy&&S==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(S===` `)r===tT&&(h=Z4(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(S===" "&&p&&p!==" "&&p!==` `&&p!==" "){let x=t[h+1];x&&x!==" "&&x!==` `&&x!==" "&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(r===Iy){for(;p===" "||p===" ";)p=S,S=t[h+=1],m=!0;let x=h>b+1?h-2:g-1;if(u[x])return t;l.push(x),u[x]=!0,d=x+c,f=void 0}else m=!0}p=S}if(m&&a&&a(),l.length===0)return t;s&&s();let _=t.slice(0,l[0]);for(let S=0;S{"use strict";var Kn=Dt(),Wo=V4(),Cy=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Dy=t=>/^(%|---|\.\.\.)/m.test(t);function Bfe(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;on)return!0;if(s=o+1,i-s<=n)return!1}return!0}function ff(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Dy(t)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let u=r.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length{"use strict";var Kn=Dt(),Wo=V4(),Cy=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Dy=t=>/^(%|---|\.\.\.)/m.test(t);function Bfe(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;on)return!0;if(s=o+1,i-s<=n)return!1}return!0}function pf(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Dy(t)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let u=r.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` `)?rl(o,e):Py(t,e,r,n);if(!a&&!u&&i!==Kn.Scalar.PLAIN&&o.includes(` `))return Py(t,e,r,n);if(Dy(o)){if(c==="")return e.forceBlockIndent=!0,Py(t,e,r,n);if(a&&c===l)return rl(o,e)}let d=o.replace(/\n+/g,`$& -${c}`);if(s){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:m}=e.doc.schema;if(m.some(f)||p?.some(f))return rl(o,e)}return a?d:Wo.foldFlowLines(d,c,Wo.FOLD_FLOW,Cy(e,!1))}function Gfe(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Kn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Kn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Kn.Scalar.BLOCK_FOLDED:case Kn.Scalar.BLOCK_LITERAL:return i||o?rl(s.value,e):Py(s,e,r,n);case Kn.Scalar.QUOTE_DOUBLE:return ff(s.value,e);case Kn.Scalar.QUOTE_SINGLE:return rT(s.value,e);case Kn.Scalar.PLAIN:return Hfe(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}W4.stringifyString=Gfe});var mf=v(iT=>{"use strict";var Zfe=ky(),Ko=De(),Vfe=uf(),Wfe=pf();function Kfe(t,e){let r=Object.assign({blockQuote:!0,commentString:Vfe.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Jfe(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(Ko.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Yfe(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(Ko.isScalar(t)||Ko.isCollection(t))&&t.anchor;o&&Zfe.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Xfe(t,e,r,n){if(Ko.isPair(t))return t.toString(e,r,n);if(Ko.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=Ko.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Jfe(e.doc.schema.tags,o));let s=Yfe(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):Ko.isScalar(o)?Wfe.stringifyString(o,e,r,n):o.toString(e,r,n);return s?Ko.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} -${e.indent}${a}`:a}iT.createStringifyContext=Kfe;iT.stringify=Xfe});var X4=v(Y4=>{"use strict";var mo=De(),K4=Dt(),J4=mf(),hf=uf();function Qfe({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=mo.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(mo.isCollection(t)||!mo.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||mo.isCollection(t)||(mo.isScalar(t)?t.type===K4.Scalar.BLOCK_FOLDED||t.type===K4.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!o),indent:a+c});let m=!1,h=!1,g=J4.stringify(t,r,()=>m=!0,()=>h=!0);if(!p&&!r.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(o||e==null)return m&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(o&&!d||e==null&&p)return g=`? ${g}`,f&&!m?g+=hf.lineComment(g,r.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=hf.lineComment(g,r.indent,l(f))),g=`? ${g} -${a}:`):(g=`${g}:`,f&&(g+=hf.lineComment(g,r.indent,l(f))));let b,_,S;mo.isNode(e)?(b=!!e.spaceBefore,_=e.commentBefore,S=e.comment):(b=!1,_=null,S=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!p&&!f&&mo.isScalar(e)&&(r.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&mo.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let x=!1,w=J4.stringify(e,r,()=>x=!0,()=>h=!0),O=" ";if(f||b||_){if(O=b?` +${c}`);if(s){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:m}=e.doc.schema;if(m.some(f)||p?.some(f))return rl(o,e)}return a?d:Wo.foldFlowLines(d,c,Wo.FOLD_FLOW,Cy(e,!1))}function Gfe(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Kn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Kn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Kn.Scalar.BLOCK_FOLDED:case Kn.Scalar.BLOCK_LITERAL:return i||o?rl(s.value,e):Py(s,e,r,n);case Kn.Scalar.QUOTE_DOUBLE:return pf(s.value,e);case Kn.Scalar.QUOTE_SINGLE:return rT(s.value,e);case Kn.Scalar.PLAIN:return Hfe(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}W4.stringifyString=Gfe});var hf=v(iT=>{"use strict";var Zfe=ky(),Ko=De(),Vfe=df(),Wfe=mf();function Kfe(t,e){let r=Object.assign({blockQuote:!0,commentString:Vfe.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Jfe(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(Ko.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Yfe(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(Ko.isScalar(t)||Ko.isCollection(t))&&t.anchor;o&&Zfe.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Xfe(t,e,r,n){if(Ko.isPair(t))return t.toString(e,r,n);if(Ko.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=Ko.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Jfe(e.doc.schema.tags,o));let s=Yfe(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):Ko.isScalar(o)?Wfe.stringifyString(o,e,r,n):o.toString(e,r,n);return s?Ko.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} +${e.indent}${a}`:a}iT.createStringifyContext=Kfe;iT.stringify=Xfe});var X4=v(Y4=>{"use strict";var mo=De(),K4=Dt(),J4=hf(),gf=df();function Qfe({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=mo.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(mo.isCollection(t)||!mo.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||mo.isCollection(t)||(mo.isScalar(t)?t.type===K4.Scalar.BLOCK_FOLDED||t.type===K4.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!o),indent:a+c});let m=!1,h=!1,g=J4.stringify(t,r,()=>m=!0,()=>h=!0);if(!p&&!r.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(o||e==null)return m&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(o&&!d||e==null&&p)return g=`? ${g}`,f&&!m?g+=gf.lineComment(g,r.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=gf.lineComment(g,r.indent,l(f))),g=`? ${g} +${a}:`):(g=`${g}:`,f&&(g+=gf.lineComment(g,r.indent,l(f))));let b,_,S;mo.isNode(e)?(b=!!e.spaceBefore,_=e.commentBefore,S=e.comment):(b=!1,_=null,S=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!p&&!f&&mo.isScalar(e)&&(r.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&mo.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let x=!1,w=J4.stringify(e,r,()=>x=!0,()=>h=!0),O=" ";if(f||b||_){if(O=b?` `:"",_){let T=l(_);O+=` -${hf.indentComment(T,r.indent)}`}w===""&&!r.inFlow?O===` +${gf.indentComment(T,r.indent)}`}w===""&&!r.inFlow?O===` `&&S&&(O=` `):O+=` ${r.indent}`}else if(!p&&mo.isCollection(e)){let T=w[0],A=w.indexOf(` `),D=A!==-1,$=r.inFlow??e.flow??e.items.length===0;if(D||!$){let ie=!1;if(D&&(T==="&"||T==="!")){let K=w.indexOf(" ");T==="&"&&K!==-1&&K{"use strict";var Q4=Ge("process");function epe(t,...e){t==="debug"&&console.log(...e)}function tpe(t,e){(t==="debug"||t==="warn")&&(typeof Q4.emitWarning=="function"?Q4.emitWarning(e):console.warn(e))}oT.debug=epe;oT.warn=tpe});var Ly=v(Fy=>{"use strict";var My=De(),e6=Dt(),Ny="<<",jy={identify:t=>t===Ny||typeof t=="symbol"&&t.description===Ny,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new e6.Scalar(Symbol(Ny)),{addToJSMap:t6}),stringify:()=>Ny},rpe=(t,e)=>(jy.identify(e)||My.isScalar(e)&&(!e.type||e.type===e6.Scalar.PLAIN)&&jy.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===jy.tag&&r.default);function t6(t,e,r){let n=r6(t,r);if(My.isSeq(n))for(let i of n.items)aT(t,e,i);else if(Array.isArray(n))for(let i of n)aT(t,e,i);else aT(t,e,n)}function aT(t,e,r){let n=r6(t,r);if(!My.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function r6(t,e){return t&&My.isAlias(e)?e.resolve(t.doc,t):e}Fy.addMergeToJSMap=t6;Fy.isMergeKey=rpe;Fy.merge=jy});var lT=v(o6=>{"use strict";var npe=sT(),n6=Ly(),ipe=mf(),i6=De(),cT=Zo();function ope(t,e,{key:r,value:n}){if(i6.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(n6.isMergeKey(t,r))n6.addMergeToJSMap(t,e,n);else{let i=cT.toJS(r,"",t);if(e instanceof Map)e.set(i,cT.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=spe(r,i,t),s=cT.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function spe(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(i6.isNode(t)&&r?.doc){let n=ipe.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),npe.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}o6.addPairToJSMap=ope});var Jo=v(uT=>{"use strict";var s6=lf(),ape=X4(),cpe=lT(),zy=De();function lpe(t,e,r){let n=s6.createNode(t,void 0,r),i=s6.createNode(e,void 0,r);return new Uy(n,i)}var Uy=class t{constructor(e,r=null){Object.defineProperty(this,zy.NODE_TYPE,{value:zy.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return zy.isNode(r)&&(r=r.clone(e)),zy.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return cpe.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?ape.stringifyPair(this,e,r,n):JSON.stringify(this)}};uT.Pair=Uy;uT.createPair=lpe});var dT=v(c6=>{"use strict";var fa=De(),a6=mf(),qy=uf();function upe(t,e,r){return(e.inFlow??t.flow?fpe:dpe)(t,e,r)}function dpe({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(b+=qy.lineComment(b,o,l(g))),d&&g&&(d=!1),f.push(n+b)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;m{"use strict";var Q4=Ge("process");function epe(t,...e){t==="debug"&&console.log(...e)}function tpe(t,e){(t==="debug"||t==="warn")&&(typeof Q4.emitWarning=="function"?Q4.emitWarning(e):console.warn(e))}oT.debug=epe;oT.warn=tpe});var Ly=v(Fy=>{"use strict";var My=De(),e6=Dt(),Ny="<<",jy={identify:t=>t===Ny||typeof t=="symbol"&&t.description===Ny,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new e6.Scalar(Symbol(Ny)),{addToJSMap:t6}),stringify:()=>Ny},rpe=(t,e)=>(jy.identify(e)||My.isScalar(e)&&(!e.type||e.type===e6.Scalar.PLAIN)&&jy.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===jy.tag&&r.default);function t6(t,e,r){let n=r6(t,r);if(My.isSeq(n))for(let i of n.items)aT(t,e,i);else if(Array.isArray(n))for(let i of n)aT(t,e,i);else aT(t,e,n)}function aT(t,e,r){let n=r6(t,r);if(!My.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function r6(t,e){return t&&My.isAlias(e)?e.resolve(t.doc,t):e}Fy.addMergeToJSMap=t6;Fy.isMergeKey=rpe;Fy.merge=jy});var lT=v(o6=>{"use strict";var npe=sT(),n6=Ly(),ipe=hf(),i6=De(),cT=Zo();function ope(t,e,{key:r,value:n}){if(i6.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(n6.isMergeKey(t,r))n6.addMergeToJSMap(t,e,n);else{let i=cT.toJS(r,"",t);if(e instanceof Map)e.set(i,cT.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=spe(r,i,t),s=cT.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function spe(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(i6.isNode(t)&&r?.doc){let n=ipe.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),npe.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}o6.addPairToJSMap=ope});var Jo=v(uT=>{"use strict";var s6=uf(),ape=X4(),cpe=lT(),zy=De();function lpe(t,e,r){let n=s6.createNode(t,void 0,r),i=s6.createNode(e,void 0,r);return new Uy(n,i)}var Uy=class t{constructor(e,r=null){Object.defineProperty(this,zy.NODE_TYPE,{value:zy.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return zy.isNode(r)&&(r=r.clone(e)),zy.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return cpe.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?ape.stringifyPair(this,e,r,n):JSON.stringify(this)}};uT.Pair=Uy;uT.createPair=lpe});var dT=v(c6=>{"use strict";var fa=De(),a6=hf(),qy=df();function upe(t,e,r){return(e.inFlow??t.flow?fpe:dpe)(t,e,r)}function dpe({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(b+=qy.lineComment(b,o,l(g))),d&&g&&(d=!1),f.push(n+b)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;mg=null);l||(l=d.length>u||b.includes(` `)),m0&&(l||(l=d.reduce((_,S)=>_+S.length+2,2)+(b.length+2)>e.options.lineWidth)),l&&(b+=",")),g&&(b+=qy.lineComment(b,n,a(g))),d.push(b),u=d.length}let{start:f,end:p}=r;if(d.length===0)return f+p;if(!l){let m=d.reduce((h,g)=>h+g.length+2,2);l=e.options.lineWidth>0&&m>e.options.lineWidth}if(l){let m=f;for(let h of d)m+=h?` ${o}${i}${h}`:` `;return`${m} -${i}${p}`}else return`${f}${s}${d.join(" ")}${s}${p}`}function By({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=qy.indentComment(e(n),t);r.push(o.trimStart())}}c6.stringifyCollection=upe});var Xo=v(pT=>{"use strict";var ppe=dT(),mpe=lT(),hpe=Oy(),Yo=De(),Hy=Jo(),gpe=Dt();function gf(t,e){let r=Yo.isScalar(e)?e.value:e;for(let n of t)if(Yo.isPair(n)&&(n.key===e||n.key===r||Yo.isScalar(n.key)&&n.key.value===r))return n}var fT=class extends hpe.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Yo.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(Hy.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;Yo.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Hy.Pair(e,e?.value):n=new Hy.Pair(e.key,e.value);let i=gf(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Yo.isScalar(i.value)&&gpe.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=gf(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=gf(this.items,e)?.value;return(!r&&Yo.isScalar(i)?i.value:i)??void 0}has(e){return!!gf(this.items,e)}set(e,r){this.add(new Hy.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)mpe.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Yo.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ppe.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};pT.YAMLMap=fT;pT.findPair=gf});var nl=v(u6=>{"use strict";var ype=De(),l6=Xo(),_pe={collection:"map",default:!0,nodeClass:l6.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return ype.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>l6.YAMLMap.from(t,e,r)};u6.map=_pe});var Qo=v(d6=>{"use strict";var bpe=lf(),vpe=dT(),Spe=Oy(),Zy=De(),wpe=Dt(),xpe=Zo(),mT=class extends Spe.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Zy.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Gy(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Gy(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Zy.isScalar(i)?i.value:i}has(e){let r=Gy(e);return typeof r=="number"&&r=0?e:null}d6.YAMLSeq=mT});var il=v(p6=>{"use strict";var $pe=De(),f6=Qo(),kpe={collection:"seq",default:!0,nodeClass:f6.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return $pe.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>f6.YAMLSeq.from(t,e,r)};p6.seq=kpe});var yf=v(m6=>{"use strict";var Epe=pf(),Ape={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),Epe.stringifyString(t,e,r,n)}};m6.string=Ape});var Vy=v(y6=>{"use strict";var h6=Dt(),g6={identify:t=>t==null,createNode:()=>new h6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new h6.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&g6.test.test(t)?t:e.options.nullStr};y6.nullTag=g6});var hT=v(b6=>{"use strict";var Tpe=Dt(),_6={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Tpe.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&_6.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};b6.boolTag=_6});var ol=v(v6=>{"use strict";function Ope({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}v6.stringifyNumber=Ope});var yT=v(Wy=>{"use strict";var Rpe=Dt(),gT=ol(),Ipe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:gT.stringifyNumber},Ppe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():gT.stringifyNumber(t)}},Cpe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Rpe.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:gT.stringifyNumber};Wy.float=Cpe;Wy.floatExp=Ppe;Wy.floatNaN=Ipe});var bT=v(Jy=>{"use strict";var S6=ol(),Ky=t=>typeof t=="bigint"||Number.isInteger(t),_T=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function w6(t,e,r){let{value:n}=t;return Ky(n)&&n>=0?r+n.toString(e):S6.stringifyNumber(t)}var Dpe={identify:t=>Ky(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>_T(t,2,8,r),stringify:t=>w6(t,8,"0o")},Npe={identify:Ky,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>_T(t,0,10,r),stringify:S6.stringifyNumber},jpe={identify:t=>Ky(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>_T(t,2,16,r),stringify:t=>w6(t,16,"0x")};Jy.int=Npe;Jy.intHex=jpe;Jy.intOct=Dpe});var $6=v(x6=>{"use strict";var Mpe=nl(),Fpe=Vy(),Lpe=il(),zpe=yf(),Upe=hT(),vT=yT(),ST=bT(),qpe=[Mpe.map,Lpe.seq,zpe.string,Fpe.nullTag,Upe.boolTag,ST.intOct,ST.int,ST.intHex,vT.floatNaN,vT.floatExp,vT.float];x6.schema=qpe});var A6=v(E6=>{"use strict";var Bpe=Dt(),Hpe=nl(),Gpe=il();function k6(t){return typeof t=="bigint"||Number.isInteger(t)}var Yy=({value:t})=>JSON.stringify(t),Zpe=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Yy},{identify:t=>t==null,createNode:()=>new Bpe.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Yy},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Yy},{identify:k6,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>k6(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Yy}],Vpe={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Wpe=[Hpe.map,Gpe.seq].concat(Zpe,Vpe);E6.schema=Wpe});var xT=v(T6=>{"use strict";var _f=Ge("buffer"),wT=Dt(),Kpe=pf(),Jpe={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof _f.Buffer=="function")return _f.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i{"use strict";var ppe=dT(),mpe=lT(),hpe=Oy(),Yo=De(),Hy=Jo(),gpe=Dt();function yf(t,e){let r=Yo.isScalar(e)?e.value:e;for(let n of t)if(Yo.isPair(n)&&(n.key===e||n.key===r||Yo.isScalar(n.key)&&n.key.value===r))return n}var fT=class extends hpe.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Yo.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(Hy.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;Yo.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Hy.Pair(e,e?.value):n=new Hy.Pair(e.key,e.value);let i=yf(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Yo.isScalar(i.value)&&gpe.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=yf(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=yf(this.items,e)?.value;return(!r&&Yo.isScalar(i)?i.value:i)??void 0}has(e){return!!yf(this.items,e)}set(e,r){this.add(new Hy.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)mpe.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Yo.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ppe.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};pT.YAMLMap=fT;pT.findPair=yf});var nl=v(u6=>{"use strict";var ype=De(),l6=Xo(),_pe={collection:"map",default:!0,nodeClass:l6.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return ype.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>l6.YAMLMap.from(t,e,r)};u6.map=_pe});var Qo=v(d6=>{"use strict";var bpe=uf(),vpe=dT(),Spe=Oy(),Zy=De(),wpe=Dt(),xpe=Zo(),mT=class extends Spe.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Zy.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Gy(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Gy(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Zy.isScalar(i)?i.value:i}has(e){let r=Gy(e);return typeof r=="number"&&r=0?e:null}d6.YAMLSeq=mT});var il=v(p6=>{"use strict";var $pe=De(),f6=Qo(),kpe={collection:"seq",default:!0,nodeClass:f6.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return $pe.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>f6.YAMLSeq.from(t,e,r)};p6.seq=kpe});var _f=v(m6=>{"use strict";var Epe=mf(),Ape={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),Epe.stringifyString(t,e,r,n)}};m6.string=Ape});var Vy=v(y6=>{"use strict";var h6=Dt(),g6={identify:t=>t==null,createNode:()=>new h6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new h6.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&g6.test.test(t)?t:e.options.nullStr};y6.nullTag=g6});var hT=v(b6=>{"use strict";var Tpe=Dt(),_6={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Tpe.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&_6.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};b6.boolTag=_6});var ol=v(v6=>{"use strict";function Ope({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}v6.stringifyNumber=Ope});var yT=v(Wy=>{"use strict";var Rpe=Dt(),gT=ol(),Ipe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:gT.stringifyNumber},Ppe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():gT.stringifyNumber(t)}},Cpe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Rpe.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:gT.stringifyNumber};Wy.float=Cpe;Wy.floatExp=Ppe;Wy.floatNaN=Ipe});var bT=v(Jy=>{"use strict";var S6=ol(),Ky=t=>typeof t=="bigint"||Number.isInteger(t),_T=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function w6(t,e,r){let{value:n}=t;return Ky(n)&&n>=0?r+n.toString(e):S6.stringifyNumber(t)}var Dpe={identify:t=>Ky(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>_T(t,2,8,r),stringify:t=>w6(t,8,"0o")},Npe={identify:Ky,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>_T(t,0,10,r),stringify:S6.stringifyNumber},jpe={identify:t=>Ky(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>_T(t,2,16,r),stringify:t=>w6(t,16,"0x")};Jy.int=Npe;Jy.intHex=jpe;Jy.intOct=Dpe});var $6=v(x6=>{"use strict";var Mpe=nl(),Fpe=Vy(),Lpe=il(),zpe=_f(),Upe=hT(),vT=yT(),ST=bT(),qpe=[Mpe.map,Lpe.seq,zpe.string,Fpe.nullTag,Upe.boolTag,ST.intOct,ST.int,ST.intHex,vT.floatNaN,vT.floatExp,vT.float];x6.schema=qpe});var A6=v(E6=>{"use strict";var Bpe=Dt(),Hpe=nl(),Gpe=il();function k6(t){return typeof t=="bigint"||Number.isInteger(t)}var Yy=({value:t})=>JSON.stringify(t),Zpe=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Yy},{identify:t=>t==null,createNode:()=>new Bpe.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Yy},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Yy},{identify:k6,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>k6(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Yy}],Vpe={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Wpe=[Hpe.map,Gpe.seq].concat(Zpe,Vpe);E6.schema=Wpe});var xT=v(T6=>{"use strict";var bf=Ge("buffer"),wT=Dt(),Kpe=mf(),Jpe={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof bf.Buffer=="function")return bf.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i{"use strict";var Xy=De(),$T=Jo(),Ype=Dt(),Xpe=Qo();function O6(t,e){if(Xy.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new $T.Pair(new Ype.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore} ${i.key.commentBefore}`:n.commentBefore),n.comment){let o=i.value??i.key;o.comment=o.comment?`${n.comment} -${o.comment}`:n.comment}n=i}t.items[r]=Xy.isPair(n)?n:new $T.Pair(n)}}else e("Expected a sequence for this tag");return t}function R6(t,e,r){let{replacer:n}=r,i=new Xpe.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push($T.createPair(a,c,r))}return i}var Qpe={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:O6,createNode:R6};Qy.createPairs=R6;Qy.pairs=Qpe;Qy.resolvePairs=O6});var AT=v(ET=>{"use strict";var I6=De(),kT=Zo(),bf=Xo(),eme=Qo(),P6=e_(),pa=class t extends eme.YAMLSeq{constructor(){super(),this.add=bf.YAMLMap.prototype.add.bind(this),this.delete=bf.YAMLMap.prototype.delete.bind(this),this.get=bf.YAMLMap.prototype.get.bind(this),this.has=bf.YAMLMap.prototype.has.bind(this),this.set=bf.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(I6.isPair(i)?(o=kT.toJS(i.key,"",r),s=kT.toJS(i.value,o,r)):o=kT.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=P6.createPairs(e,r,n),o=new this;return o.items=i.items,o}};pa.tag="tag:yaml.org,2002:omap";var tme={collection:"seq",identify:t=>t instanceof Map,nodeClass:pa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=P6.resolvePairs(t,e),n=[];for(let{key:i}of r.items)I6.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new pa,r)},createNode:(t,e,r)=>pa.from(t,e,r)};ET.YAMLOMap=pa;ET.omap=tme});var M6=v(TT=>{"use strict";var C6=Dt();function D6({value:t,source:e},r){return e&&(t?N6:j6).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var N6={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new C6.Scalar(!0),stringify:D6},j6={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new C6.Scalar(!1),stringify:D6};TT.falseTag=j6;TT.trueTag=N6});var F6=v(t_=>{"use strict";var rme=Dt(),OT=ol(),nme={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:OT.stringifyNumber},ime={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():OT.stringifyNumber(t)}},ome={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new rme.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:OT.stringifyNumber};t_.float=ome;t_.floatExp=ime;t_.floatNaN=nme});var z6=v(Sf=>{"use strict";var L6=ol(),vf=t=>typeof t=="bigint"||Number.isInteger(t);function r_(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function RT(t,e,r){let{value:n}=t;if(vf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return L6.stringifyNumber(t)}var sme={identify:vf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>r_(t,2,2,r),stringify:t=>RT(t,2,"0b")},ame={identify:vf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>r_(t,1,8,r),stringify:t=>RT(t,8,"0")},cme={identify:vf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>r_(t,0,10,r),stringify:L6.stringifyNumber},lme={identify:vf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>r_(t,2,16,r),stringify:t=>RT(t,16,"0x")};Sf.int=cme;Sf.intBin=sme;Sf.intHex=lme;Sf.intOct=ame});var PT=v(IT=>{"use strict";var o_=De(),n_=Jo(),i_=Xo(),ma=class t extends i_.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;o_.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new n_.Pair(e.key,null):r=new n_.Pair(e,null),i_.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=i_.findPair(this.items,e);return!r&&o_.isPair(n)?o_.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=i_.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new n_.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(n_.createPair(s,null,n));return o}};ma.tag="tag:yaml.org,2002:set";var ume={collection:"map",identify:t=>t instanceof Set,nodeClass:ma,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ma.from(t,e,r),resolve(t,e){if(o_.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ma,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};IT.YAMLSet=ma;IT.set=ume});var DT=v(s_=>{"use strict";var dme=ol();function CT(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function U6(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return dme.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var fme={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>CT(t,r),stringify:U6},pme={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>CT(t,!1),stringify:U6},q6={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(q6.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=CT(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};s_.floatTime=pme;s_.intTime=fme;s_.timestamp=q6});var G6=v(H6=>{"use strict";var mme=nl(),hme=Vy(),gme=il(),yme=yf(),_me=xT(),B6=M6(),NT=F6(),a_=z6(),bme=Ly(),vme=AT(),Sme=e_(),wme=PT(),jT=DT(),xme=[mme.map,gme.seq,yme.string,hme.nullTag,B6.trueTag,B6.falseTag,a_.intBin,a_.intOct,a_.int,a_.intHex,NT.floatNaN,NT.floatExp,NT.float,_me.binary,bme.merge,vme.omap,Sme.pairs,wme.set,jT.intTime,jT.floatTime,jT.timestamp];H6.schema=xme});var tB=v(LT=>{"use strict";var K6=nl(),$me=Vy(),J6=il(),kme=yf(),Eme=hT(),MT=yT(),FT=bT(),Ame=$6(),Tme=A6(),Y6=xT(),wf=Ly(),X6=AT(),Q6=e_(),Z6=G6(),eB=PT(),c_=DT(),V6=new Map([["core",Ame.schema],["failsafe",[K6.map,J6.seq,kme.string]],["json",Tme.schema],["yaml11",Z6.schema],["yaml-1.1",Z6.schema]]),W6={binary:Y6.binary,bool:Eme.boolTag,float:MT.float,floatExp:MT.floatExp,floatNaN:MT.floatNaN,floatTime:c_.floatTime,int:FT.int,intHex:FT.intHex,intOct:FT.intOct,intTime:c_.intTime,map:K6.map,merge:wf.merge,null:$me.nullTag,omap:X6.omap,pairs:Q6.pairs,seq:J6.seq,set:eB.set,timestamp:c_.timestamp},Ome={"tag:yaml.org,2002:binary":Y6.binary,"tag:yaml.org,2002:merge":wf.merge,"tag:yaml.org,2002:omap":X6.omap,"tag:yaml.org,2002:pairs":Q6.pairs,"tag:yaml.org,2002:set":eB.set,"tag:yaml.org,2002:timestamp":c_.timestamp};function Rme(t,e,r){let n=V6.get(e);if(n&&!t)return r&&!n.includes(wf.merge)?n.concat(wf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(V6.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(wf.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?W6[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(W6).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}LT.coreKnownTags=Ome;LT.getTags=Rme});var qT=v(rB=>{"use strict";var zT=De(),Ime=nl(),Pme=il(),Cme=yf(),l_=tB(),Dme=(t,e)=>t.keye.key?1:0,UT=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?l_.getTags(e,"compat"):e?l_.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?l_.coreKnownTags:{},this.tags=l_.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,zT.MAP,{value:Ime.map}),Object.defineProperty(this,zT.SCALAR,{value:Cme.string}),Object.defineProperty(this,zT.SEQ,{value:Pme.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Dme:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};rB.Schema=UT});var iB=v(nB=>{"use strict";var Nme=De(),BT=mf(),xf=uf();function jme(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=BT.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(xf.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(Nme.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(xf.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=BT.stringify(t.contents,i,()=>a=null,c);a&&(l+=xf.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(BT.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(` -`)?(r.push("..."),r.push(xf.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&r[r.length-1]!==""&&r.push(""),r.push(xf.indentComment(o(c),"")))}return r.join(` +${o.comment}`:n.comment}n=i}t.items[r]=Xy.isPair(n)?n:new $T.Pair(n)}}else e("Expected a sequence for this tag");return t}function R6(t,e,r){let{replacer:n}=r,i=new Xpe.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push($T.createPair(a,c,r))}return i}var Qpe={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:O6,createNode:R6};Qy.createPairs=R6;Qy.pairs=Qpe;Qy.resolvePairs=O6});var AT=v(ET=>{"use strict";var I6=De(),kT=Zo(),vf=Xo(),eme=Qo(),P6=e_(),pa=class t extends eme.YAMLSeq{constructor(){super(),this.add=vf.YAMLMap.prototype.add.bind(this),this.delete=vf.YAMLMap.prototype.delete.bind(this),this.get=vf.YAMLMap.prototype.get.bind(this),this.has=vf.YAMLMap.prototype.has.bind(this),this.set=vf.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(I6.isPair(i)?(o=kT.toJS(i.key,"",r),s=kT.toJS(i.value,o,r)):o=kT.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=P6.createPairs(e,r,n),o=new this;return o.items=i.items,o}};pa.tag="tag:yaml.org,2002:omap";var tme={collection:"seq",identify:t=>t instanceof Map,nodeClass:pa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=P6.resolvePairs(t,e),n=[];for(let{key:i}of r.items)I6.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new pa,r)},createNode:(t,e,r)=>pa.from(t,e,r)};ET.YAMLOMap=pa;ET.omap=tme});var M6=v(TT=>{"use strict";var C6=Dt();function D6({value:t,source:e},r){return e&&(t?N6:j6).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var N6={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new C6.Scalar(!0),stringify:D6},j6={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new C6.Scalar(!1),stringify:D6};TT.falseTag=j6;TT.trueTag=N6});var F6=v(t_=>{"use strict";var rme=Dt(),OT=ol(),nme={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:OT.stringifyNumber},ime={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():OT.stringifyNumber(t)}},ome={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new rme.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:OT.stringifyNumber};t_.float=ome;t_.floatExp=ime;t_.floatNaN=nme});var z6=v(wf=>{"use strict";var L6=ol(),Sf=t=>typeof t=="bigint"||Number.isInteger(t);function r_(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function RT(t,e,r){let{value:n}=t;if(Sf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return L6.stringifyNumber(t)}var sme={identify:Sf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>r_(t,2,2,r),stringify:t=>RT(t,2,"0b")},ame={identify:Sf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>r_(t,1,8,r),stringify:t=>RT(t,8,"0")},cme={identify:Sf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>r_(t,0,10,r),stringify:L6.stringifyNumber},lme={identify:Sf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>r_(t,2,16,r),stringify:t=>RT(t,16,"0x")};wf.int=cme;wf.intBin=sme;wf.intHex=lme;wf.intOct=ame});var PT=v(IT=>{"use strict";var o_=De(),n_=Jo(),i_=Xo(),ma=class t extends i_.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;o_.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new n_.Pair(e.key,null):r=new n_.Pair(e,null),i_.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=i_.findPair(this.items,e);return!r&&o_.isPair(n)?o_.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=i_.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new n_.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(n_.createPair(s,null,n));return o}};ma.tag="tag:yaml.org,2002:set";var ume={collection:"map",identify:t=>t instanceof Set,nodeClass:ma,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ma.from(t,e,r),resolve(t,e){if(o_.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ma,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};IT.YAMLSet=ma;IT.set=ume});var DT=v(s_=>{"use strict";var dme=ol();function CT(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function U6(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return dme.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var fme={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>CT(t,r),stringify:U6},pme={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>CT(t,!1),stringify:U6},q6={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(q6.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=CT(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};s_.floatTime=pme;s_.intTime=fme;s_.timestamp=q6});var G6=v(H6=>{"use strict";var mme=nl(),hme=Vy(),gme=il(),yme=_f(),_me=xT(),B6=M6(),NT=F6(),a_=z6(),bme=Ly(),vme=AT(),Sme=e_(),wme=PT(),jT=DT(),xme=[mme.map,gme.seq,yme.string,hme.nullTag,B6.trueTag,B6.falseTag,a_.intBin,a_.intOct,a_.int,a_.intHex,NT.floatNaN,NT.floatExp,NT.float,_me.binary,bme.merge,vme.omap,Sme.pairs,wme.set,jT.intTime,jT.floatTime,jT.timestamp];H6.schema=xme});var tB=v(LT=>{"use strict";var K6=nl(),$me=Vy(),J6=il(),kme=_f(),Eme=hT(),MT=yT(),FT=bT(),Ame=$6(),Tme=A6(),Y6=xT(),xf=Ly(),X6=AT(),Q6=e_(),Z6=G6(),eB=PT(),c_=DT(),V6=new Map([["core",Ame.schema],["failsafe",[K6.map,J6.seq,kme.string]],["json",Tme.schema],["yaml11",Z6.schema],["yaml-1.1",Z6.schema]]),W6={binary:Y6.binary,bool:Eme.boolTag,float:MT.float,floatExp:MT.floatExp,floatNaN:MT.floatNaN,floatTime:c_.floatTime,int:FT.int,intHex:FT.intHex,intOct:FT.intOct,intTime:c_.intTime,map:K6.map,merge:xf.merge,null:$me.nullTag,omap:X6.omap,pairs:Q6.pairs,seq:J6.seq,set:eB.set,timestamp:c_.timestamp},Ome={"tag:yaml.org,2002:binary":Y6.binary,"tag:yaml.org,2002:merge":xf.merge,"tag:yaml.org,2002:omap":X6.omap,"tag:yaml.org,2002:pairs":Q6.pairs,"tag:yaml.org,2002:set":eB.set,"tag:yaml.org,2002:timestamp":c_.timestamp};function Rme(t,e,r){let n=V6.get(e);if(n&&!t)return r&&!n.includes(xf.merge)?n.concat(xf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(V6.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(xf.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?W6[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(W6).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}LT.coreKnownTags=Ome;LT.getTags=Rme});var qT=v(rB=>{"use strict";var zT=De(),Ime=nl(),Pme=il(),Cme=_f(),l_=tB(),Dme=(t,e)=>t.keye.key?1:0,UT=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?l_.getTags(e,"compat"):e?l_.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?l_.coreKnownTags:{},this.tags=l_.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,zT.MAP,{value:Ime.map}),Object.defineProperty(this,zT.SCALAR,{value:Cme.string}),Object.defineProperty(this,zT.SEQ,{value:Pme.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Dme:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};rB.Schema=UT});var iB=v(nB=>{"use strict";var Nme=De(),BT=hf(),$f=df();function jme(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=BT.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift($f.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(Nme.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push($f.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=BT.stringify(t.contents,i,()=>a=null,c);a&&(l+=$f.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(BT.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(` +`)?(r.push("..."),r.push($f.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&r[r.length-1]!==""&&r.push(""),r.push($f.indentComment(o(c),"")))}return r.join(` `)+` -`}nB.stringifyDocument=jme});var $f=v(oB=>{"use strict";var Mme=cf(),sl=Oy(),En=De(),Fme=Jo(),Lme=Zo(),zme=qT(),Ume=iB(),HT=ky(),qme=WA(),Bme=lf(),GT=VA(),ZT=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,En.NODE_TYPE,{value:En.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new GT.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[En.NODE_TYPE]:{value:En.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=En.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){al(this.contents)&&this.contents.add(e)}addIn(e,r){al(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=HT.anchorNames(this);e.anchor=!r||n.has(r)?HT.findNewAnchor(r||"a",n):r}return new Mme.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let g=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,b=r.filter(g).map(String);b.length>0&&(r=r.concat(b)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=HT.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=Bme.createNode(e,u,m);return a&&En.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new Fme.Pair(i,o)}delete(e){return al(this.contents)?this.contents.delete(e):!1}deleteIn(e){return sl.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):al(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return En.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return sl.isEmptyPath(e)?!r&&En.isScalar(this.contents)?this.contents.value:this.contents:En.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return En.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return sl.isEmptyPath(e)?this.contents!==void 0:En.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=sl.collectionFromPath(this.schema,[e],r):al(this.contents)&&this.contents.set(e,r)}setIn(e,r){sl.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=sl.collectionFromPath(this.schema,Array.from(e),r):al(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new GT.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new GT.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new zme.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Lme.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?qme.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Ume.stringifyDocument(this,e)}};function al(t){if(En.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}oB.Document=ZT});var Af=v(Ef=>{"use strict";var kf=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},VT=class extends kf{constructor(e,r,n){super("YAMLParseError",e,r,n)}},WT=class extends kf{constructor(e,r,n){super("YAMLWarning",e,r,n)}},Hme=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 +`}nB.stringifyDocument=jme});var kf=v(oB=>{"use strict";var Mme=lf(),sl=Oy(),En=De(),Fme=Jo(),Lme=Zo(),zme=qT(),Ume=iB(),HT=ky(),qme=WA(),Bme=uf(),GT=VA(),ZT=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,En.NODE_TYPE,{value:En.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new GT.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[En.NODE_TYPE]:{value:En.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=En.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){al(this.contents)&&this.contents.add(e)}addIn(e,r){al(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=HT.anchorNames(this);e.anchor=!r||n.has(r)?HT.findNewAnchor(r||"a",n):r}return new Mme.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let g=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,b=r.filter(g).map(String);b.length>0&&(r=r.concat(b)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=HT.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=Bme.createNode(e,u,m);return a&&En.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new Fme.Pair(i,o)}delete(e){return al(this.contents)?this.contents.delete(e):!1}deleteIn(e){return sl.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):al(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return En.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return sl.isEmptyPath(e)?!r&&En.isScalar(this.contents)?this.contents.value:this.contents:En.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return En.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return sl.isEmptyPath(e)?this.contents!==void 0:En.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=sl.collectionFromPath(this.schema,[e],r):al(this.contents)&&this.contents.set(e,r)}setIn(e,r){sl.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=sl.collectionFromPath(this.schema,Array.from(e),r):al(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new GT.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new GT.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new zme.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Lme.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?qme.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Ume.stringifyDocument(this,e)}};function al(t){if(En.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}oB.Document=ZT});var Tf=v(Af=>{"use strict";var Ef=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},VT=class extends Ef{constructor(e,r,n){super("YAMLParseError",e,r,n)}},WT=class extends Ef{constructor(e,r,n){super("YAMLWarning",e,r,n)}},Hme=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 `),s=a+s}if(/[^ ]/.test(s)){let a=1,c=r.linePos[1];c?.line===n&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-o)));let l=" ".repeat(o)+"^".repeat(a);r.message+=`: ${s} ${l} -`}};Ef.YAMLError=kf;Ef.YAMLParseError=VT;Ef.YAMLWarning=WT;Ef.prettifyError=Hme});var Tf=v(sB=>{"use strict";function Gme(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,m=!1,h=null,g=null,b=null,_=null,S=null,x=null,w=null;for(let A of t)switch(m&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&o(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(l&&A.type!=="comment"&&A.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),A.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&A.source.includes(" ")&&(h=A),u=!0;break;case"comment":{u||o(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=A.source.substring(1)||" ";d?d+=f+D:d=D,f="",l=!1;break}case"newline":l?d?d+=A.source:(!x||r!=="seq-item-ind")&&(c=!0):f+=A.source,l=!0,p=!0,(g||b)&&(_=A),u=!0;break;case"anchor":g&&o(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&o(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=A,w??(w=A.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(A,"MULTIPLE_TAGS","A node can have at most one tag"),b=A,w??(w=A.offset),l=!1,u=!1,m=!0;break}case r:(g||b)&&o(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),x&&o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e??"collection"}`),x=A,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){S&&o(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=A,l=!1,u=!1;break}default:o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),l=!1,u=!1}let O=t[t.length-1],T=O?O.offset+O.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:x,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:b,newlineAfterProp:_,end:T,start:w??T}}sB.resolveProps=Gme});var u_=v(aB=>{"use strict";function KT(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` -`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(KT(e.key)||KT(e.value))return!0}return!1;default:return!0}}aB.containsNewline=KT});var JT=v(cB=>{"use strict";var Zme=u_();function Vme(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Zme.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}cB.flowIndentCheck=Vme});var YT=v(uB=>{"use strict";var lB=De();function Wme(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||lB.isScalar(o)&&lB.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}uB.mapIncludes=Wme});var gB=v(hB=>{"use strict";var dB=Jo(),Kme=Xo(),fB=Tf(),Jme=u_(),pB=JT(),Yme=YT(),mB="All mapping items must start at the same column";function Xme({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Kme.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:m}=u,h=fB.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",mB)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=` +`}};Af.YAMLError=Ef;Af.YAMLParseError=VT;Af.YAMLWarning=WT;Af.prettifyError=Hme});var Of=v(sB=>{"use strict";function Gme(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,m=!1,h=null,g=null,b=null,_=null,S=null,x=null,w=null;for(let A of t)switch(m&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&o(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(l&&A.type!=="comment"&&A.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),A.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&A.source.includes(" ")&&(h=A),u=!0;break;case"comment":{u||o(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=A.source.substring(1)||" ";d?d+=f+D:d=D,f="",l=!1;break}case"newline":l?d?d+=A.source:(!x||r!=="seq-item-ind")&&(c=!0):f+=A.source,l=!0,p=!0,(g||b)&&(_=A),u=!0;break;case"anchor":g&&o(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&o(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=A,w??(w=A.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(A,"MULTIPLE_TAGS","A node can have at most one tag"),b=A,w??(w=A.offset),l=!1,u=!1,m=!0;break}case r:(g||b)&&o(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),x&&o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e??"collection"}`),x=A,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){S&&o(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=A,l=!1,u=!1;break}default:o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),l=!1,u=!1}let O=t[t.length-1],T=O?O.offset+O.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:x,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:b,newlineAfterProp:_,end:T,start:w??T}}sB.resolveProps=Gme});var u_=v(aB=>{"use strict";function KT(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(KT(e.key)||KT(e.value))return!0}return!1;default:return!0}}aB.containsNewline=KT});var JT=v(cB=>{"use strict";var Zme=u_();function Vme(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Zme.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}cB.flowIndentCheck=Vme});var YT=v(uB=>{"use strict";var lB=De();function Wme(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||lB.isScalar(o)&&lB.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}uB.mapIncludes=Wme});var gB=v(hB=>{"use strict";var dB=Jo(),Kme=Xo(),fB=Of(),Jme=u_(),pB=JT(),Yme=YT(),mB="All mapping items must start at the same column";function Xme({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Kme.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:m}=u,h=fB.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",mB)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=` `+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||Jme.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",mB);r.atKey=!0;let b=h.end,_=f?t(r,f,h,i):e(r,b,d,null,h,i);r.schema.compat&&pB.flowIndentCheck(n.indent,f,i),r.atKey=!1,Yme.mapIncludes(r,a.items,_)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let S=fB.resolveProps(p??[],{indicator:"map-value-ind",next:m,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=S.end,S.found){g&&(m?.type==="block-map"&&!S.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start{"use strict";var Qme=Qo(),ehe=Tf(),the=JT();function rhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Qme.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=ehe.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&the.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}yB.resolveBlockSeq=rhe});var cl=v(bB=>{"use strict";function nhe(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}bB.resolveEnd=nhe});var xB=v(wB=>{"use strict";var ihe=De(),ohe=Jo(),vB=Xo(),she=Qo(),ahe=cl(),SB=Tf(),che=u_(),lhe=YT(),XT="Block collections are not allowed within flow collections",QT=t=>t&&(t.type==="block-map"||t.type==="block-seq");function uhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?vB.YAMLMap:she.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g{"use strict";var Qme=Qo(),ehe=Of(),the=JT();function rhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Qme.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=ehe.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&the.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}yB.resolveBlockSeq=rhe});var cl=v(bB=>{"use strict";function nhe(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}bB.resolveEnd=nhe});var xB=v(wB=>{"use strict";var ihe=De(),ohe=Jo(),vB=Xo(),she=Qo(),ahe=cl(),SB=Of(),che=u_(),lhe=YT(),XT="Block collections are not allowed within flow collections",QT=t=>t&&(t.type==="block-map"||t.type==="block-seq");function uhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?vB.YAMLMap:she.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g0){let g=ahe.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` @@ -127,14 +127,14 @@ ${l} `);)n===` `&&(r+=` `),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var The={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Ohe(t,e,r,n){let i=t.substr(e,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}TB.resolveFlowScalar=xhe});var IB=v(RB=>{"use strict";var ha=De(),OB=Dt(),Rhe=rO(),Ihe=iO();function Phe(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?Rhe.resolveBlockScalar(t,e,n):Ihe.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[ha.SCALAR]:c?l=Che(t.schema,i,c,r,n):e.type==="scalar"?l=Dhe(t,i,e,n):l=t.schema[ha.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=ha.isScalar(d)?d:new OB.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new OB.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function Che(t,e,r,n,i){if(r==="!")return t[ha.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[ha.SCALAR])}function Dhe({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[ha.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[ha.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}RB.composeScalar=Phe});var CB=v(PB=>{"use strict";function Nhe(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}PB.emptyScalarPosition=Nhe});var jB=v(sO=>{"use strict";var jhe=cf(),Mhe=De(),Fhe=kB(),DB=IB(),Lhe=cl(),zhe=CB(),Uhe={composeNode:NB,composeEmptyNode:oO};function NB(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=qhe(t,e,n),(a||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=DB.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Fhe.composeCollection(Uhe,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(d){let f=d instanceof Error?d.message:String(d);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=oO(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Mhe.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function oO(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:zhe.emptyScalarPosition(e,r,n),indent:-1,source:""},d=DB.composeScalar(t,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function qhe({options:t},{offset:e,source:r,end:n},i){let o=new jhe.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=Lhe.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}sO.composeEmptyNode=oO;sO.composeNode=NB});var LB=v(FB=>{"use strict";var Bhe=$f(),MB=jB(),Hhe=cl(),Ghe=Tf();function Zhe(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new Bhe.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Ghe.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?MB.composeNode(l,i,u,s):MB.composeEmptyNode(l,u.end,n,null,u,s);let d=c.contents.range[2],f=Hhe.resolveEnd(o,d,!1,s);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}FB.composeDoc=Zhe});var cO=v(qB=>{"use strict";var Vhe=Ge("process"),Whe=VA(),Khe=$f(),Of=Af(),zB=De(),Jhe=LB(),Yhe=cl();function Rf(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function UB(t){let e="",r=!1,n=!1;for(let i=0;i{"use strict";var ha=De(),OB=Dt(),Rhe=rO(),Ihe=iO();function Phe(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?Rhe.resolveBlockScalar(t,e,n):Ihe.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[ha.SCALAR]:c?l=Che(t.schema,i,c,r,n):e.type==="scalar"?l=Dhe(t,i,e,n):l=t.schema[ha.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=ha.isScalar(d)?d:new OB.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new OB.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function Che(t,e,r,n,i){if(r==="!")return t[ha.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[ha.SCALAR])}function Dhe({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[ha.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[ha.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}RB.composeScalar=Phe});var CB=v(PB=>{"use strict";function Nhe(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}PB.emptyScalarPosition=Nhe});var jB=v(sO=>{"use strict";var jhe=lf(),Mhe=De(),Fhe=kB(),DB=IB(),Lhe=cl(),zhe=CB(),Uhe={composeNode:NB,composeEmptyNode:oO};function NB(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=qhe(t,e,n),(a||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=DB.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Fhe.composeCollection(Uhe,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(d){let f=d instanceof Error?d.message:String(d);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=oO(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Mhe.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function oO(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:zhe.emptyScalarPosition(e,r,n),indent:-1,source:""},d=DB.composeScalar(t,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function qhe({options:t},{offset:e,source:r,end:n},i){let o=new jhe.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=Lhe.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}sO.composeEmptyNode=oO;sO.composeNode=NB});var LB=v(FB=>{"use strict";var Bhe=kf(),MB=jB(),Hhe=cl(),Ghe=Of();function Zhe(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new Bhe.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Ghe.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?MB.composeNode(l,i,u,s):MB.composeEmptyNode(l,u.end,n,null,u,s);let d=c.contents.range[2],f=Hhe.resolveEnd(o,d,!1,s);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}FB.composeDoc=Zhe});var cO=v(qB=>{"use strict";var Vhe=Ge("process"),Whe=VA(),Khe=kf(),Rf=Tf(),zB=De(),Jhe=LB(),Yhe=cl();function If(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function UB(t){let e="",r=!1,n=!1;for(let i=0;i{let s=Rf(r);o?this.warnings.push(new Of.YAMLWarning(s,n,i)):this.errors.push(new Of.YAMLParseError(s,n,i))},this.directives=new Whe.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=UB(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment} +`)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var aO=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,o)=>{let s=If(r);o?this.warnings.push(new Rf.YAMLWarning(s,n,i)):this.errors.push(new Rf.YAMLParseError(s,n,i))},this.directives=new Whe.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=UB(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment} ${n}`:n;else if(i||e.directives.docStart||!o)e.commentBefore=n;else if(zB.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];zB.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${n} ${a}`:n}else{let s=o.commentBefore;o.commentBefore=s?`${n} -${s}`:n}}if(r){for(let o=0;o{let o=Rf(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Jhe.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Of.YAMLParseError(Rf(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Of.YAMLParseError(Rf(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Yhe.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} -${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Of.YAMLParseError(Rf(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Khe.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};qB.Composer=aO});var GB=v(d_=>{"use strict";var Xhe=rO(),Qhe=iO(),ege=Af(),BB=pf();function tge(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new ege.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Qhe.resolveFlowScalar(t,e,n);case"block-scalar":return Xhe.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function rge(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=BB.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:` +${s}`:n}}if(r){for(let o=0;o{let o=If(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Jhe.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Rf.YAMLParseError(If(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Rf.YAMLParseError(If(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Yhe.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} +${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Rf.YAMLParseError(If(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Khe.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};qB.Composer=aO});var GB=v(d_=>{"use strict";var Xhe=rO(),Qhe=iO(),ege=Tf(),BB=mf();function tge(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new ege.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Qhe.resolveFlowScalar(t,e,n);case"block-scalar":return Xhe.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function rge(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=BB.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:` `}];switch(a[0]){case"|":case">":{let l=a.indexOf(` `),u=a.substring(0,l),d=a.substring(l+1)+` `,f=[{type:"block-scalar-header",offset:o,indent:n,source:u}];return HB(f,c)||f.push({type:"newline",offset:-1,indent:n,source:` @@ -144,50 +144,50 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function HB(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function lO(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of n)o.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` `};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}d_.createScalarToken=rge;d_.resolveAsScalar=tge;d_.setScalarValue=nge});var VB=v(ZB=>{"use strict";var oge=t=>"type"in t?p_(t):f_(t);function p_(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=p_(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=f_(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=f_(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=f_(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function f_({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=p_(e)),r)for(let o of r)i+=o.source;return n&&(i+=p_(n)),i}ZB.stringify=oge});var YB=v(JB=>{"use strict";var uO=Symbol("break visit"),sge=Symbol("skip children"),WB=Symbol("remove item");function ga(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),KB(Object.freeze([]),t,e)}ga.BREAK=uO;ga.SKIP=sge;ga.REMOVE=WB;ga.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};ga.parentCollection=(t,e)=>{let r=ga.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function KB(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s{"use strict";var dO=GB(),age=VB(),cge=YB(),fO="\uFEFF",pO="",mO="",hO="",lge=t=>!!t&&"items"in t,uge=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function dge(t){switch(t){case fO:return"";case pO:return"";case mO:return"";case hO:return"";default:return JSON.stringify(t)}}function fge(t){switch(t){case fO:return"byte-order-mark";case pO:return"doc-mode";case mO:return"flow-error-end";case hO:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Dr.createScalarToken=dO.createScalarToken;Dr.resolveAsScalar=dO.resolveAsScalar;Dr.setScalarValue=dO.setScalarValue;Dr.stringify=age.stringify;Dr.visit=cge.visit;Dr.BOM=fO;Dr.DOCUMENT=pO;Dr.FLOW_END=mO;Dr.SCALAR=hO;Dr.isCollection=lge;Dr.isScalar=uge;Dr.prettyToken=dge;Dr.tokenType=fge});var _O=v(QB=>{"use strict";var If=m_();function Jn(t){switch(t){case void 0:case" ":case` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Dr.createScalarToken=dO.createScalarToken;Dr.resolveAsScalar=dO.resolveAsScalar;Dr.setScalarValue=dO.setScalarValue;Dr.stringify=age.stringify;Dr.visit=cge.visit;Dr.BOM=fO;Dr.DOCUMENT=pO;Dr.FLOW_END=mO;Dr.SCALAR=hO;Dr.isCollection=lge;Dr.isScalar=uge;Dr.prettyToken=dge;Dr.tokenType=fge});var _O=v(QB=>{"use strict";var Pf=m_();function Jn(t){switch(t){case void 0:case" ":case` `:case"\r":case" ":return!0;default:return!1}}var XB=new Set("0123456789ABCDEFabcdef"),pge=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),h_=new Set(",[]{}"),mge=new Set(` ,[]{} \r `),gO=t=>!t||mge.has(t),yO=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` `?!0:r==="\r"?this.buffer[e+1]===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===` `||!i&&!this.atEnd)return e+n+1}return r===` `||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Jn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Jn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Jn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(gO),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&nthis.indentValue&&!Jn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Jn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(gO),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Jn(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let o=this.pos;n=this.buffer[o];++o)switch(n){case" ":r+=1;break;case` `:e=o,r=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===` `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(` `,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===` `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let o=e-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===` -`&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield If.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(Jn(o)||e&&h_.has(o))break;r=n}else if(Jn(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===` +`&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield Pf.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(Jn(o)||e&&h_.has(o))break;r=n}else if(Jn(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===` `?(n+=1,i=` `,o=this.buffer[n+1]):r=n),o==="#"||e&&h_.has(o))break;if(i===` -`){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&h_.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield If.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(gO),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Jn(n)||r&&h_.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Jn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(pge.has(r))r=this.buffer[++e];else if(r==="%"&&XB.has(this.buffer[e+1])&&XB.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` +`){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&h_.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Pf.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(gO),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Jn(n)||r&&h_.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Jn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(pge.has(r))r=this.buffer[++e];else if(r==="%"&&XB.has(this.buffer[e+1])&&XB.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};QB.Lexer=yO});var vO=v(eH=>{"use strict";var bO=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[o]{"use strict";var hge=Ge("process"),tH=m_(),gge=_O();function es(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function y_(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&nH(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&rH(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;ae.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(es(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(iH(r.key)&&!es(r.sep,"newline")){let s=ll(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(es(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=ll(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):es(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!es(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){y_(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||es(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=g_(n),o=ll(i);nH(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(` -`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=g_(e),n=ll(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=g_(e),n=ll(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};oH.Parser=SO});var uH=v(Cf=>{"use strict";var sH=cO(),yge=$f(),Pf=Af(),_ge=sT(),bge=De(),vge=vO(),aH=wO();function cH(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new vge.LineCounter||null,prettyErrors:e}}function Sge(t,e={}){let{lineCounter:r,prettyErrors:n}=cH(e),i=new aH.Parser(r?.addNewLine),o=new sH.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(Pf.prettifyError(t,r)),a.warnings.forEach(Pf.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function lH(t,e={}){let{lineCounter:r,prettyErrors:n}=cH(e),i=new aH.Parser(r?.addNewLine),o=new sH.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Pf.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(Pf.prettifyError(t,r)),s.warnings.forEach(Pf.prettifyError(t,r))),s}function wge(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=lH(t,r);if(!i)return null;if(i.warnings.forEach(o=>_ge.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function xge(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return bge.isDocument(t)&&!n?t.toString(r):new yge.Document(t,n,r).toString(r)}Cf.parse=wge;Cf.parseAllDocuments=Sge;Cf.parseDocument=lH;Cf.stringify=xge});var er=v(Ze=>{"use strict";var $ge=cO(),kge=$f(),Ege=qT(),xO=Af(),Age=cf(),ts=De(),Tge=Jo(),Oge=Dt(),Rge=Xo(),Ige=Qo(),Pge=m_(),Cge=_O(),Dge=vO(),Nge=wO(),__=uH(),dH=nf();Ze.Composer=$ge.Composer;Ze.Document=kge.Document;Ze.Schema=Ege.Schema;Ze.YAMLError=xO.YAMLError;Ze.YAMLParseError=xO.YAMLParseError;Ze.YAMLWarning=xO.YAMLWarning;Ze.Alias=Age.Alias;Ze.isAlias=ts.isAlias;Ze.isCollection=ts.isCollection;Ze.isDocument=ts.isDocument;Ze.isMap=ts.isMap;Ze.isNode=ts.isNode;Ze.isPair=ts.isPair;Ze.isScalar=ts.isScalar;Ze.isSeq=ts.isSeq;Ze.Pair=Tge.Pair;Ze.Scalar=Oge.Scalar;Ze.YAMLMap=Rge.YAMLMap;Ze.YAMLSeq=Ige.YAMLSeq;Ze.CST=Pge;Ze.Lexer=Cge.Lexer;Ze.LineCounter=Dge.LineCounter;Ze.Parser=Nge.Parser;Ze.parse=__.parse;Ze.parseAllDocuments=__.parseAllDocuments;Ze.parseDocument=__.parseDocument;Ze.stringify=__.stringify;Ze.visit=dH.visit;Ze.visitAsync=dH.visitAsync});import{execFileSync as fH}from"node:child_process";import{existsSync as b_}from"node:fs";import{join as v_,resolve as jge}from"node:path";function Mge(t){try{let e=fH("git",["rev-parse","--git-dir"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return e?jge(t,e):null}catch{return null}}function $O(t){let e=Mge(t);if(!e)return null;try{if(b_(v_(e,"MERGE_HEAD")))return"merge";if(b_(v_(e,"CHERRY_PICK_HEAD")))return"cherry-pick";if(b_(v_(e,"rebase-merge"))||b_(v_(e,"rebase-apply")))return"rebase"}catch{return null}return null}function ya(t){return $O(t)!==null}function kO(t,e){try{let r=fH("git",["rev-parse","--verify","--quiet",`${e}^{commit}`],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return r.length>0?r:null}catch{return null}}function S_(t,e){return kO(t,e)!==null}var _a=y(()=>{"use strict"});import{execFileSync as Fge}from"node:child_process";import{existsSync as Lge,readFileSync as zge}from"node:fs";import{join as hH}from"node:path";function Df(t,e){return Fge("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}function rs(t){try{let e=Df(t,["describe","--tags","--abbrev=0"]).trim();if(e.length>0)return e}catch{}throw new Error("changelog: no git tag found to anchor the default range \u2014 pass --since explicitly (e.g. clad changelog --since v1.0.0)")}function ns(t,e){Uge(t,e);let r=Df(t,["rev-parse","HEAD"]).trim(),n=qge(t,e);return{groups:Bge(t,n),head:r,inventory:{after:mH(x_(t,"spec.yaml")),before:mH(EO(t,e,"spec.yaml"))},since:e,unsharded_commits:Vge(t,e)}}function AO(t){if(t.text&&t.text.trim().length>0)return t.text.trim();let e=t.action?.trim();if(!e)return null;let r=t.condition?.trim(),n=t.response?.trim(),i=r?`${r.charAt(0).toUpperCase()}${r.slice(1)}, the system shall ${e}`:`The system shall ${e}`;return n?`${i} \u2014 ${n}.`:`${i}.`}function Uge(t,e){let r=(e??"").trim();if(r.length===0)throw new Error("changelog: empty since ref \u2014 pass --since ");if(!S_(t,r))throw new Error(`changelog: '${r}' does not resolve to a commit in this repository \u2014 pass --since that exists. An unknown ref is an error, never a silently empty changelog.`)}function qge(t,e){let r=Df(t,["diff","--name-status",`${e}..HEAD`,"--","spec/"]),n=[];for(let i of r.split(` -`)){if(i.trim().length===0)continue;let o=i.split(" "),s=o[0]??"",a=o[1]??"",c=o.length>2?o[2]:a;if(!(!pH(c)&&!pH(a)))if(s.startsWith("A")){let l=w_(x_(t,c));if(!l)continue;l.status==="done"?n.push(ul(l,"added-as-done")):l.status==="archived"&&n.push(ul(l,"archived"))}else if(s.startsWith("D")){let l=w_(EO(t,e,a));l&&n.push(ul(l,"archived"))}else{let l=w_(x_(t,c));if(!l)continue;let d=w_(EO(t,e,a))?.status;l.status==="done"&&d!=="done"?n.push(ul(l,"flipped-to-done")):l.status==="done"&&d==="done"?n.push(ul(l,"modified-while-done")):l.status==="archived"&&d!=="archived"&&n.push(ul(l,"archived"))}}return n.sort((i,o)=>i.id.localeCompare(o.id)),n}function pH(t){return t.startsWith("spec/features/")&&(t.endsWith(".yaml")||t.endsWith(".yml"))}function ul(t,e){return{acceptance:(t.acceptance_criteria??[]).map(n=>AO(n)).filter(n=>n!==null),change:e,id:t.id,...t.slug?{slug:t.slug}:{},title:t.title}}function w_(t){if(t===null)return null;let e;try{e=(0,$_.parse)(t)}catch{return null}let r=e;return!r||typeof r.id!="string"||typeof r.status!="string"?null:{id:r.id,slug:typeof r.slug=="string"?r.slug:void 0,title:typeof r.title=="string"?r.title:r.id,status:r.status,acceptance_criteria:r.acceptance_criteria}}function x_(t,e){let r=hH(t,e);if(!Lge(r))return null;try{return zge(r,"utf8")}catch{return null}}function EO(t,e,r){try{return Df(t,["show",`${e}:${r}`])}catch{return null}}function Bge(t,e){let r=Hge(t).filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=[],i=new Set;for(let s of r){let a=new Set(s.features??[]),c=e.filter(l=>a.has(l.id)&&!i.has(l.id));if(c.length!==0){for(let l of c)i.add(l.id);n.push({capability:s.id,features:c,title:s.title??s.id})}}let o=e.filter(s=>!i.has(s.id));return o.length>0&&n.push({capability:"uncategorized",features:o,title:"Uncategorized"}),n}function Hge(t){let e=x_(t,hH("spec","capabilities.yaml"));if(e===null)return[];try{let r=(0,$_.parse)(e);return Array.isArray(r?.capabilities)?r.capabilities:[]}catch{return[]}}function mH(t){let e={};if(t!==null)try{let n=(0,$_.parse)(t);n&&typeof n.inventory=="object"&&n.inventory!==null&&(e=n.inventory)}catch{}let r=n=>typeof e[n]=="number"?e[n]:0;return{capabilities:r("capabilities"),features:r("features"),scenarios:r("scenarios"),test_files:r("test_files")}}function Vge(t,e){let r=Df(t,["log",`${e}..HEAD`,"--format=%h%x09%s","--","src/"]),n=[];for(let i of r.split(` +`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=g_(e),n=ll(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=g_(e),n=ll(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};oH.Parser=SO});var uH=v(Df=>{"use strict";var sH=cO(),yge=kf(),Cf=Tf(),_ge=sT(),bge=De(),vge=vO(),aH=wO();function cH(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new vge.LineCounter||null,prettyErrors:e}}function Sge(t,e={}){let{lineCounter:r,prettyErrors:n}=cH(e),i=new aH.Parser(r?.addNewLine),o=new sH.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(Cf.prettifyError(t,r)),a.warnings.forEach(Cf.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function lH(t,e={}){let{lineCounter:r,prettyErrors:n}=cH(e),i=new aH.Parser(r?.addNewLine),o=new sH.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Cf.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(Cf.prettifyError(t,r)),s.warnings.forEach(Cf.prettifyError(t,r))),s}function wge(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=lH(t,r);if(!i)return null;if(i.warnings.forEach(o=>_ge.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function xge(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return bge.isDocument(t)&&!n?t.toString(r):new yge.Document(t,n,r).toString(r)}Df.parse=wge;Df.parseAllDocuments=Sge;Df.parseDocument=lH;Df.stringify=xge});var er=v(Ze=>{"use strict";var $ge=cO(),kge=kf(),Ege=qT(),xO=Tf(),Age=lf(),ts=De(),Tge=Jo(),Oge=Dt(),Rge=Xo(),Ige=Qo(),Pge=m_(),Cge=_O(),Dge=vO(),Nge=wO(),__=uH(),dH=of();Ze.Composer=$ge.Composer;Ze.Document=kge.Document;Ze.Schema=Ege.Schema;Ze.YAMLError=xO.YAMLError;Ze.YAMLParseError=xO.YAMLParseError;Ze.YAMLWarning=xO.YAMLWarning;Ze.Alias=Age.Alias;Ze.isAlias=ts.isAlias;Ze.isCollection=ts.isCollection;Ze.isDocument=ts.isDocument;Ze.isMap=ts.isMap;Ze.isNode=ts.isNode;Ze.isPair=ts.isPair;Ze.isScalar=ts.isScalar;Ze.isSeq=ts.isSeq;Ze.Pair=Tge.Pair;Ze.Scalar=Oge.Scalar;Ze.YAMLMap=Rge.YAMLMap;Ze.YAMLSeq=Ige.YAMLSeq;Ze.CST=Pge;Ze.Lexer=Cge.Lexer;Ze.LineCounter=Dge.LineCounter;Ze.Parser=Nge.Parser;Ze.parse=__.parse;Ze.parseAllDocuments=__.parseAllDocuments;Ze.parseDocument=__.parseDocument;Ze.stringify=__.stringify;Ze.visit=dH.visit;Ze.visitAsync=dH.visitAsync});import{execFileSync as fH}from"node:child_process";import{existsSync as b_}from"node:fs";import{join as v_,resolve as jge}from"node:path";function Mge(t){try{let e=fH("git",["rev-parse","--git-dir"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return e?jge(t,e):null}catch{return null}}function $O(t){let e=Mge(t);if(!e)return null;try{if(b_(v_(e,"MERGE_HEAD")))return"merge";if(b_(v_(e,"CHERRY_PICK_HEAD")))return"cherry-pick";if(b_(v_(e,"rebase-merge"))||b_(v_(e,"rebase-apply")))return"rebase"}catch{return null}return null}function ya(t){return $O(t)!==null}function kO(t,e){try{let r=fH("git",["rev-parse","--verify","--quiet",`${e}^{commit}`],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return r.length>0?r:null}catch{return null}}function S_(t,e){return kO(t,e)!==null}var _a=y(()=>{"use strict"});import{execFileSync as Fge}from"node:child_process";import{existsSync as Lge,readFileSync as zge}from"node:fs";import{join as hH}from"node:path";function Nf(t,e){return Fge("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}function rs(t){try{let e=Nf(t,["describe","--tags","--abbrev=0"]).trim();if(e.length>0)return e}catch{}throw new Error("changelog: no git tag found to anchor the default range \u2014 pass --since explicitly (e.g. clad changelog --since v1.0.0)")}function ns(t,e){Uge(t,e);let r=Nf(t,["rev-parse","HEAD"]).trim(),n=qge(t,e);return{groups:Bge(t,n),head:r,inventory:{after:mH(x_(t,"spec.yaml")),before:mH(EO(t,e,"spec.yaml"))},since:e,unsharded_commits:Vge(t,e)}}function AO(t){if(t.text&&t.text.trim().length>0)return t.text.trim();let e=t.action?.trim();if(!e)return null;let r=t.condition?.trim(),n=t.response?.trim(),i=r?`${r.charAt(0).toUpperCase()}${r.slice(1)}, the system shall ${e}`:`The system shall ${e}`;return n?`${i} \u2014 ${n}.`:`${i}.`}function Uge(t,e){let r=(e??"").trim();if(r.length===0)throw new Error("changelog: empty since ref \u2014 pass --since ");if(!S_(t,r))throw new Error(`changelog: '${r}' does not resolve to a commit in this repository \u2014 pass --since that exists. An unknown ref is an error, never a silently empty changelog.`)}function qge(t,e){let r=Nf(t,["diff","--name-status",`${e}..HEAD`,"--","spec/"]),n=[];for(let i of r.split(` +`)){if(i.trim().length===0)continue;let o=i.split(" "),s=o[0]??"",a=o[1]??"",c=o.length>2?o[2]:a;if(!(!pH(c)&&!pH(a)))if(s.startsWith("A")){let l=w_(x_(t,c));if(!l)continue;l.status==="done"?n.push(ul(l,"added-as-done")):l.status==="archived"&&n.push(ul(l,"archived"))}else if(s.startsWith("D")){let l=w_(EO(t,e,a));l&&n.push(ul(l,"archived"))}else{let l=w_(x_(t,c));if(!l)continue;let d=w_(EO(t,e,a))?.status;l.status==="done"&&d!=="done"?n.push(ul(l,"flipped-to-done")):l.status==="done"&&d==="done"?n.push(ul(l,"modified-while-done")):l.status==="archived"&&d!=="archived"&&n.push(ul(l,"archived"))}}return n.sort((i,o)=>i.id.localeCompare(o.id)),n}function pH(t){return t.startsWith("spec/features/")&&(t.endsWith(".yaml")||t.endsWith(".yml"))}function ul(t,e){return{acceptance:(t.acceptance_criteria??[]).map(n=>AO(n)).filter(n=>n!==null),change:e,id:t.id,...t.slug?{slug:t.slug}:{},title:t.title}}function w_(t){if(t===null)return null;let e;try{e=(0,$_.parse)(t)}catch{return null}let r=e;return!r||typeof r.id!="string"||typeof r.status!="string"?null:{id:r.id,slug:typeof r.slug=="string"?r.slug:void 0,title:typeof r.title=="string"?r.title:r.id,status:r.status,acceptance_criteria:r.acceptance_criteria}}function x_(t,e){let r=hH(t,e);if(!Lge(r))return null;try{return zge(r,"utf8")}catch{return null}}function EO(t,e,r){try{return Nf(t,["show",`${e}:${r}`])}catch{return null}}function Bge(t,e){let r=Hge(t).filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=[],i=new Set;for(let s of r){let a=new Set(s.features??[]),c=e.filter(l=>a.has(l.id)&&!i.has(l.id));if(c.length!==0){for(let l of c)i.add(l.id);n.push({capability:s.id,features:c,title:s.title??s.id})}}let o=e.filter(s=>!i.has(s.id));return o.length>0&&n.push({capability:"uncategorized",features:o,title:"Uncategorized"}),n}function Hge(t){let e=x_(t,hH("spec","capabilities.yaml"));if(e===null)return[];try{let r=(0,$_.parse)(e);return Array.isArray(r?.capabilities)?r.capabilities:[]}catch{return[]}}function mH(t){let e={};if(t!==null)try{let n=(0,$_.parse)(t);n&&typeof n.inventory=="object"&&n.inventory!==null&&(e=n.inventory)}catch{}let r=n=>typeof e[n]=="number"?e[n]:0;return{capabilities:r("capabilities"),features:r("features"),scenarios:r("scenarios"),test_files:r("test_files")}}function Vge(t,e){let r=Nf(t,["log",`${e}..HEAD`,"--format=%h%x09%s","--","src/"]),n=[];for(let i of r.split(` `)){if(i.trim().length===0)continue;let o=i.indexOf(" ");if(o<0)continue;let s=i.slice(0,o),a=i.slice(o+1);Gge.test(a)&&(Zge.test(a)||n.push({hash:s,subject:a}))}return n}var $_,Gge,Zge,dl=y(()=>{"use strict";$_=St(er(),1);_a();Gge=/^(feat|fix)(\([^)]*\))?!?:/,Zge=/\bF-(\d{3,}|[a-f0-9]{6,})\b/});import{execFileSync as gH}from"node:child_process";import{appendFileSync as Wge,existsSync as TO,mkdirSync as Kge,readFileSync as Jge,renameSync as Yge,statSync as Xge}from"node:fs";import{userInfo as Qge}from"node:os";import{dirname as eye,join as RO}from"node:path";function IO(t){return RO(t,yH,tye)}function Qr(t,e){let r=IO(t),n=eye(r);TO(n)||Kge(n,{recursive:!0});try{TO(r)&&Xge(r).size>rye&&Yge(r,RO(n,_H))}catch{}Wge(r,`${JSON.stringify(e)} `,"utf8")}function OO(t){if(!TO(t))return[];let e=Jge(t,"utf8").trim();return e.length===0?[]:e.split(` -`).filter(r=>r.length>0).map(r=>JSON.parse(r))}function ba(t){return OO(IO(t))}function k_(t){return[...OO(RO(t,yH,_H)),...OO(IO(t))]}function en(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function nye(t){let e;try{e=gH("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=Qge().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function iye(t){try{return gH("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function Nf(t,e){try{let r=ba(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function tr(t,e,r){try{let n=iye(t),i=nye(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=Nf(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Qr(t,en(e,o))}catch{}}var yH,tye,_H,rye,Nr=y(()=>{"use strict";yH=".cladding",tye="events.log.jsonl",_H="events.log.1.jsonl",rye=5*1024*1024});import{execFileSync as oye}from"node:child_process";import{existsSync as bH,readdirSync as sye,readFileSync as aye,statSync as vH}from"node:fs";import{createHash as cye}from"node:crypto";import{join as PO}from"node:path";function va(t){try{return oye("git",["rev-parse","HEAD"],{cwd:t,stdio:["ignore","pipe","ignore"]}).toString("utf8").trim()||null}catch{return null}}function CO(t){let e=[],r=PO(t,"spec.yaml");bH(r)&&vH(r).isFile()&&e.push(r);for(let i of["features","scenarios"]){let o=PO(t,"spec",i);if(!(!bH(o)||!vH(o).isDirectory()))for(let s of sye(o))s.endsWith(".yaml")&&e.push(PO(o,s))}e.sort();let n=cye("sha256");for(let i of e){let o=i.slice(t.length+1);n.update(`${o}\0`),n.update(aye(i)),n.update("\0")}return n.digest("hex")}function E_(t,e){let r={featureId:e,gitHead:va(t),specDigest:CO(t),timestamp:new Date().toISOString()};return Qr(t,en("feature_checkpoint",{feature:e,git_head:r.gitHead,spec_digest:r.specDigest})),r}function A_(t,e){let r=ba(t);for(let n=r.length-1;n>=0;n--){let i=r[n];if(i.type==="feature_checkpoint"&&i.payload.feature===e)return{featureId:e,gitHead:i.payload.git_head??null,specDigest:String(i.payload.spec_digest??""),timestamp:i.timestamp}}return null}function T_(t,e,r,n){let i=en("feature_rolled_back",{feature:e,to_git_head:r.gitHead,to_spec_digest:r.specDigest,to_checkpoint_at:r.timestamp,reason:n??null});return Qr(t,i),i}var jf=y(()=>{"use strict";Nr()});import{readFileSync as lye,statSync as uye}from"node:fs";import{extname as dye,resolve as DO,sep as fye}from"node:path";function tn(t){return Math.ceil(t.length/4)}function hye(t,e){let r=DO(e),n=DO(r,t);return n===r||n.startsWith(r+fye)}function wH(t,e,r,n){if(!hye(t,e))return{path:t,omitted:"unsafe-path"};if(!pye.has(dye(t).toLowerCase()))return{path:t,omitted:"unsupported"};let i,o;if(n){let l=n(t);if(l==null)return{path:t,omitted:"missing"};if(i=l,o=Buffer.byteLength(l,"utf8"),o>SH)return{path:t,omitted:"too-large",bytes:o}}else{let l=DO(e,t);try{o=uye(l).size}catch{return{path:t,omitted:"missing"}}if(o>SH)return{path:t,omitted:"too-large",bytes:o};try{i=lye(l,"utf8")}catch{return{path:t,omitted:"missing",bytes:o}}}if(i.includes(mye))return{path:t,omitted:"binary",bytes:o};let s=Math.max(0,Math.floor(r));if(i.length<=s)return{path:t,text:i,bytes:o};let a=` +`).filter(r=>r.length>0).map(r=>JSON.parse(r))}function ba(t){return OO(IO(t))}function k_(t){return[...OO(RO(t,yH,_H)),...OO(IO(t))]}function en(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function nye(t){let e;try{e=gH("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=Qge().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function iye(t){try{return gH("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function jf(t,e){try{let r=ba(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function tr(t,e,r){try{let n=iye(t),i=nye(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=jf(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Qr(t,en(e,o))}catch{}}var yH,tye,_H,rye,Nr=y(()=>{"use strict";yH=".cladding",tye="events.log.jsonl",_H="events.log.1.jsonl",rye=5*1024*1024});import{execFileSync as oye}from"node:child_process";import{existsSync as bH,readdirSync as sye,readFileSync as aye,statSync as vH}from"node:fs";import{createHash as cye}from"node:crypto";import{join as PO}from"node:path";function va(t){try{return oye("git",["rev-parse","HEAD"],{cwd:t,stdio:["ignore","pipe","ignore"]}).toString("utf8").trim()||null}catch{return null}}function CO(t){let e=[],r=PO(t,"spec.yaml");bH(r)&&vH(r).isFile()&&e.push(r);for(let i of["features","scenarios"]){let o=PO(t,"spec",i);if(!(!bH(o)||!vH(o).isDirectory()))for(let s of sye(o))s.endsWith(".yaml")&&e.push(PO(o,s))}e.sort();let n=cye("sha256");for(let i of e){let o=i.slice(t.length+1);n.update(`${o}\0`),n.update(aye(i)),n.update("\0")}return n.digest("hex")}function E_(t,e){let r={featureId:e,gitHead:va(t),specDigest:CO(t),timestamp:new Date().toISOString()};return Qr(t,en("feature_checkpoint",{feature:e,git_head:r.gitHead,spec_digest:r.specDigest})),r}function A_(t,e){let r=ba(t);for(let n=r.length-1;n>=0;n--){let i=r[n];if(i.type==="feature_checkpoint"&&i.payload.feature===e)return{featureId:e,gitHead:i.payload.git_head??null,specDigest:String(i.payload.spec_digest??""),timestamp:i.timestamp}}return null}function T_(t,e,r,n){let i=en("feature_rolled_back",{feature:e,to_git_head:r.gitHead,to_spec_digest:r.specDigest,to_checkpoint_at:r.timestamp,reason:n??null});return Qr(t,i),i}var Mf=y(()=>{"use strict";Nr()});import{readFileSync as lye,statSync as uye}from"node:fs";import{extname as dye,resolve as DO,sep as fye}from"node:path";function tn(t){return Math.ceil(t.length/4)}function hye(t,e){let r=DO(e),n=DO(r,t);return n===r||n.startsWith(r+fye)}function wH(t,e,r,n){if(!hye(t,e))return{path:t,omitted:"unsafe-path"};if(!pye.has(dye(t).toLowerCase()))return{path:t,omitted:"unsupported"};let i,o;if(n){let l=n(t);if(l==null)return{path:t,omitted:"missing"};if(i=l,o=Buffer.byteLength(l,"utf8"),o>SH)return{path:t,omitted:"too-large",bytes:o}}else{let l=DO(e,t);try{o=uye(l).size}catch{return{path:t,omitted:"missing"}}if(o>SH)return{path:t,omitted:"too-large",bytes:o};try{i=lye(l,"utf8")}catch{return{path:t,omitted:"missing",bytes:o}}}if(i.includes(mye))return{path:t,omitted:"binary",bytes:o};let s=Math.max(0,Math.floor(r));if(i.length<=s)return{path:t,text:i,bytes:o};let a=` /* ... clipped (${o} bytes total) ... */ `,c=Math.max(0,s-a.length);return{path:t,text:i.slice(0,c)+a,truncated:!0,bytes:o}}var pye,SH,mye,O_=y(()=>{"use strict";pye=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".rs",".go",".java",".kt",".kts",".cs",".rb",".php",".swift",".c",".h",".cpp",".hpp",".css",".scss",".sql",".sh",".yaml",".yml",".json",".md",".toml"]),SH=2e6,mye="\0"});function yye(t){for(let i of gye)if(t.startsWith(i))return null;let e=t.indexOf("#"),n=(e>=0?t.slice(0,e):t).trim();return n.length>0?n:null}function NO(t,e,r){let n=t.get(e);n||(n=new Set,t.set(e,n)),n.add(r)}function _ye(t){let e=new Map,r=new Map,n=new Map;for(let i of t.features??[]){let o=i.id;for(let s of i.depends_on??[])NO(e,s,o);for(let s of i.modules??[])NO(r,s,o);for(let s of i.acceptance_criteria??[])for(let a of s.test_refs??[]){let c=yye(a);c&&NO(n,c,o)}}return{dependents:e,moduleOwners:r,testRefCitations:n}}function An(t){let e=xH.get(t);return e||(e=_ye(t),xH.set(t,e)),e}var gye,xH,Sa=y(()=>{"use strict";gye=["derived:","fixture:","script:","self-dogfood:"];xH=new WeakMap});function jO(t,e,r=1/0){let n=new Set,i=new Set(t),o=[...i],s=0;for(;o.length>0&&sn.id===e)??r.find(n=>n.slug===e)??null}function vr(t,e,r={}){let n=r.depth??1/0,i=An(t),o=new Map((t.features??[]).map(_=>[_.id,_])),s=[],a,c=bye(t,e);if(c)s=[c];else{let _=i.moduleOwners.get(e);_&&_.size>0&&(a=e,s=[..._].map(S=>o.get(S)).filter(S=>!!S))}if(s.length===0)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/spec/load.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (run clad sync if missing); module paths live in each shard\u2019s modules:; if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let l=s.map(_=>_.id),u=jO(l,i.dependents,n),d=[...u].map(_=>o.get(_)).filter(_=>!!_).map(_=>({id:_.id,title:_.title,status:_.status})).sort((_,S)=>_.id.localeCompare(S.id)),f=new Set([...l,...u]),p=[...f].map(_=>o.get(_)).filter(_=>!!_),m=[...new Set(p.flatMap(_=>_.modules??[]))].sort(),h=(t.scenarios??[]).filter(_=>(_.features??[]).some(S=>f.has(S))).map(_=>({id:_.id,title:_.title})).sort((_,S)=>_.id.localeCompare(S.id)),g=[...new Set(p.flatMap(_=>(_.acceptance_criteria??[]).flatMap(S=>S.test_refs??[])))].sort();return{focus:a?{module:a,owners:[...l].sort()}:{id:s[0].id,title:s[0].title,status:s[0].status},impacted:d,impacted_modules:m,scenarios:h,test_refs:g,ledger:MO(i)}}var wa=y(()=>{"use strict";Sa()});function $H(t){return t.impacted.length}function I_(t,e,r={}){let n=r.initialDepth??R_.initialDepth,i=r.maxDepth??R_.maxDepth,o=r.coverageThreshold??R_.coverageThreshold,s=r.marginYieldThreshold??R_.marginYieldThreshold,a=An(t),c=new Map((t.features??[]).map(b=>[b.id,b])),l=[],u=(t.features??[]).find(b=>b.id===e||b.slug===e);if(u)l=[u.id];else{let b=a.moduleOwners.get(e);b&&b.size>0&&(l=[...b].filter(_=>c.has(_)))}if(l.length===0){let b=vr(t,e,{depth:1});return"not_found"in b,b}let d=jO(l,a.dependents,1/0).size;if(d===0){let b=vr(t,e,{depth:n});return"not_found"in b?b:{slice:b,depthUsed:n,stoppedBy:"no-known-dependents",analysis:{frontierExhausted:!0,coverage:null,marginalYields:[0],totalKnownDependents:0}}}let f=[],p=0,m=null;for(let b=n;b<=i;b++){let _=vr(t,e,{depth:b});if("not_found"in _)return _;m=_;let S=$H(_),x=S-p,w=S>0?x/S:0;f.push(w);let O=d>0?S/d:1,T=x===0&&b>n,A={frontierExhausted:T,coverage:O,marginalYields:[...f],totalKnownDependents:d};if(T)return{slice:_,depthUsed:b,stoppedBy:"exhaustion",analysis:A};if(O>=o)return{slice:_,depthUsed:b,stoppedBy:"coverage",analysis:A};if(f.length>=2&&f[f.length-1]0?g/d:1,marginalYields:[...f],totalKnownDependents:d}}}var R_,FO=y(()=>{"use strict";wa();Sa();R_={initialDepth:1,maxDepth:10,coverageThreshold:.9,marginYieldThreshold:.05}});function vye(t,e){let r=new Set,n=[t];for(;n.length>0;){let i=n.pop();if(!i||r.has(i))continue;r.add(i);let o=e.get(i);for(let s of o?.depends_on??[])n.push(s)}return r}function kH(t,e){let r=new Map(t.features.map(a=>[a.id,a]));if(!r.has(e))return t;let n=vye(e,r),i=t.features.filter(a=>n.has(a.id)),o=(t.scenarios??[]).filter(a=>(a.features??[]).some(c=>n.has(c)));return{...t,features:i,scenarios:o}}var EH=y(()=>{"use strict"});function Sye(t,e){let r=t.features??[];return r.find(n=>n.id===e)??r.find(n=>n.slug===e)??r.find(n=>(n.modules??[]).includes(e))??null}function fl(t,e){let r=Sye(t,e);if(!r)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/auth/login.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (id, slug, status; run clad sync if missing); if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let n=kH(t,r.id),i=(n.features??[]).filter(c=>c.id!==r.id).map(c=>({id:c.id,title:c.title,status:c.status})).sort((c,l)=>c.id.localeCompare(l.id)),o=(n.scenarios??[]).map(c=>({id:c.id,title:c.title})).sort((c,l)=>c.id.localeCompare(l.id)),s=(t.project?.ai_hints?.preferred_patterns??[]).map(c=>({when:c.when,prefer:c.prefer,...c.over!==void 0?{over:c.over}:{}})),a=[...new Set((r.acceptance_criteria??[]).flatMap(c=>c.test_refs??[]))].sort();return{focus:r,ancestors:i,scenarios:o,preferred_patterns:s,test_refs:a}}var P_=y(()=>{"use strict";EH()});import{existsSync as TH,readdirSync as wye,readFileSync as xye}from"node:fs";import{join as zO}from"node:path";function UO(t,e=kye){let r=t.trim().replace(/\s+/g," ");return r.length<=e?r:`${r.slice(0,e-1)}\u2026`}function Eye(t){let e=t.payload??{};if(t.type==="drift_detected"){let n=typeof e.gate=="string"&&e.gate?e.gate:"drift";return{detector:n,message:UO(`drift detected at gate ${n}`)}}let r=typeof e.worst=="number"?` (worst ${e.worst})`:"";return{detector:"done_attempted",message:UO(`done reverted \u2014 pre-push strict gate red${r}`)}}function AH(t){let e=Date.parse(t.timestamp);return Number.isFinite(e)?e:0}function Aye(t){let e=[];t.lastFailedGate&&e.push(`failed ${t.lastFailedGate}`),typeof t.retryCount=="number"&&e.push(`${t.retryCount} retries`);let r=e.length?` (${e.join(", ")})`:"",n=t.recovery?`recover: ${t.recovery}${r}`:`rolled back${r}`;return UO(n)}function Tye(t,e,r,n={}){let i=t.filter(m=>m&&m.payload&&m.payload.feature===r),o=e.filter(m=>m&&m.featureId===r).slice().sort((m,h)=>AH(m)-AH(h)),s=i.filter(m=>m.type==="drift_detected"||m.type==="done_attempted"&&m.payload.kept===!1),a=i.filter(m=>m.type==="feature_rolled_back");if(s.length===0&&a.length===0&&o.length===0)return;let c=o.length?o[o.length-1]:void 0,l;for(let m=s.length-1;m>=0;m--){let h=s[m].payload.gate;if(s[m].type==="drift_detected"&&typeof h=="string"&&h){l=h;break}}!l&&c?.lastFailedGate&&(l=c.lastFailedGate);let u=s.slice(-$ye).map(Eye),d;for(let m=a.length-1;m>=0;m--){let h=a[m].payload.to_git_head;if(typeof h=="string"&&h){d=h;break}}let f=typeof c?.retryCount=="number"?c.retryCount:void 0,p=c?Aye(c):void 0;return{attempts:s.length,...l?{last_failed_gate:l}:{},...f!==void 0?{retry_count:f}:{},...u.length?{drift_history:u}:{},...d?{rolled_back_at:d}:{},...p?{recovery_hint:p}:{},...n.truncated?{truncated_history:!0}:{}}}function LO(t,e){let r=t.match(e);return r&&r[1]?r[1].trim():void 0}function Oye(t){let e=t.indexOf("## Recommended recovery");if(e<0)return;let r=t.slice(e).match(/```[^\n]*\n([\s\S]*?)```/);return r&&r[1].split(` `).map(i=>i.trim()).find(i=>i.length>0)||void 0}function Rye(t,e,r){let n=LO(t,/_Rolled back at_\s*`([^`]+)`/),i=LO(t,/Last failed gate:\s*`([^`]+)`/),o=LO(t,/Retry attempts:\s*(\d+)/),s=Oye(t);return{featureId:e,timestamp:n??r,...i?{lastFailedGate:i}:{},...o?{retryCount:Number(o)}:{},...s?{recovery:s}:{}}}function Iye(t,e){let r=zO(t,".cladding","post-mortems");if(!TH(r))return[];let n=`post-mortem-${e}-`,i=[];for(let o of wye(r))if(!(!o.startsWith(n)||!o.endsWith(".md")))try{i.push(Rye(xye(zO(r,o),"utf8"),e,o))}catch{}return i}function OH(t,e){try{let r=k_(t),n=Iye(t,e),i=TH(zO(t,".cladding","events.log.1.jsonl"));return Tye(r,n,e,{truncated:i})}catch{return}}var $ye,kye,RH=y(()=>{"use strict";Nr();$ye=5,kye=120});function C_(t,e,r){return tn(JSON.stringify({...t,needs:e,must_edit:{...t.must_edit,code:r}}))}function xa(t,e,r={}){let n=r.cwd??".",i=r.maxTokens&&r.maxTokens>0?r.maxTokens:Pye,o=e,s,a=An(t).moduleOwners.get(e);if(a&&a.size>0){let se=[...a].sort();o=se[0],se.length>1&&(s=se)}let c=fl(t,o);if("not_found"in c)return c;let l=c.focus,u=OH(n,l.id),d=a&&a.size>0?e:l.id,f=I_(t,d),p="not_found"in f?null:f.slice,m=p?p.impacted:[],h=p?p.test_refs:[],g="not_found"in f?null:{depth:f.depthUsed,stopped_by:f.stoppedBy,coverage:f.analysis.coverage===null?null:Math.round(f.analysis.coverage*100)/100,total_known_dependents:f.analysis.totalKnownDependents},b=l.acceptance_criteria??[],_=b.filter(se=>se.ears==="unwanted"||se.ears==="state").map(se=>({id:se.id,ears:String(se.ears)})),S=[...new Set(b.flatMap(se=>se.oracle_refs??[]))].sort(),x=[],w={must_edit:{id:l.id,title:l.title,status:l.status,modules:l.modules??[],acceptance_criteria:b,code:[],...s?{co_owners:s}:{}},needs:c.ancestors,breaks_if_changed:{impacted:m,regression_tests:h,...g?{radius:g}:{}},verify:{scenarios:c.scenarios,test_refs:c.test_refs,oracle_refs:S,high_risk_acs:_},guidance:{preferred_patterns:c.preferred_patterns},budget:{max_tokens:i,used_tokens:0,truncated:x}},O=[...c.ancestors];for(;O.length>Cye&&C_(w,O,[])>i;)O.pop();O.lengthi){x.push(`code: omitted ${se} (budget)`);continue}A.push(Kt),Kt.truncated&&x.push(`code: clipped ${se}`)}T>i&&x.push("must-edit exceeds budget \u2014 retained in full (focus is never dropped)");let D=(se,Ce)=>({impacted:se,regression_tests:Ce,...g?{radius:g}:{},...p?.ledger?{ledger:p.ledger}:{}}),$=(se,Ce,Kt,dr)=>{let Xt=Kt+dr>0?[`breaks: omitted ${Kt} feature(s) / ${dr} test(s)`]:[],lo={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:D(se,Ce),budget:{...w.budget,truncated:[...x,...Xt]}};return tn(JSON.stringify(lo))>i},ie=m,K=h;if($(ie,K,0,0)){let se=vr(t,d,{depth:1}),Ce=new Set("not_found"in se?[]:se.impacted.map(de=>de.id)),Kt=new Set("not_found"in se?[]:se.test_refs),Xt=[...m.filter(de=>Ce.has(de.id)),...m.filter(de=>!Ce.has(de.id))],lo=0;for(;Xt.length>Ce.size&&$(Xt,K,lo,0);)Xt=Xt.slice(0,-1),lo++;let $i=[...h],Xr=0;for(;$(Xt,$i,lo,Xr);){let de=-1;for(let uo=$i.length-1;uo>=0;uo--)if(!Kt.has($i[uo])){de=uo;break}if(de<0)break;$i.splice(de,1),Xr++}ie=Xt,K=$i,lo+Xr>0&&x.push(`breaks: omitted ${lo} feature(s) / ${Xr} test(s)`),$(ie,K,0,0)&&x.push("breaks: direct set retained in full \u2014 exceeds budget")}let xe=D(ie,K),C={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:xe},P=C;if(u){let se={...C,prior_attempts:u};tn(JSON.stringify(se))<=i?P=se:x.push("prior_attempts: omitted (budget)")}let Ir=tn(JSON.stringify(P));return{...P,budget:{max_tokens:i,used_tokens:Ir,truncated:x}}}var Pye,Cye,D_=y(()=>{"use strict";O_();P_();FO();RH();wa();Sa();Pye=3e3,Cye=3});function Yn(t){if(t.length===0)return 0;let e=[...t].sort((n,i)=>n-i),r=Math.floor(e.length/2);return e.length%2?e[r]:(e[r-1]+e[r])/2}function Dye(t,e){if(t.length===0)return 0;let r=[...t].sort((n,i)=>n-i);return r[Math.min(r.length-1,Math.floor(e/100*r.length))]}function IH(t,e,r="."){let n=An(t),i=t.features??[],o=[];for(let f of i){let p=xa(t,f.id,{cwd:r,read:e});if("not_found"in p)continue;let m=xa(t,f.id,{cwd:r,read:e,maxTokens:Number.MAX_SAFE_INTEGER}),h=I_(t,f.id),g=!("not_found"in h),b=tn(JSON.stringify(p)),_="not_found"in m?b:tn(JSON.stringify(m)),S=tn(JSON.stringify(f));for(let O of f.modules??[]){let T=e(O);T&&(S+=tn(T))}let x=(f.depends_on??[]).length,w=n.dependents.get(f.id)?.size??0;o.push({id:f.id,sliceTokens:b,structuralTokens:_,naiveTokens:S,contextRatio:S>0?b/S:1,budgetSaturated:p.budget.truncated.length>0,searchDepth:g?h.depthUsed:1,edgesResolved:x+w,stoppedBy:g?h.stoppedBy:"n/a",coverage:g?h.analysis.coverage:1,regressionTests:p.breaks_if_changed.regression_tests.length})}o.sort((f,p)=>f.id.localeCompare(p.id));let s=o.map(f=>f.contextRatio),a=f=>f.filter(p=>p.sliceTokens>0).map(p=>p.naiveTokens/p.sliceTokens),c=o.filter(f=>!f.budgetSaturated),l=o.filter(f=>f.budgetSaturated),u=o.filter(f=>f.naiveTokens>0).map(f=>f.structuralTokens/f.naiveTokens),d={};for(let f of o)d[f.stoppedBy]=(d[f.stoppedBy]??0)+1;return{featureCount:i.length,measured:o.length,context:{medianContextRatio:Math.round(Yn(s)*1e3)/1e3,medianShrinkFactor:Math.round(Yn(a(o))*10)/10,fitsCount:c.length,truncatedCount:l.length,medianShrinkFit:Math.round(Yn(a(c))*10)/10,medianShrinkTruncated:Math.round(Yn(a(l))*10)/10,medianStructuralRatio:Math.round(Yn(u)*100)/100,medianSliceTokens:Math.round(Yn(o.map(f=>f.sliceTokens))),medianNaiveTokens:Math.round(Yn(o.map(f=>f.naiveTokens)))},search:{medianDepth:Yn(o.map(f=>f.searchDepth)),p95Depth:Dye(o.map(f=>f.searchDepth),95),medianEdges:Yn(o.map(f=>f.edgesResolved)),maxEdges:o.reduce((f,p)=>Math.max(f,p.edgesResolved),0)},stability:{byStopReason:d,medianCoverage:Math.round(Yn(o.map(f=>f.coverage).filter(f=>f!==null))*100)/100,medianRegressionTests:Yn(o.map(f=>f.regressionTests))},features:o}}var pl,N_=y(()=>{"use strict";O_();FO();D_();Sa();pl="(deterministic upper bound vs the shard+all-modules baseline \u2014 not an agent-adoption measurement)"});import{appendFileSync as Nye,existsSync as qO,mkdirSync as jye,readFileSync as PH}from"node:fs";import{dirname as Mye,join as Fye}from"node:path";function BO(t){return Fye(t,Lye,zye)}function Uye(t,e){return{timestamp:new Date().toISOString(),head:va(t),spec_digest:CO(t),featureCount:e.featureCount,measured:e.measured,context:e.context,search:e.search,stability:e.stability}}function CH(t,e){try{let r=Uye(t,e);if(r.head===null)return{appended:!1,reason:"no_head"};let n=HO(t),i=n[n.length-1];if(i&&i.head===r.head&&i.spec_digest===r.spec_digest)return{appended:!1,reason:"deduped"};let o=BO(t),s=Mye(o);return qO(s)||jye(s,{recursive:!0}),Nye(o,`${JSON.stringify(r)} `,"utf8"),{appended:!0,reason:"appended"}}catch{return{appended:!1,reason:"error"}}}function DH(t){let e=[];for(let r of t.split(` -`)){let n=r.trim();if(n.length!==0)try{let i=JSON.parse(n);i&&typeof i=="object"&&i.context&&i.search&&i.stability&&e.push(i)}catch{}}return e}function HO(t,e){let r=BO(t);if(!qO(r))return[];let n;try{n=PH(r,"utf8")}catch{return[]}let i=DH(n);return typeof e=="number"&&e>=0?i.slice(-e):i}function NH(t){let e=BO(t);if(!qO(e))return{snapshots:[],unreadable:!1};let r;try{r=PH(e,"utf8")}catch{return{snapshots:[],unreadable:!0}}let n=DH(r),i=r.trim().length>0;return{snapshots:n,unreadable:i&&n.length===0}}function Mf(t,e=0){let r=e>0?Math.round(t*10**e)/10**e:Math.round(t),n=r.toFixed(e);return r>0?`+${n}`:n}function jH(t,e=5){let r=Math.max(0,t.length-e),i=[`measure trend \xB7 last ${t.slice(r).length} of ${t.length} snapshot(s)`];for(let o=r;o0?t[o-1]:null,c=(d,f=0)=>a?` (${Mf(d(s)-d(a),f)})`:"",l=s.timestamp.slice(0,19),u=s.head?s.head.slice(0,7):"nogit";i.push(` ${l} ${u} \xB7 ${s.featureCount} feat \xB7 slice ${s.context.medianSliceTokens}${c(d=>d.context.medianSliceTokens)} \xB7 struct ${s.context.medianStructuralRatio.toFixed(2)}${c(d=>d.context.medianStructuralRatio,2)} \xB7 cov ${s.stability.medianCoverage.toFixed(2)}${c(d=>d.stability.medianCoverage,2)} \xB7 p95depth ${s.search.p95Depth}${c(d=>d.search.p95Depth)} \xB7 trunc ${s.context.truncatedCount}${c(d=>d.context.truncatedCount)}`)}return i.push(` ${pl}`),i.join(` -`)}var Lye,zye,Ff=y(()=>{"use strict";jf();N_();Lye=".cladding",zye="measure.jsonl"});import{existsSync as qye}from"node:fs";import{join as Bye}from"node:path";function ml(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${Hye[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` +`)){let n=r.trim();if(n.length!==0)try{let i=JSON.parse(n);i&&typeof i=="object"&&i.context&&i.search&&i.stability&&e.push(i)}catch{}}return e}function HO(t,e){let r=BO(t);if(!qO(r))return[];let n;try{n=PH(r,"utf8")}catch{return[]}let i=DH(n);return typeof e=="number"&&e>=0?i.slice(-e):i}function NH(t){let e=BO(t);if(!qO(e))return{snapshots:[],unreadable:!1};let r;try{r=PH(e,"utf8")}catch{return{snapshots:[],unreadable:!0}}let n=DH(r),i=r.trim().length>0;return{snapshots:n,unreadable:i&&n.length===0}}function Ff(t,e=0){let r=e>0?Math.round(t*10**e)/10**e:Math.round(t),n=r.toFixed(e);return r>0?`+${n}`:n}function jH(t,e=5){let r=Math.max(0,t.length-e),i=[`measure trend \xB7 last ${t.slice(r).length} of ${t.length} snapshot(s)`];for(let o=r;o0?t[o-1]:null,c=(d,f=0)=>a?` (${Ff(d(s)-d(a),f)})`:"",l=s.timestamp.slice(0,19),u=s.head?s.head.slice(0,7):"nogit";i.push(` ${l} ${u} \xB7 ${s.featureCount} feat \xB7 slice ${s.context.medianSliceTokens}${c(d=>d.context.medianSliceTokens)} \xB7 struct ${s.context.medianStructuralRatio.toFixed(2)}${c(d=>d.context.medianStructuralRatio,2)} \xB7 cov ${s.stability.medianCoverage.toFixed(2)}${c(d=>d.stability.medianCoverage,2)} \xB7 p95depth ${s.search.p95Depth}${c(d=>d.search.p95Depth)} \xB7 trunc ${s.context.truncatedCount}${c(d=>d.context.truncatedCount)}`)}return i.push(` ${pl}`),i.join(` +`)}var Lye,zye,Lf=y(()=>{"use strict";Mf();N_();Lye=".cladding",zye="measure.jsonl"});import{existsSync as qye}from"node:fs";import{join as Bye}from"node:path";function ml(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${Hye[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` `)}function FH(t){let e=t.snapshot,r=["## Measured (this release)",""];if(!e||!e.head)return r.push("not measured at this commit \u2014 run clad measure before tagging"),r.join(` -`);let n=e.context,i=e.stability;r.push(`- features measured: ${e.measured} of ${e.featureCount}`),r.push(`- median slice tokens: ${n.medianSliceTokens} vs ${n.medianNaiveTokens} naive`),r.push(`- median structural ratio: ${n.medianStructuralRatio.toFixed(2)}`),r.push(`- median coverage: ${i.medianCoverage.toFixed(2)}`),r.push(`- regression tests surfaced: ${i.medianRegressionTests}`);let o=t.sinceSnapshot;if(o){let s=t.sinceRef??(o.head?o.head.slice(0,7):"previous");r.push(`- since ${s}: slice ${Mf(n.medianSliceTokens-o.context.medianSliceTokens)} \xB7 struct ${Mf(n.medianStructuralRatio-o.context.medianStructuralRatio,2)} \xB7 cov ${Mf(i.medianCoverage-o.stability.medianCoverage,2)}`)}return r.push("",`head ${e.head.slice(0,7)} \xB7 spec_digest ${e.spec_digest}`,`reproduce: git checkout ${e.head} && clad measure`,"",pl),r.join(` +`);let n=e.context,i=e.stability;r.push(`- features measured: ${e.measured} of ${e.featureCount}`),r.push(`- median slice tokens: ${n.medianSliceTokens} vs ${n.medianNaiveTokens} naive`),r.push(`- median structural ratio: ${n.medianStructuralRatio.toFixed(2)}`),r.push(`- median coverage: ${i.medianCoverage.toFixed(2)}`),r.push(`- regression tests surfaced: ${i.medianRegressionTests}`);let o=t.sinceSnapshot;if(o){let s=t.sinceRef??(o.head?o.head.slice(0,7):"previous");r.push(`- since ${s}: slice ${Ff(n.medianSliceTokens-o.context.medianSliceTokens)} \xB7 struct ${Ff(n.medianStructuralRatio-o.context.medianStructuralRatio,2)} \xB7 cov ${Ff(i.medianCoverage-o.stability.medianCoverage,2)}`)}return r.push("",`head ${e.head.slice(0,7)} \xB7 spec_digest ${e.spec_digest}`,`reproduce: git checkout ${e.head} && clad measure`,"",pl),r.join(` `)}function hl(t,e,r){let n=[`# Audit \u2014 shipped changes since ${t.since}`,"","| feature | AC | EARS | verification refs |","|---|---|---|---|"],i=new Map(e.features.map(o=>[o.id,o]));for(let o of t.groups)for(let s of o.features){let a=i.get(s.id);if(!a){n.push(`| ${s.id} | \u2014 | \u2014 | (removed from spec \u2014 see git history at ${t.since}) |`);continue}let c=a.acceptance_criteria??[];if(c.length===0){n.push(`| ${a.id} | \u2014 | \u2014 | (no acceptance criteria) |`);continue}for(let l of c)n.push(`| ${a.id} | ${l.id} | ${l.ears??"\u2014"} | ${Zye(l,r)} |`)}return n.join(` `)}function Zye(t,e){let r=[...t.test_refs??[],...t.oracle_refs??[],...t.evidence_refs??[]];return r.length===0?"(none)":r.map(n=>{for(let[o,s]of Gye)if(n.startsWith(o))return`${n} (${s})`;let i=n.split("#",1)[0]??n;return`${qye(Bye(e,i))?"\u2713":"\u2717"} ${n}`}).join("
")}function gl(t){let e=[`# ${t.project.name} \u2014 capability catalog`,""],r=[...t.capabilities??[]].filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=new Map(t.features.map(s=>[s.id,s])),i=new Set;for(let s of r){e.push(`## ${s.title??s.id}`,""),s.summary&&e.push(s.summary,"");for(let a of s.features??[]){let c=n.get(a);!c||c.status==="archived"||(i.add(a),MH(e,c))}}let o=t.features.filter(s=>!i.has(s.id)&&s.status!=="archived").sort((s,a)=>s.id.localeCompare(a.id));if(o.length>0){e.push("## Uncategorized","");for(let s of o)MH(e,s)}for(;e[e.length-1]==="";)e.pop();return e.join(` -`)}function MH(t,e){t.push(`### ${e.title}`,"");for(let r of e.acceptance_criteria??[]){let n=AO(r);n&&t.push(`- ${n}`)}t.push("")}var Hye,Gye,j_=y(()=>{"use strict";Ff();N_();dl();Hye={"added-as-done":"new","flipped-to-done":"completed","modified-while-done":"updated",archived:"retired"};Gye=[["derived:","machine-suggested \u2014 not author-confirmed"],["self-dogfood:","verified by cladding running on itself"],["fixture:","conformance fixture"],["script:","npm script"]]});import{readFileSync as Vye}from"node:fs";function Oi(t="./spec.yaml"){let e=Vye(t,"utf8");return(0,LH.parse)(e)}var LH,M_=y(()=>{"use strict";LH=St(er(),1)});var is=v((jr,WO)=>{"use strict";var GO=jr.ValidationError=function(e,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+UH(l)},"instance")):i!==void 0&&(this.property=i),e&&(this.message=e),n){var a=n.$id||n.id;this.schema=a||n}r!==void 0&&(this.instance=r),this.name=o,this.argument=s,this.stack=this.toString()};GO.prototype.toString=function(){return this.property+" "+this.message};var F_=jr.ValidatorResult=function(e,r,n,i){this.instance=e,this.schema=r,this.options=n,this.path=i.path,this.propertyPath=i.propertyPath,this.errors=[],this.throwError=n&&n.throwError,this.throwFirst=n&&n.throwFirst,this.throwAll=n&&n.throwAll,this.disableFormat=n&&n.disableFormat===!0};F_.prototype.addError=function(e){var r;if(typeof e=="string")r=new GO(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");r=new GO(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new $a(this);if(this.throwError)throw r;return r};F_.prototype.importErrors=function(e){typeof e=="string"||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))};function Wye(t,e){return e+": "+t.toString()+` -`}F_.prototype.toString=function(e){return this.errors.map(Wye).join("")};Object.defineProperty(F_.prototype,"valid",{get:function(){return!this.errors.length}});WO.exports.ValidatorResultError=$a;function $a(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$a),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}$a.prototype=new Error;$a.prototype.constructor=$a;$a.prototype.name="Validation Error";var zH=jr.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};zH.prototype=Object.create(Error.prototype,{constructor:{value:zH,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var ZO=jr.SchemaContext=function(e,r,n,i,o){this.schema=e,this.options=r,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce(function(s,a){return s+UH(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};ZO.prototype.resolve=function(e){return qH(this.base,e)};ZO.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=qH(this.base,i||"");var s=new ZO(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var Xn=jr.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(t){return typeof t=="string"&&parseFloat(t)===parseInt(t,10)&&!isNaN(t)},regex:function(t){var e=!0;try{new RegExp(t)}catch{e=!1}return e},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};Xn.regexp=Xn.regex;Xn.pattern=Xn.regex;Xn.ipv4=Xn["ip-address"];jr.isFormat=function(e,r,n){if(typeof e=="string"&&Xn[r]!==void 0){if(Xn[r]instanceof RegExp)return Xn[r].test(e);if(typeof Xn[r]=="function")return Xn[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var UH=jr.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};jr.deepCompareStrict=function t(e,r){if(typeof e!=typeof r)return!1;if(Array.isArray(e))return!Array.isArray(r)||e.length!==r.length?!1:e.every(function(o,s){return t(e[s],r[s])});if(typeof e=="object"){if(!e||!r)return e===r;var n=Object.keys(e),i=Object.keys(r);return n.length!==i.length?!1:n.every(function(o){return t(e[o],r[o])})}return e===r};function Kye(t,e,r,n){typeof r=="object"?e[n]=VO(t[n],r):t.indexOf(r)===-1&&e.push(r)}function Jye(t,e,r){e[r]=t[r]}function Yye(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=VO(t[n],e[n]):r[n]=e[n]}function VO(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(Kye.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(Jye.bind(null,t,n)),Object.keys(e).forEach(Yye.bind(null,t,e,n))),n}WO.exports.deepMerge=VO;jr.objectGetPath=function(e,r){for(var n=r.split("/").slice(1),i;typeof(i=n.shift())=="string";){var o=decodeURIComponent(i.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in e))return;e=e[o]}return e};function Xye(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}jr.encodePath=function(e){return e.map(Xye).join("")};jr.getDecimalPlaces=function(e){var r=0;if(isNaN(e))return r;typeof e!="number"&&(e=Number(e));var n=e.toString().split("e");if(n.length===2){if(n[1][0]!=="-")return r;r=Number(n[1].slice(1))}var i=n[0].split(".");return i.length===2&&(r+=i[1].length),r};jr.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var qH=jr.resolveUrl=function(e,r){let n=new URL(r,new URL(e,"resolve://"));if(n.protocol==="resolve:"){let{pathname:i,search:o,hash:s}=n;return i+o+s}return n.toString()}});var ZH=v((d7e,GH)=>{"use strict";var rn=is(),Le=rn.ValidatorResult,os=rn.SchemaError,KO={};KO.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var ze=KO.validators={};ze.type=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=Array.isArray(r.type)?r.type:[r.type];if(!s.some(this.testType.bind(this,e,r,n,i))){var a=s.map(function(c){if(c){var l=c.$id||c.id;return l?"<"+l+">":c+""}});o.addError({name:"type",argument:a,message:"is not of a type(s) "+a})}return o};function JO(t,e,r,n,i){var o=e.throwError,s=e.throwAll;e.throwError=!1,e.throwAll=!1;var a=this.validateSchema(t,i,e,r);return e.throwError=o,e.throwAll=s,!a.valid&&n instanceof Function&&n(a),a.valid}ze.anyOf=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=new Le(e,r,n,i);if(!Array.isArray(r.anyOf))throw new os("anyOf must be an array");if(!r.anyOf.some(JO.bind(this,e,n,i,function(c){s.importErrors(c)}))){var a=r.anyOf.map(function(c,l){var u=c.$id||c.id;return u?"<"+u+">":c.title&&JSON.stringify(c.title)||c.$ref&&"<"+c.$ref+">"||"[subschema "+l+"]"});n.nestedErrors&&o.importErrors(s),o.addError({name:"anyOf",argument:a,message:"is not any of "+a.join(",")})}return o};ze.allOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.allOf))throw new os("allOf must be an array");var o=new Le(e,r,n,i),s=this;return r.allOf.forEach(function(a,c){var l=s.validateSchema(e,a,n,i);if(!l.valid){var u=a.$id||a.id,d=u||a.title&&JSON.stringify(a.title)||a.$ref&&"<"+a.$ref+">"||"[subschema "+c+"]";o.addError({name:"allOf",argument:{id:d,length:l.errors.length,valid:l},message:"does not match allOf schema "+d+" with "+l.errors.length+" error[s]:"}),o.importErrors(l)}}),o};ze.oneOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.oneOf))throw new os("oneOf must be an array");var o=new Le(e,r,n,i),s=new Le(e,r,n,i),a=r.oneOf.filter(JO.bind(this,e,n,i,function(l){s.importErrors(l)})).length,c=r.oneOf.map(function(l,u){var d=l.$id||l.id;return d||l.title&&JSON.stringify(l.title)||l.$ref&&"<"+l.$ref+">"||"[subschema "+u+"]"});return a!==1&&(n.nestedErrors&&o.importErrors(s),o.addError({name:"oneOf",argument:c,message:"is not exactly one from "+c.join(",")})),o};ze.if=function(e,r,n,i){if(e===void 0)return null;if(!rn.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=JO.call(this,e,n,i,null,r.if),s=new Le(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!rn.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(e,r.then,n,i.makeChild(r.then)),s.importErrors(a)}else{if(r.else===void 0)return;if(!rn.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(e,r.else,n,i.makeChild(r.else)),s.importErrors(a)}return s};function YO(t,e){if(Object.hasOwnProperty.call(t,e))return t[e];if(e in t){for(;t=Object.getPrototypeOf(t);)if(Object.propertyIsEnumerable.call(t,e))return t[e]}}ze.propertyNames=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!rn.isSchema(s))throw new os('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(YO(e,a)!==void 0){var c=this.validateSchema(a,s,n,i.makeChild(s));o.importErrors(c)}return o}};ze.properties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.properties||{};for(var a in s){var c=s[a];if(c!==void 0){if(c===null)throw new os('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=YO(e,a),u=this.validateSchema(l,c,n,i.makeChild(c,a));u.instance!==o.instance[a]&&(o.instance[a]=u.instance),o.importErrors(u)}}return o}};function BH(t,e,r,n,i,o){if(this.types.object(t)&&!(e.properties&&e.properties[i]!==void 0))if(e.additionalProperties===!1)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var s=e.additionalProperties||{};typeof r.preValidateProperty=="function"&&r.preValidateProperty(t,i,s,r,n);var a=this.validateSchema(t[i],s,r,n.makeChild(s,i));a.instance!==o.instance[i]&&(o.instance[i]=a.instance),o.importErrors(a)}}ze.patternProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.patternProperties||{};for(var a in e){var c=!0;for(var l in s){var u=s[l];if(u!==void 0){if(u===null)throw new os('Unexpected null, expected schema in "patternProperties"');try{var d=new RegExp(l,"u")}catch{d=new RegExp(l)}if(d.test(a)){c=!1,typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,u,n,i);var f=this.validateSchema(e[a],u,n,i.makeChild(u,a));f.instance!==o.instance[a]&&(o.instance[a]=f.instance),o.importErrors(f)}}}c&&BH.call(this,e,r,n,i,a,o)}return o}};ze.additionalProperties=function(e,r,n,i){if(this.types.object(e)){if(r.patternProperties)return null;var o=new Le(e,r,n,i);for(var s in e)BH.call(this,e,r,n,i,s,o);return o}};ze.minProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=Object.keys(e);return s.length>=r.minProperties||o.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),o}};ze.maxProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=Object.keys(e);return s.length<=r.maxProperties||o.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),o}};ze.items=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.items!==void 0){var s=new Le(e,r,n,i);return e.every(function(a,c){if(Array.isArray(r.items))var l=r.items[c]===void 0?r.additionalItems:r.items[c];else var l=r.items;if(l===void 0)return!0;if(l===!1)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=o.validateSchema(a,l,n,i.makeChild(l,c));return u.instance!==s.instance[c]&&(s.instance[c]=u.instance),s.importErrors(u),!0}),s}};ze.contains=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.contains!==void 0){if(!rn.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new Le(e,r,n,i),a=e.some(function(c,l){var u=o.validateSchema(c,r.contains,n,i.makeChild(r.contains,l));return u.errors.length===0});return a===!1&&s.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),s}};ze.minimum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(e,r,n,i);return r.exclusiveMinimum&&r.exclusiveMinimum===!0?e>r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):e>=r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),o}};ze.maximum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(e,r,n,i);return r.exclusiveMaximum&&r.exclusiveMaximum===!0?er.exclusiveMinimum;return s||o.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),o}};ze.exclusiveMaximum=function(e,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(e)){var o=new Le(e,r,n,i),s=e=r.minLength||o.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),o}};ze.maxLength=function(e,r,n,i){if(this.types.string(e)){var o=new Le(e,r,n,i),s=e.match(/[\uDC00-\uDFFF]/g),a=e.length-(s?s.length:0);return a<=r.maxLength||o.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),o}};ze.minItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(e,r,n,i);return e.length>=r.minItems||o.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),o}};ze.maxItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(e,r,n,i);return e.length<=r.maxItems||o.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),o}};function Qye(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var XO=is();QO.exports.SchemaScanResult=VH;function VH(t,e){this.id=t,this.ref=e}QO.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=XO.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=XO.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!XO.deepCompareStrict(s[f],l))throw new Error("Schema <"+f+"> already exists with different definition");return s[f]}s[f]=l,f[f.length-1]=="#"&&(s[f.substring(0,f.length-1)]=l)}i(f+"/items",Array.isArray(l.items)?l.items:[l.items]),i(f+"/extends",Array.isArray(l.extends)?l.extends:[l.extends]),n(f+"/additionalItems",l.additionalItems),o(f+"/properties",l.properties),n(f+"/additionalProperties",l.additionalProperties),o(f+"/definitions",l.definitions),o(f+"/patternProperties",l.patternProperties),o(f+"/dependencies",l.dependencies),i(f+"/disallow",l.disallow),i(f+"/allOf",l.allOf),i(f+"/anyOf",l.anyOf),i(f+"/oneOf",l.oneOf),n(f+"/not",l.not)}function i(c,l){if(Array.isArray(l))for(var u=0;u{"use strict";var WH=ZH(),ss=is(),KH=L_().scan,JH=ss.ValidatorResult,e_e=ss.ValidatorResultError,Lf=ss.SchemaError,YH=ss.SchemaContext,t_e="/",Jt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(Ri),this.attributes=Object.create(WH.validators)};Jt.prototype.customFormats={};Jt.prototype.schemas=null;Jt.prototype.types=null;Jt.prototype.attributes=null;Jt.prototype.unresolvedRefs=null;Jt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=KH(r||t_e,e),o=r||e.$id||e.id;for(var s in i.id)this.schemas[s]=i.id[s];for(var s in i.ref)this.unresolvedRefs.push(s);return this.unresolvedRefs=this.unresolvedRefs.filter(function(a){return typeof n.schemas[a]>"u"}),this.schemas[o]};Jt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=ss.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new Lf("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Jt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new Lf('Unexpected null in "type" keyword');if(typeof this.types[o]=="function")return this.types[o].call(this,e);if(o&&typeof o=="object"){var s=this.validateSchema(e,o,n,i);return s===void 0||!(s&&s.errors.length)}return!0}};var Ri=Jt.prototype.types={};Ri.string=function(e){return typeof e=="string"};Ri.number=function(e){return typeof e=="number"&&isFinite(e)};Ri.integer=function(e){return typeof e=="number"&&e%1===0};Ri.boolean=function(e){return typeof e=="boolean"};Ri.array=function(e){return Array.isArray(e)};Ri.null=function(e){return e===null};Ri.date=function(e){return e instanceof Date};Ri.any=function(e){return!0};Ri.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};QH.exports=Jt});var tG=v((m7e,ho)=>{"use strict";var r_e=ho.exports.Validator=eG();ho.exports.ValidatorResult=is().ValidatorResult;ho.exports.ValidatorResultError=is().ValidatorResultError;ho.exports.ValidationError=is().ValidationError;ho.exports.SchemaError=is().SchemaError;ho.exports.SchemaScanResult=L_().SchemaScanResult;ho.exports.scan=L_().scan;ho.exports.validate=function(t,e,r){var n=new r_e;return n.validate(t,e,r)}});import{readFileSync as n_e}from"node:fs";import{dirname as i_e,join as o_e}from"node:path";import{fileURLToPath as s_e}from"node:url";function d_e(t){let e=u_e.validate(t,l_e);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function nG(t){let e=d_e(t);if(!e.valid)throw new Error(`spec.yaml invalid: +`)}function MH(t,e){t.push(`### ${e.title}`,"");for(let r of e.acceptance_criteria??[]){let n=AO(r);n&&t.push(`- ${n}`)}t.push("")}var Hye,Gye,j_=y(()=>{"use strict";Lf();N_();dl();Hye={"added-as-done":"new","flipped-to-done":"completed","modified-while-done":"updated",archived:"retired"};Gye=[["derived:","machine-suggested \u2014 not author-confirmed"],["self-dogfood:","verified by cladding running on itself"],["fixture:","conformance fixture"],["script:","npm script"]]});import{readFileSync as Vye}from"node:fs";function Oi(t="./spec.yaml"){let e=Vye(t,"utf8");return(0,LH.parse)(e)}var LH,M_=y(()=>{"use strict";LH=St(er(),1)});var is=v((jr,WO)=>{"use strict";var GO=jr.ValidationError=function(e,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+UH(l)},"instance")):i!==void 0&&(this.property=i),e&&(this.message=e),n){var a=n.$id||n.id;this.schema=a||n}r!==void 0&&(this.instance=r),this.name=o,this.argument=s,this.stack=this.toString()};GO.prototype.toString=function(){return this.property+" "+this.message};var F_=jr.ValidatorResult=function(e,r,n,i){this.instance=e,this.schema=r,this.options=n,this.path=i.path,this.propertyPath=i.propertyPath,this.errors=[],this.throwError=n&&n.throwError,this.throwFirst=n&&n.throwFirst,this.throwAll=n&&n.throwAll,this.disableFormat=n&&n.disableFormat===!0};F_.prototype.addError=function(e){var r;if(typeof e=="string")r=new GO(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");r=new GO(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new $a(this);if(this.throwError)throw r;return r};F_.prototype.importErrors=function(e){typeof e=="string"||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))};function Wye(t,e){return e+": "+t.toString()+` +`}F_.prototype.toString=function(e){return this.errors.map(Wye).join("")};Object.defineProperty(F_.prototype,"valid",{get:function(){return!this.errors.length}});WO.exports.ValidatorResultError=$a;function $a(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$a),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}$a.prototype=new Error;$a.prototype.constructor=$a;$a.prototype.name="Validation Error";var zH=jr.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};zH.prototype=Object.create(Error.prototype,{constructor:{value:zH,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var ZO=jr.SchemaContext=function(e,r,n,i,o){this.schema=e,this.options=r,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce(function(s,a){return s+UH(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};ZO.prototype.resolve=function(e){return qH(this.base,e)};ZO.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=qH(this.base,i||"");var s=new ZO(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var Xn=jr.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(t){return typeof t=="string"&&parseFloat(t)===parseInt(t,10)&&!isNaN(t)},regex:function(t){var e=!0;try{new RegExp(t)}catch{e=!1}return e},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};Xn.regexp=Xn.regex;Xn.pattern=Xn.regex;Xn.ipv4=Xn["ip-address"];jr.isFormat=function(e,r,n){if(typeof e=="string"&&Xn[r]!==void 0){if(Xn[r]instanceof RegExp)return Xn[r].test(e);if(typeof Xn[r]=="function")return Xn[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var UH=jr.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};jr.deepCompareStrict=function t(e,r){if(typeof e!=typeof r)return!1;if(Array.isArray(e))return!Array.isArray(r)||e.length!==r.length?!1:e.every(function(o,s){return t(e[s],r[s])});if(typeof e=="object"){if(!e||!r)return e===r;var n=Object.keys(e),i=Object.keys(r);return n.length!==i.length?!1:n.every(function(o){return t(e[o],r[o])})}return e===r};function Kye(t,e,r,n){typeof r=="object"?e[n]=VO(t[n],r):t.indexOf(r)===-1&&e.push(r)}function Jye(t,e,r){e[r]=t[r]}function Yye(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=VO(t[n],e[n]):r[n]=e[n]}function VO(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(Kye.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(Jye.bind(null,t,n)),Object.keys(e).forEach(Yye.bind(null,t,e,n))),n}WO.exports.deepMerge=VO;jr.objectGetPath=function(e,r){for(var n=r.split("/").slice(1),i;typeof(i=n.shift())=="string";){var o=decodeURIComponent(i.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in e))return;e=e[o]}return e};function Xye(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}jr.encodePath=function(e){return e.map(Xye).join("")};jr.getDecimalPlaces=function(e){var r=0;if(isNaN(e))return r;typeof e!="number"&&(e=Number(e));var n=e.toString().split("e");if(n.length===2){if(n[1][0]!=="-")return r;r=Number(n[1].slice(1))}var i=n[0].split(".");return i.length===2&&(r+=i[1].length),r};jr.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var qH=jr.resolveUrl=function(e,r){let n=new URL(r,new URL(e,"resolve://"));if(n.protocol==="resolve:"){let{pathname:i,search:o,hash:s}=n;return i+o+s}return n.toString()}});var ZH=v((d7e,GH)=>{"use strict";var rn=is(),Le=rn.ValidatorResult,os=rn.SchemaError,KO={};KO.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var ze=KO.validators={};ze.type=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=Array.isArray(r.type)?r.type:[r.type];if(!s.some(this.testType.bind(this,e,r,n,i))){var a=s.map(function(c){if(c){var l=c.$id||c.id;return l?"<"+l+">":c+""}});o.addError({name:"type",argument:a,message:"is not of a type(s) "+a})}return o};function JO(t,e,r,n,i){var o=e.throwError,s=e.throwAll;e.throwError=!1,e.throwAll=!1;var a=this.validateSchema(t,i,e,r);return e.throwError=o,e.throwAll=s,!a.valid&&n instanceof Function&&n(a),a.valid}ze.anyOf=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=new Le(e,r,n,i);if(!Array.isArray(r.anyOf))throw new os("anyOf must be an array");if(!r.anyOf.some(JO.bind(this,e,n,i,function(c){s.importErrors(c)}))){var a=r.anyOf.map(function(c,l){var u=c.$id||c.id;return u?"<"+u+">":c.title&&JSON.stringify(c.title)||c.$ref&&"<"+c.$ref+">"||"[subschema "+l+"]"});n.nestedErrors&&o.importErrors(s),o.addError({name:"anyOf",argument:a,message:"is not any of "+a.join(",")})}return o};ze.allOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.allOf))throw new os("allOf must be an array");var o=new Le(e,r,n,i),s=this;return r.allOf.forEach(function(a,c){var l=s.validateSchema(e,a,n,i);if(!l.valid){var u=a.$id||a.id,d=u||a.title&&JSON.stringify(a.title)||a.$ref&&"<"+a.$ref+">"||"[subschema "+c+"]";o.addError({name:"allOf",argument:{id:d,length:l.errors.length,valid:l},message:"does not match allOf schema "+d+" with "+l.errors.length+" error[s]:"}),o.importErrors(l)}}),o};ze.oneOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.oneOf))throw new os("oneOf must be an array");var o=new Le(e,r,n,i),s=new Le(e,r,n,i),a=r.oneOf.filter(JO.bind(this,e,n,i,function(l){s.importErrors(l)})).length,c=r.oneOf.map(function(l,u){var d=l.$id||l.id;return d||l.title&&JSON.stringify(l.title)||l.$ref&&"<"+l.$ref+">"||"[subschema "+u+"]"});return a!==1&&(n.nestedErrors&&o.importErrors(s),o.addError({name:"oneOf",argument:c,message:"is not exactly one from "+c.join(",")})),o};ze.if=function(e,r,n,i){if(e===void 0)return null;if(!rn.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=JO.call(this,e,n,i,null,r.if),s=new Le(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!rn.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(e,r.then,n,i.makeChild(r.then)),s.importErrors(a)}else{if(r.else===void 0)return;if(!rn.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(e,r.else,n,i.makeChild(r.else)),s.importErrors(a)}return s};function YO(t,e){if(Object.hasOwnProperty.call(t,e))return t[e];if(e in t){for(;t=Object.getPrototypeOf(t);)if(Object.propertyIsEnumerable.call(t,e))return t[e]}}ze.propertyNames=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!rn.isSchema(s))throw new os('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(YO(e,a)!==void 0){var c=this.validateSchema(a,s,n,i.makeChild(s));o.importErrors(c)}return o}};ze.properties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.properties||{};for(var a in s){var c=s[a];if(c!==void 0){if(c===null)throw new os('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=YO(e,a),u=this.validateSchema(l,c,n,i.makeChild(c,a));u.instance!==o.instance[a]&&(o.instance[a]=u.instance),o.importErrors(u)}}return o}};function BH(t,e,r,n,i,o){if(this.types.object(t)&&!(e.properties&&e.properties[i]!==void 0))if(e.additionalProperties===!1)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var s=e.additionalProperties||{};typeof r.preValidateProperty=="function"&&r.preValidateProperty(t,i,s,r,n);var a=this.validateSchema(t[i],s,r,n.makeChild(s,i));a.instance!==o.instance[i]&&(o.instance[i]=a.instance),o.importErrors(a)}}ze.patternProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.patternProperties||{};for(var a in e){var c=!0;for(var l in s){var u=s[l];if(u!==void 0){if(u===null)throw new os('Unexpected null, expected schema in "patternProperties"');try{var d=new RegExp(l,"u")}catch{d=new RegExp(l)}if(d.test(a)){c=!1,typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,u,n,i);var f=this.validateSchema(e[a],u,n,i.makeChild(u,a));f.instance!==o.instance[a]&&(o.instance[a]=f.instance),o.importErrors(f)}}}c&&BH.call(this,e,r,n,i,a,o)}return o}};ze.additionalProperties=function(e,r,n,i){if(this.types.object(e)){if(r.patternProperties)return null;var o=new Le(e,r,n,i);for(var s in e)BH.call(this,e,r,n,i,s,o);return o}};ze.minProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=Object.keys(e);return s.length>=r.minProperties||o.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),o}};ze.maxProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=Object.keys(e);return s.length<=r.maxProperties||o.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),o}};ze.items=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.items!==void 0){var s=new Le(e,r,n,i);return e.every(function(a,c){if(Array.isArray(r.items))var l=r.items[c]===void 0?r.additionalItems:r.items[c];else var l=r.items;if(l===void 0)return!0;if(l===!1)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=o.validateSchema(a,l,n,i.makeChild(l,c));return u.instance!==s.instance[c]&&(s.instance[c]=u.instance),s.importErrors(u),!0}),s}};ze.contains=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.contains!==void 0){if(!rn.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new Le(e,r,n,i),a=e.some(function(c,l){var u=o.validateSchema(c,r.contains,n,i.makeChild(r.contains,l));return u.errors.length===0});return a===!1&&s.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),s}};ze.minimum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(e,r,n,i);return r.exclusiveMinimum&&r.exclusiveMinimum===!0?e>r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):e>=r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),o}};ze.maximum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(e,r,n,i);return r.exclusiveMaximum&&r.exclusiveMaximum===!0?er.exclusiveMinimum;return s||o.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),o}};ze.exclusiveMaximum=function(e,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(e)){var o=new Le(e,r,n,i),s=e=r.minLength||o.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),o}};ze.maxLength=function(e,r,n,i){if(this.types.string(e)){var o=new Le(e,r,n,i),s=e.match(/[\uDC00-\uDFFF]/g),a=e.length-(s?s.length:0);return a<=r.maxLength||o.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),o}};ze.minItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(e,r,n,i);return e.length>=r.minItems||o.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),o}};ze.maxItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(e,r,n,i);return e.length<=r.maxItems||o.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),o}};function Qye(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var XO=is();QO.exports.SchemaScanResult=VH;function VH(t,e){this.id=t,this.ref=e}QO.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=XO.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=XO.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!XO.deepCompareStrict(s[f],l))throw new Error("Schema <"+f+"> already exists with different definition");return s[f]}s[f]=l,f[f.length-1]=="#"&&(s[f.substring(0,f.length-1)]=l)}i(f+"/items",Array.isArray(l.items)?l.items:[l.items]),i(f+"/extends",Array.isArray(l.extends)?l.extends:[l.extends]),n(f+"/additionalItems",l.additionalItems),o(f+"/properties",l.properties),n(f+"/additionalProperties",l.additionalProperties),o(f+"/definitions",l.definitions),o(f+"/patternProperties",l.patternProperties),o(f+"/dependencies",l.dependencies),i(f+"/disallow",l.disallow),i(f+"/allOf",l.allOf),i(f+"/anyOf",l.anyOf),i(f+"/oneOf",l.oneOf),n(f+"/not",l.not)}function i(c,l){if(Array.isArray(l))for(var u=0;u{"use strict";var WH=ZH(),ss=is(),KH=L_().scan,JH=ss.ValidatorResult,e_e=ss.ValidatorResultError,zf=ss.SchemaError,YH=ss.SchemaContext,t_e="/",Jt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(Ri),this.attributes=Object.create(WH.validators)};Jt.prototype.customFormats={};Jt.prototype.schemas=null;Jt.prototype.types=null;Jt.prototype.attributes=null;Jt.prototype.unresolvedRefs=null;Jt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=KH(r||t_e,e),o=r||e.$id||e.id;for(var s in i.id)this.schemas[s]=i.id[s];for(var s in i.ref)this.unresolvedRefs.push(s);return this.unresolvedRefs=this.unresolvedRefs.filter(function(a){return typeof n.schemas[a]>"u"}),this.schemas[o]};Jt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=ss.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new zf("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Jt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new zf('Unexpected null in "type" keyword');if(typeof this.types[o]=="function")return this.types[o].call(this,e);if(o&&typeof o=="object"){var s=this.validateSchema(e,o,n,i);return s===void 0||!(s&&s.errors.length)}return!0}};var Ri=Jt.prototype.types={};Ri.string=function(e){return typeof e=="string"};Ri.number=function(e){return typeof e=="number"&&isFinite(e)};Ri.integer=function(e){return typeof e=="number"&&e%1===0};Ri.boolean=function(e){return typeof e=="boolean"};Ri.array=function(e){return Array.isArray(e)};Ri.null=function(e){return e===null};Ri.date=function(e){return e instanceof Date};Ri.any=function(e){return!0};Ri.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};QH.exports=Jt});var tG=v((m7e,ho)=>{"use strict";var r_e=ho.exports.Validator=eG();ho.exports.ValidatorResult=is().ValidatorResult;ho.exports.ValidatorResultError=is().ValidatorResultError;ho.exports.ValidationError=is().ValidationError;ho.exports.SchemaError=is().SchemaError;ho.exports.SchemaScanResult=L_().SchemaScanResult;ho.exports.scan=L_().scan;ho.exports.validate=function(t,e,r){var n=new r_e;return n.validate(t,e,r)}});import{readFileSync as n_e}from"node:fs";import{dirname as i_e,join as o_e}from"node:path";import{fileURLToPath as s_e}from"node:url";function d_e(t){let e=u_e.validate(t,l_e);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function nG(t){let e=d_e(t);if(!e.valid)throw new Error(`spec.yaml invalid: ${e.errors.join(` `)}`)}var rG,a_e,c_e,l_e,u_e,iG=y(()=>{"use strict";rG=St(tG(),1),a_e=i_e(s_e(import.meta.url)),c_e=o_e(a_e,"schema.json"),l_e=JSON.parse(n_e(c_e,"utf8")),u_e=new rG.Validator});import{existsSync as eR,readdirSync as f_e}from"node:fs";import{dirname as p_e,join as ka,resolve as sG}from"node:path";function oG(t){return eR(t)?f_e(t).filter(r=>r.endsWith(".yaml")||r.endsWith(".yml")).map(r=>Oi(ka(t,r))):[]}function Ea(t,e){z_=e?{cwd:sG(t),spec:e}:null}function B(t=".",e="spec.yaml"){return z_&&e==="spec.yaml"&&sG(t)===z_.cwd?z_.spec:m_e(t,e)}function m_e(t,e){let r=ka(t,e),n=Oi(r),i=ka(t,p_e(e),"spec");if(!n.features||n.features.length===0){let o=oG(ka(i,"features"));o.length>0&&(n.features=o)}if(!n.scenarios||n.scenarios.length===0){let o=oG(ka(i,"scenarios"));o.length>0&&(n.scenarios=o)}if(!n.architecture){let o=ka(i,"architecture.yaml");eR(o)&&(n.architecture=Oi(o))}if(!n.capabilities||n.capabilities.length===0){let o=ka(i,"capabilities.yaml");if(eR(o)){let s=Oi(o);s&&Array.isArray(s.capabilities)&&(n.capabilities=s.capabilities)}}return nG(n),n}var z_,Ue=y(()=>{"use strict";M_();iG();z_=null});import yl from"node:process";function nR(){return!!yl.stdout.isTTY}function L(t,e,r=""){let n=aG[t],i=r?` ${r}`:"";nR()?yl.stdout.write(`${tR[t]}${n}${rR} ${e}${i} `):yl.stdout.write(`${n} ${e}${i} -`)}function zf(t,e,r=""){if(!nR())return;let n=r?` ${r}`:"";yl.stdout.write(`${cG}${tR.start}\xB7${rR} ${t} \xB7 ${e}${n}`)}function Aa(t,e,r=""){let n=aG[t],i=r?` ${r}`:"";nR()?yl.stdout.write(`${cG}${tR[t]}${n}${rR} ${e}${i} +`)}function Uf(t,e,r=""){if(!nR())return;let n=r?` ${r}`:"";yl.stdout.write(`${cG}${tR.start}\xB7${rR} ${t} \xB7 ${e}${n}`)}function Aa(t,e,r=""){let n=aG[t],i=r?` ${r}`:"";nR()?yl.stdout.write(`${cG}${tR[t]}${n}${rR} ${e}${i} `):yl.stdout.write(`${n} ${e}${i} `)}var aG,tR,rR,cG,Ii=y(()=>{"use strict";aG={start:"\xB7",pass:"\u2713",fail:"\u2717",skip:"\xB7",note:"\u2139"},tR={start:"\x1B[90m",pass:"\x1B[32m",fail:"\x1B[31m",skip:"\x1B[90m",note:"\x1B[36m"},rR="\x1B[0m",cG="\r\x1B[K"});import{createHash as OG}from"node:crypto";import{existsSync as Z_e,readFileSync as sR,writeFileSync as V_e}from"node:fs";import{join as U_}from"node:path";function W_e(t,e){let r=OG("sha256");for(let n of[...e].sort()){r.update(n),r.update("\0");try{r.update(sR(U_(t,n)))}catch{r.update("")}r.update("\0")}return r.digest("hex").slice(0,16)}function IG(t,e){let r=OG("sha256");try{r.update(sR(U_(t,e)))}catch{r.update("")}return r.digest("hex").slice(0,16)}function as(t){let e=U_(t,...RG);if(!Z_e(e))return null;let r;try{r=sR(e,"utf8")}catch{return null}let n=null,i=null,o=null,s="other";for(let a of r.split(` `)){if(a==="attested:"){s="v1",n??=new Map;continue}if(a==="attested_modules:"){s="modules",i??=new Map;continue}if(a==="attested_features:"){s="features",o??=new Set;continue}if(!(a.startsWith("#")||a.trim()==="")){if(s==="v1"){let c=a.match(/^ {2}(F-[\w-]+): ([0-9a-f]{16})$/);c&&n.set(c[1],c[2])}else if(s==="modules"){let c=a.match(/^ {2}(.+): ([0-9a-f]{16})$/);c&&i.set(c[1],c[2])}else if(s==="features"){let c=a.match(/^ {2}(F-[\w-]+): ok$/);c&&o.add(c[1])}}}return{v1:n,modules:i,features:o}}function q_(t){return t.features?.size??t.v1?.size??0}function B_(t,e,r){let n=r.modules??[];if(t.modules!==null||t.features!==null){if(!t.features?.has(r.id))return{state:"unattested"};let o=t.modules??new Map;for(let s of[...n].sort())if(o.get(s)!==IG(e,s))return{state:"stale",module:s};return{state:"fresh"}}let i=t.v1?.get(r.id);return i===void 0?{state:"unattested"}:i===W_e(e,n)?{state:"fresh"}:{state:"stale"}}function PG(t,e){let r=(e.features??[]).filter(a=>a.status==="done"&&(a.modules??[]).length>0);if(r.length===0)return!1;let n=new Set;for(let a of r)for(let c of a.modules??[])n.add(c);let i=[...n].sort().map(a=>` ${a}: ${IG(t,a)}`),o=r.map(a=>` ${a.id}: ok`).sort(),s=K_e+`attested_modules: @@ -196,7 +196,7 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus attested_features: `+o.join(` `)+` -`;return V_e(U_(t,...RG),s,"utf8"),!0}var RG,K_e,bl=y(()=>{"use strict";RG=["spec","attestation.yaml"];K_e=`# Cladding \xB7 Tier C \u2014 verification attestation (v2). Written ONLY by a GREEN +`;return V_e(U_(t,...RG),s,"utf8"),!0}var RG,K_e,vl=y(()=>{"use strict";RG=["spec","attestation.yaml"];K_e=`# Cladding \xB7 Tier C \u2014 verification attestation (v2). Written ONLY by a GREEN # \`clad check --tier=pre-push --strict\` gate \u2014 the file's one honest author. # Do not edit by hand. # @@ -211,53 +211,53 @@ attested_features: # Merge conflict here? NEVER hand-resolve the hashes \u2014 keep either side and run # \`clad check --tier=pre-push --strict\`; the GREEN gate rewrites the truth. # Content-anchored: survives fresh clones and squash/rebase. -`});import{resolve as aR}from"node:path";function H_(t){cs={cwd:aR(t),results:new Map}}function CG(t,e,r){!cs||cs.cwd!==aR(e)||cs.results.set(t,r)}function G_(t,e){return!cs||cs.cwd!==aR(e)?null:cs.results.get(t)??null}function Z_(){cs=null}var cs,vl=y(()=>{"use strict";cs=null});function Ot(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var yo=y(()=>{});import{fileURLToPath as J_e}from"node:url";var Sl,Y_e,cR,lR,wl=y(()=>{Sl=(t,e)=>{let r=lR(Y_e(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},Y_e=t=>cR(t)?t.toString():t,cR=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,lR=t=>t instanceof URL?J_e(t):t});var V_,uR=y(()=>{yo();wl();V_=(t,e=[],r={})=>{let n=Sl(t,"First argument"),[i,o]=Ot(e)?[[],e]:[e,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let s=i.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!Ot(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,s,o]}});import{StringDecoder as X_e}from"node:string_decoder";var DG,NG,qt,_o,Q_e,jG,ebe,W_,MG,tbe,Bf,rbe,dR,nbe,nn=y(()=>{({toString:DG}=Object.prototype),NG=t=>DG.call(t)==="[object ArrayBuffer]",qt=t=>DG.call(t)==="[object Uint8Array]",_o=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Q_e=new TextEncoder,jG=t=>Q_e.encode(t),ebe=new TextDecoder,W_=t=>ebe.decode(t),MG=(t,e)=>tbe(t,e).join(""),tbe=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new X_e(e),n=t.map(o=>typeof o=="string"?jG(o):o).map(o=>r.write(o)),i=r.end();return i===""?n:[...n,i]},Bf=t=>t.length===1&&qt(t[0])?t[0]:dR(rbe(t)),rbe=t=>t.map(e=>typeof e=="string"?jG(e):e),dR=t=>{let e=new Uint8Array(nbe(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},nbe=t=>{let e=0;for(let r of t)e+=r.length;return e}});import{ChildProcess as ibe}from"node:child_process";var UG,qG,obe,sbe,FG,abe,LG,zG,cbe,BG=y(()=>{yo();nn();UG=t=>Array.isArray(t)&&Array.isArray(t.raw),qG=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=obe({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},obe=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=sbe(i,t.raw[n]),c=LG(r,o,s);if(n===e.length)return c;let l=e[n],u=Array.isArray(l)?l.map(d=>zG(d)):[zG(l)];return LG(c,u,a)},sbe=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=FG.has(e[0]);for(let s=0,a=0;s{"use strict";cs=null});function Ot(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var yo=y(()=>{});import{fileURLToPath as J_e}from"node:url";var wl,Y_e,cR,lR,xl=y(()=>{wl=(t,e)=>{let r=lR(Y_e(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},Y_e=t=>cR(t)?t.toString():t,cR=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,lR=t=>t instanceof URL?J_e(t):t});var V_,uR=y(()=>{yo();xl();V_=(t,e=[],r={})=>{let n=wl(t,"First argument"),[i,o]=Ot(e)?[[],e]:[e,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let s=i.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!Ot(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,s,o]}});import{StringDecoder as X_e}from"node:string_decoder";var DG,NG,qt,_o,Q_e,jG,ebe,W_,MG,tbe,Bf,rbe,dR,nbe,nn=y(()=>{({toString:DG}=Object.prototype),NG=t=>DG.call(t)==="[object ArrayBuffer]",qt=t=>DG.call(t)==="[object Uint8Array]",_o=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Q_e=new TextEncoder,jG=t=>Q_e.encode(t),ebe=new TextDecoder,W_=t=>ebe.decode(t),MG=(t,e)=>tbe(t,e).join(""),tbe=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new X_e(e),n=t.map(o=>typeof o=="string"?jG(o):o).map(o=>r.write(o)),i=r.end();return i===""?n:[...n,i]},Bf=t=>t.length===1&&qt(t[0])?t[0]:dR(rbe(t)),rbe=t=>t.map(e=>typeof e=="string"?jG(e):e),dR=t=>{let e=new Uint8Array(nbe(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},nbe=t=>{let e=0;for(let r of t)e+=r.length;return e}});import{ChildProcess as ibe}from"node:child_process";var UG,qG,obe,sbe,FG,abe,LG,zG,cbe,BG=y(()=>{yo();nn();UG=t=>Array.isArray(t)&&Array.isArray(t.raw),qG=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=obe({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},obe=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=sbe(i,t.raw[n]),c=LG(r,o,s);if(n===e.length)return c;let l=e[n],u=Array.isArray(l)?l.map(d=>zG(d)):[zG(l)];return LG(c,u,a)},sbe=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=FG.has(e[0]);for(let s=0,a=0;sr||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],zG=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(Ot(t)&&("stdout"in t||"isMaxBuffer"in t))return cbe(t);throw t instanceof ibe||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},cbe=({stdout:t})=>{if(typeof t=="string")return t;if(qt(t))return W_(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)}});import fR from"node:process";var Qn,K_,Tn,J_,bo=y(()=>{Qn=t=>K_.includes(t),K_=[fR.stdin,fR.stdout,fR.stderr],Tn=["stdin","stdout","stderr"],J_=t=>Tn[t]??`stdio[${t}]`});import{debuglog as lbe}from"node:util";var GG,pR,ube,dbe,fbe,pbe,HG,mbe,mR,hbe,gbe,ybe,_be,hR,vo,So=y(()=>{yo();bo();GG=t=>{let e={...t};for(let r of hR)e[r]=pR(t,r);return e},pR=(t,e)=>{let r=Array.from({length:ube(t)+1}),n=dbe(t[e],r,e);return gbe(n,e)},ube=({stdio:t})=>Array.isArray(t)?Math.max(t.length,Tn.length):Tn.length,dbe=(t,e,r)=>Ot(t)?fbe(t,e,r):e.fill(t),fbe=(t,e,r)=>{for(let n of Object.keys(t).sort(pbe))for(let i of mbe(n,r,e))e[i]=t[n];return e},pbe=(t,e)=>HG(t)t==="stdout"||t==="stderr"?0:t==="all"?2:1,mbe=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=mR(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid. It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist. -Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},mR=t=>{if(t==="all")return t;if(Tn.includes(t))return Tn.indexOf(t);let e=hbe.exec(t);if(e!==null)return Number(e[1])},hbe=/^fd(\d+)$/,gbe=(t,e)=>t.map(r=>r===void 0?_be[e]:r),ybe=lbe("execa").enabled?"full":"none",_be={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:ybe,stripFinalNewline:!0},hR=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],vo=(t,e)=>e==="ipc"?t.at(-1):t[e]});var xl,$l,ZG,gR,bbe,Y_,X_,ls=y(()=>{So();xl=({verbose:t},e)=>gR(t,e)!=="none",$l=({verbose:t},e)=>!["none","short"].includes(gR(t,e)),ZG=({verbose:t},e)=>{let r=gR(t,e);return Y_(r)?r:void 0},gR=(t,e)=>e===void 0?bbe(t):vo(t,e),bbe=t=>t.find(e=>Y_(e))??X_.findLast(e=>t.includes(e)),Y_=t=>typeof t=="function",X_=["none","short","full"]});import{platform as vbe}from"node:process";import{stripVTControlCharacters as Sbe}from"node:util";var VG,Hf,WG,wbe,xbe,$be,kbe,Ebe,Abe,Tbe,Q_=y(()=>{VG=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>Abe(WG(o))).join(" ");return{command:n,escapedCommand:i}},Hf=t=>Sbe(t).split(` +Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},mR=t=>{if(t==="all")return t;if(Tn.includes(t))return Tn.indexOf(t);let e=hbe.exec(t);if(e!==null)return Number(e[1])},hbe=/^fd(\d+)$/,gbe=(t,e)=>t.map(r=>r===void 0?_be[e]:r),ybe=lbe("execa").enabled?"full":"none",_be={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:ybe,stripFinalNewline:!0},hR=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],vo=(t,e)=>e==="ipc"?t.at(-1):t[e]});var $l,kl,ZG,gR,bbe,Y_,X_,ls=y(()=>{So();$l=({verbose:t},e)=>gR(t,e)!=="none",kl=({verbose:t},e)=>!["none","short"].includes(gR(t,e)),ZG=({verbose:t},e)=>{let r=gR(t,e);return Y_(r)?r:void 0},gR=(t,e)=>e===void 0?bbe(t):vo(t,e),bbe=t=>t.find(e=>Y_(e))??X_.findLast(e=>t.includes(e)),Y_=t=>typeof t=="function",X_=["none","short","full"]});import{platform as vbe}from"node:process";import{stripVTControlCharacters as Sbe}from"node:util";var VG,Hf,WG,wbe,xbe,$be,kbe,Ebe,Abe,Tbe,Q_=y(()=>{VG=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>Abe(WG(o))).join(" ");return{command:n,escapedCommand:i}},Hf=t=>Sbe(t).split(` `).map(e=>WG(e)).join(` `),WG=t=>t.replaceAll($be,e=>wbe(e)),wbe=t=>{let e=kbe[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=Ebe?`\\u${n.padStart(4,"0")}`:`\\U${n}`},xbe=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},$be=xbe(),kbe={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Ebe=65535,Abe=t=>Tbe.test(t)?t:vbe==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,Tbe=/^[\w./-]+$/});import KG from"node:process";function yR(){let{env:t}=KG,{TERM:e,TERM_PROGRAM:r}=t;return KG.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var JG=y(()=>{});var YG,XG,Obe,Rbe,Ibe,Pbe,Cbe,eb,_Qe,QG=y(()=>{JG();YG={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},XG={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Obe={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Rbe={...YG,...XG},Ibe={...YG,...Obe},Pbe=yR(),Cbe=Pbe?Rbe:Ibe,eb=Cbe,_Qe=Object.entries(XG)});import Dbe from"node:tty";var Nbe,be,SQe,eZ,wQe,xQe,$Qe,kQe,EQe,AQe,TQe,OQe,RQe,IQe,PQe,CQe,DQe,NQe,jQe,tb,MQe,FQe,LQe,zQe,UQe,qQe,BQe,HQe,GQe,tZ,ZQe,rZ,VQe,WQe,KQe,JQe,YQe,XQe,QQe,eet,tet,ret,net,_R=y(()=>{Nbe=Dbe?.WriteStream?.prototype?.hasColors?.()??!1,be=(t,e)=>{if(!Nbe)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,c=0,u=(e===22?n:"")+r;for(;s!==-1;)a+=o.slice(c,s)+u,c=s+n.length,s=o.indexOf(n,c);return a+=o.slice(c)+n,a}},SQe=be(0,0),eZ=be(1,22),wQe=be(2,22),xQe=be(3,23),$Qe=be(4,24),kQe=be(53,55),EQe=be(7,27),AQe=be(8,28),TQe=be(9,29),OQe=be(30,39),RQe=be(31,39),IQe=be(32,39),PQe=be(33,39),CQe=be(34,39),DQe=be(35,39),NQe=be(36,39),jQe=be(37,39),tb=be(90,39),MQe=be(40,49),FQe=be(41,49),LQe=be(42,49),zQe=be(43,49),UQe=be(44,49),qQe=be(45,49),BQe=be(46,49),HQe=be(47,49),GQe=be(100,49),tZ=be(91,39),ZQe=be(92,39),rZ=be(93,39),VQe=be(94,39),WQe=be(95,39),KQe=be(96,39),JQe=be(97,39),YQe=be(101,49),XQe=be(102,49),QQe=be(103,49),eet=be(104,49),tet=be(105,49),ret=be(106,49),net=be(107,49)});var nZ=y(()=>{_R();_R()});var sZ,Mbe,rb,iZ,Fbe,oZ,Lbe,aZ=y(()=>{QG();nZ();sZ=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=Mbe(r),c=Fbe[t]({failed:o,reject:s,piped:n}),l=Lbe[t]({reject:s});return`${tb(`[${a}]`)} ${tb(`[${i}]`)} ${l(c)} ${l(e)}`},Mbe=t=>`${rb(t.getHours(),2)}:${rb(t.getMinutes(),2)}:${rb(t.getSeconds(),2)}.${rb(t.getMilliseconds(),3)}`,rb=(t,e)=>String(t).padStart(e,"0"),iZ=({failed:t,reject:e})=>t?e?eb.cross:eb.warning:eb.tick,Fbe={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:iZ,duration:iZ},oZ=t=>t,Lbe={command:()=>eZ,output:()=>oZ,ipc:()=>oZ,error:({reject:t})=>t?tZ:rZ,duration:()=>tb}});var cZ,zbe,Ube,lZ=y(()=>{ls();cZ=(t,e,r)=>{let n=ZG(e,r);return t.map(({verboseLine:i,verboseObject:o})=>zbe(i,o,n)).filter(i=>i!==void 0).map(i=>Ube(i)).join("")},zbe=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},Ube=t=>t.endsWith(` `)?t:`${t} -`});import{inspect as qbe}from"node:util";var Pi,Bbe,Hbe,Gbe,nb,Zbe,kl=y(()=>{Q_();aZ();lZ();Pi=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=Bbe({type:t,result:i,verboseInfo:n}),s=Hbe(e,o),a=cZ(s,n,r);a!==""&&console.warn(a.slice(0,-1))},Bbe=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:e,options:o}),Hbe=(t,e)=>t.split(` -`).map(r=>Gbe({...e,message:r})),Gbe=t=>({verboseLine:sZ(t),verboseObject:t}),nb=t=>{let e=typeof t=="string"?t:qbe(t);return Hf(e).replaceAll(" "," ".repeat(Zbe))},Zbe=2});var uZ,dZ=y(()=>{ls();kl();uZ=(t,e)=>{xl(e)&&Pi({type:"command",verboseMessage:t,verboseInfo:e})}});var fZ,Vbe,Wbe,Kbe,pZ=y(()=>{ls();fZ=(t,e,r)=>{Kbe(t);let n=Vbe(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},Vbe=t=>xl({verbose:t})?Wbe++:void 0,Wbe=0n,Kbe=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!X_.includes(e)&&!Y_(e)){let r=X_.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as mZ}from"node:process";var ib,bR,ob=y(()=>{ib=()=>mZ.bigint(),bR=t=>Number(mZ.bigint()-t)/1e6});var sb,vR=y(()=>{dZ();pZ();ob();Q_();So();sb=(t,e,r)=>{let n=ib(),{command:i,escapedCommand:o}=VG(t,e),s=pR(r,"verbose"),a=fZ(s,o,{...r});return uZ(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var bZ=v((Iet,_Z)=>{_Z.exports=yZ;yZ.sync=Ybe;var hZ=Ge("fs");function Jbe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{xZ.exports=SZ;SZ.sync=Xbe;var vZ=Ge("fs");function SZ(t,e,r){vZ.stat(t,function(n,i){r(n,n?!1:wZ(i,e))})}function Xbe(t,e){return wZ(vZ.statSync(t),e)}function wZ(t,e){return t.isFile()&&Qbe(t,e)}function Qbe(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===s||r&a&&n===o||r&u&&o===0;return d}});var EZ=v((Det,kZ)=>{var Cet=Ge("fs"),ab;process.platform==="win32"||global.TESTING_WINDOWS?ab=bZ():ab=$Z();kZ.exports=SR;SR.sync=eve;function SR(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){SR(t,e||{},function(o,s){o?i(o):n(s)})})}ab(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function eve(t,e){try{return ab.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var CZ=v((Net,PZ)=>{var El=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",AZ=Ge("path"),tve=El?";":":",TZ=EZ(),OZ=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),RZ=(t,e)=>{let r=e.colon||tve,n=t.match(/\//)||El&&t.match(/\\/)?[""]:[...El?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=El?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=El?i.split(r):[""];return El&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},IZ=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=RZ(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(OZ(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=AZ.join(p,t),h=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;u(c(h,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let m=i[d];TZ(l+m,{pathExt:o},(h,g)=>{if(!h&&g)if(e.all)s.push(l+m);else return f(l+m);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},rve=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=RZ(t,e),o=[];for(let s=0;s{"use strict";var DZ=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};wR.exports=DZ;wR.exports.default=DZ});var LZ=v((Met,FZ)=>{"use strict";var jZ=Ge("path"),nve=CZ(),ive=NZ();function MZ(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=nve.sync(t.command,{path:r[ive({env:r})],pathExt:e?jZ.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=jZ.resolve(i?t.options.cwd:"",s)),s}function ove(t){return MZ(t)||MZ(t,!0)}FZ.exports=ove});var zZ=v((Fet,$R)=>{"use strict";var xR=/([()\][%!^"`<>&|;, *?])/g;function sve(t){return t=t.replace(xR,"^$1"),t}function ave(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(xR,"^$1"),e&&(t=t.replace(xR,"^$1")),t}$R.exports.command=sve;$R.exports.argument=ave});var qZ=v((Let,UZ)=>{"use strict";UZ.exports=/^#!(.*)/});var HZ=v((zet,BZ)=>{"use strict";var cve=qZ();BZ.exports=(t="")=>{let e=t.match(cve);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var ZZ=v((Uet,GZ)=>{"use strict";var kR=Ge("fs"),lve=HZ();function uve(t){let r=Buffer.alloc(150),n;try{n=kR.openSync(t,"r"),kR.readSync(n,r,0,150,0),kR.closeSync(n)}catch{}return lve(r.toString())}GZ.exports=uve});var JZ=v((qet,KZ)=>{"use strict";var dve=Ge("path"),VZ=LZ(),WZ=zZ(),fve=ZZ(),pve=process.platform==="win32",mve=/\.(?:com|exe)$/i,hve=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function gve(t){t.file=VZ(t);let e=t.file&&fve(t.file);return e?(t.args.unshift(t.file),t.command=e,VZ(t)):t.file}function yve(t){if(!pve)return t;let e=gve(t),r=!mve.test(e);if(t.options.forceShell||r){let n=hve.test(e);t.command=dve.normalize(t.command),t.command=WZ.command(t.command),t.args=t.args.map(o=>WZ.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function _ve(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:yve(n)}KZ.exports=_ve});var QZ=v((Bet,XZ)=>{"use strict";var ER=process.platform==="win32";function AR(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function bve(t,e){if(!ER)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=YZ(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function YZ(t,e){return ER&&t===1&&!e.file?AR(e.original,"spawn"):null}function vve(t,e){return ER&&t===1&&!e.file?AR(e.original,"spawnSync"):null}XZ.exports={hookChildProcess:bve,verifyENOENT:YZ,verifyENOENTSync:vve,notFoundError:AR}});var r9=v((Het,Al)=>{"use strict";var e9=Ge("child_process"),TR=JZ(),OR=QZ();function t9(t,e,r){let n=TR(t,e,r),i=e9.spawn(n.command,n.args,n.options);return OR.hookChildProcess(i,n),i}function Sve(t,e,r){let n=TR(t,e,r),i=e9.spawnSync(n.command,n.args,n.options);return i.error=i.error||OR.verifyENOENTSync(i.status,n),i}Al.exports=t9;Al.exports.spawn=t9;Al.exports.sync=Sve;Al.exports._parse=TR;Al.exports._enoent=OR});function cb(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}var n9=y(()=>{});var i9=y(()=>{});import{promisify as wve}from"node:util";import{execFile as xve,execFileSync as Ket}from"node:child_process";import o9 from"node:path";import{fileURLToPath as $ve}from"node:url";function lb(t){return t instanceof URL?$ve(t):t}function s9(t){return{*[Symbol.iterator](){let e=o9.resolve(lb(t)),r;for(;r!==e;)yield e,r=e,e=o9.resolve(e,"..")}}}var Xet,Qet,a9=y(()=>{i9();Xet=wve(xve);Qet=10*1024*1024});import ub from"node:process";import Oa from"node:path";var kve,Eve,Ave,c9,l9=y(()=>{n9();a9();kve=({cwd:t=ub.cwd(),path:e=ub.env[cb()],preferLocal:r=!0,execPath:n=ub.execPath,addExecPath:i=!0}={})=>{let o=Oa.resolve(lb(t)),s=[],a=e.split(Oa.delimiter);return r&&Eve(s,a,o),i&&Ave(s,a,n,o),e===""||e===Oa.delimiter?`${s.join(Oa.delimiter)}${e}`:[...s,e].join(Oa.delimiter)},Eve=(t,e,r)=>{for(let n of s9(r)){let i=Oa.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},Ave=(t,e,r,n)=>{let i=Oa.resolve(n,lb(r),"..");e.includes(i)||t.push(i)},c9=({env:t=ub.env,...e}={})=>{t={...t};let r=cb({env:t});return e.path=t[r],t[r]=kve(e),t}});var u9,ei,d9,f9,p9,db,Gf,Zf,Ra=y(()=>{u9=(t,e,r)=>{let n=r?Zf:Gf,i=t instanceof ei?{}:{cause:t};return new n(e,i)},ei=class extends Error{},d9=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,p9,{value:!0,writable:!1,enumerable:!1,configurable:!1})},f9=t=>db(t)&&p9 in t,p9=Symbol("isExecaError"),db=t=>Object.prototype.toString.call(t)==="[object Error]",Gf=class extends Error{};d9(Gf,Gf.name);Zf=class extends Error{};d9(Zf,Zf.name)});var m9,Tve,h9,g9,y9=y(()=>{m9=()=>{let t=g9-h9+1;return Array.from({length:t},Tve)},Tve=(t,e)=>({name:`SIGRT${e+1}`,number:h9+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),h9=34,g9=64});var _9,b9=y(()=>{_9=[{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:!0},{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:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{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"}]});import{constants as Ove}from"node:os";var RR,Rve,v9=y(()=>{b9();y9();RR=()=>{let t=m9();return[..._9,...t].map(Rve)},Rve=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=Ove,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as Ive}from"node:os";var Pve,Cve,S9,Dve,Nve,jve,gtt,w9=y(()=>{v9();Pve=()=>{let t=RR();return Object.fromEntries(t.map(Cve))},Cve=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],S9=Pve(),Dve=()=>{let t=RR(),e=65,r=Array.from({length:e},(n,i)=>Nve(i,t));return Object.assign({},...r)},Nve=(t,e)=>{let r=jve(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:c}}},jve=(t,e)=>{let r=e.find(({name:n})=>Ive.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},gtt=Dve()});import{constants as Vf}from"node:os";var $9,k9,E9,Mve,Fve,x9,Lve,IR,zve,Uve,fb,Wf=y(()=>{w9();$9=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return E9(t,e)},k9=t=>t===0?t:E9(t,"`subprocess.kill()`'s argument"),E9=(t,e)=>{if(Number.isInteger(t))return Mve(t,e);if(typeof t=="string")return Lve(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. +`});import{inspect as qbe}from"node:util";var Pi,Bbe,Hbe,Gbe,nb,Zbe,El=y(()=>{Q_();aZ();lZ();Pi=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=Bbe({type:t,result:i,verboseInfo:n}),s=Hbe(e,o),a=cZ(s,n,r);a!==""&&console.warn(a.slice(0,-1))},Bbe=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:e,options:o}),Hbe=(t,e)=>t.split(` +`).map(r=>Gbe({...e,message:r})),Gbe=t=>({verboseLine:sZ(t),verboseObject:t}),nb=t=>{let e=typeof t=="string"?t:qbe(t);return Hf(e).replaceAll(" "," ".repeat(Zbe))},Zbe=2});var uZ,dZ=y(()=>{ls();El();uZ=(t,e)=>{$l(e)&&Pi({type:"command",verboseMessage:t,verboseInfo:e})}});var fZ,Vbe,Wbe,Kbe,pZ=y(()=>{ls();fZ=(t,e,r)=>{Kbe(t);let n=Vbe(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},Vbe=t=>$l({verbose:t})?Wbe++:void 0,Wbe=0n,Kbe=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!X_.includes(e)&&!Y_(e)){let r=X_.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as mZ}from"node:process";var ib,bR,ob=y(()=>{ib=()=>mZ.bigint(),bR=t=>Number(mZ.bigint()-t)/1e6});var sb,vR=y(()=>{dZ();pZ();ob();Q_();So();sb=(t,e,r)=>{let n=ib(),{command:i,escapedCommand:o}=VG(t,e),s=pR(r,"verbose"),a=fZ(s,o,{...r});return uZ(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var bZ=v((Iet,_Z)=>{_Z.exports=yZ;yZ.sync=Ybe;var hZ=Ge("fs");function Jbe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{xZ.exports=SZ;SZ.sync=Xbe;var vZ=Ge("fs");function SZ(t,e,r){vZ.stat(t,function(n,i){r(n,n?!1:wZ(i,e))})}function Xbe(t,e){return wZ(vZ.statSync(t),e)}function wZ(t,e){return t.isFile()&&Qbe(t,e)}function Qbe(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===s||r&a&&n===o||r&u&&o===0;return d}});var EZ=v((Det,kZ)=>{var Cet=Ge("fs"),ab;process.platform==="win32"||global.TESTING_WINDOWS?ab=bZ():ab=$Z();kZ.exports=SR;SR.sync=eve;function SR(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){SR(t,e||{},function(o,s){o?i(o):n(s)})})}ab(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function eve(t,e){try{return ab.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var CZ=v((Net,PZ)=>{var Al=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",AZ=Ge("path"),tve=Al?";":":",TZ=EZ(),OZ=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),RZ=(t,e)=>{let r=e.colon||tve,n=t.match(/\//)||Al&&t.match(/\\/)?[""]:[...Al?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=Al?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Al?i.split(r):[""];return Al&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},IZ=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=RZ(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(OZ(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=AZ.join(p,t),h=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;u(c(h,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let m=i[d];TZ(l+m,{pathExt:o},(h,g)=>{if(!h&&g)if(e.all)s.push(l+m);else return f(l+m);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},rve=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=RZ(t,e),o=[];for(let s=0;s{"use strict";var DZ=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};wR.exports=DZ;wR.exports.default=DZ});var LZ=v((Met,FZ)=>{"use strict";var jZ=Ge("path"),nve=CZ(),ive=NZ();function MZ(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=nve.sync(t.command,{path:r[ive({env:r})],pathExt:e?jZ.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=jZ.resolve(i?t.options.cwd:"",s)),s}function ove(t){return MZ(t)||MZ(t,!0)}FZ.exports=ove});var zZ=v((Fet,$R)=>{"use strict";var xR=/([()\][%!^"`<>&|;, *?])/g;function sve(t){return t=t.replace(xR,"^$1"),t}function ave(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(xR,"^$1"),e&&(t=t.replace(xR,"^$1")),t}$R.exports.command=sve;$R.exports.argument=ave});var qZ=v((Let,UZ)=>{"use strict";UZ.exports=/^#!(.*)/});var HZ=v((zet,BZ)=>{"use strict";var cve=qZ();BZ.exports=(t="")=>{let e=t.match(cve);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var ZZ=v((Uet,GZ)=>{"use strict";var kR=Ge("fs"),lve=HZ();function uve(t){let r=Buffer.alloc(150),n;try{n=kR.openSync(t,"r"),kR.readSync(n,r,0,150,0),kR.closeSync(n)}catch{}return lve(r.toString())}GZ.exports=uve});var JZ=v((qet,KZ)=>{"use strict";var dve=Ge("path"),VZ=LZ(),WZ=zZ(),fve=ZZ(),pve=process.platform==="win32",mve=/\.(?:com|exe)$/i,hve=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function gve(t){t.file=VZ(t);let e=t.file&&fve(t.file);return e?(t.args.unshift(t.file),t.command=e,VZ(t)):t.file}function yve(t){if(!pve)return t;let e=gve(t),r=!mve.test(e);if(t.options.forceShell||r){let n=hve.test(e);t.command=dve.normalize(t.command),t.command=WZ.command(t.command),t.args=t.args.map(o=>WZ.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function _ve(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:yve(n)}KZ.exports=_ve});var QZ=v((Bet,XZ)=>{"use strict";var ER=process.platform==="win32";function AR(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function bve(t,e){if(!ER)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=YZ(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function YZ(t,e){return ER&&t===1&&!e.file?AR(e.original,"spawn"):null}function vve(t,e){return ER&&t===1&&!e.file?AR(e.original,"spawnSync"):null}XZ.exports={hookChildProcess:bve,verifyENOENT:YZ,verifyENOENTSync:vve,notFoundError:AR}});var r9=v((Het,Tl)=>{"use strict";var e9=Ge("child_process"),TR=JZ(),OR=QZ();function t9(t,e,r){let n=TR(t,e,r),i=e9.spawn(n.command,n.args,n.options);return OR.hookChildProcess(i,n),i}function Sve(t,e,r){let n=TR(t,e,r),i=e9.spawnSync(n.command,n.args,n.options);return i.error=i.error||OR.verifyENOENTSync(i.status,n),i}Tl.exports=t9;Tl.exports.spawn=t9;Tl.exports.sync=Sve;Tl.exports._parse=TR;Tl.exports._enoent=OR});function cb(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}var n9=y(()=>{});var i9=y(()=>{});import{promisify as wve}from"node:util";import{execFile as xve,execFileSync as Ket}from"node:child_process";import o9 from"node:path";import{fileURLToPath as $ve}from"node:url";function lb(t){return t instanceof URL?$ve(t):t}function s9(t){return{*[Symbol.iterator](){let e=o9.resolve(lb(t)),r;for(;r!==e;)yield e,r=e,e=o9.resolve(e,"..")}}}var Xet,Qet,a9=y(()=>{i9();Xet=wve(xve);Qet=10*1024*1024});import ub from"node:process";import Oa from"node:path";var kve,Eve,Ave,c9,l9=y(()=>{n9();a9();kve=({cwd:t=ub.cwd(),path:e=ub.env[cb()],preferLocal:r=!0,execPath:n=ub.execPath,addExecPath:i=!0}={})=>{let o=Oa.resolve(lb(t)),s=[],a=e.split(Oa.delimiter);return r&&Eve(s,a,o),i&&Ave(s,a,n,o),e===""||e===Oa.delimiter?`${s.join(Oa.delimiter)}${e}`:[...s,e].join(Oa.delimiter)},Eve=(t,e,r)=>{for(let n of s9(r)){let i=Oa.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},Ave=(t,e,r,n)=>{let i=Oa.resolve(n,lb(r),"..");e.includes(i)||t.push(i)},c9=({env:t=ub.env,...e}={})=>{t={...t};let r=cb({env:t});return e.path=t[r],t[r]=kve(e),t}});var u9,ei,d9,f9,p9,db,Gf,Zf,Ra=y(()=>{u9=(t,e,r)=>{let n=r?Zf:Gf,i=t instanceof ei?{}:{cause:t};return new n(e,i)},ei=class extends Error{},d9=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,p9,{value:!0,writable:!1,enumerable:!1,configurable:!1})},f9=t=>db(t)&&p9 in t,p9=Symbol("isExecaError"),db=t=>Object.prototype.toString.call(t)==="[object Error]",Gf=class extends Error{};d9(Gf,Gf.name);Zf=class extends Error{};d9(Zf,Zf.name)});var m9,Tve,h9,g9,y9=y(()=>{m9=()=>{let t=g9-h9+1;return Array.from({length:t},Tve)},Tve=(t,e)=>({name:`SIGRT${e+1}`,number:h9+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),h9=34,g9=64});var _9,b9=y(()=>{_9=[{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:!0},{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:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{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"}]});import{constants as Ove}from"node:os";var RR,Rve,v9=y(()=>{b9();y9();RR=()=>{let t=m9();return[..._9,...t].map(Rve)},Rve=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=Ove,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as Ive}from"node:os";var Pve,Cve,S9,Dve,Nve,jve,gtt,w9=y(()=>{v9();Pve=()=>{let t=RR();return Object.fromEntries(t.map(Cve))},Cve=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],S9=Pve(),Dve=()=>{let t=RR(),e=65,r=Array.from({length:e},(n,i)=>Nve(i,t));return Object.assign({},...r)},Nve=(t,e)=>{let r=jve(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:c}}},jve=(t,e)=>{let r=e.find(({name:n})=>Ive.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},gtt=Dve()});import{constants as Vf}from"node:os";var $9,k9,E9,Mve,Fve,x9,Lve,IR,zve,Uve,fb,Wf=y(()=>{w9();$9=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return E9(t,e)},k9=t=>t===0?t:E9(t,"`subprocess.kill()`'s argument"),E9=(t,e)=>{if(Number.isInteger(t))return Mve(t,e);if(typeof t=="string")return Lve(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. ${IR()}`)},Mve=(t,e)=>{if(x9.has(t))return x9.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist. ${IR()}`)},Fve=()=>new Map(Object.entries(Vf.signals).reverse().map(([t,e])=>[e,t])),x9=Fve(),Lve=(t,e)=>{if(t in Vf.signals)return t;throw t.toUpperCase()in Vf.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist. ${IR()}`)},IR=()=>`Available signal names: ${zve()}. -Available signal numbers: ${Uve()}.`,zve=()=>Object.keys(Vf.signals).sort().map(t=>`'${t}'`).join(", "),Uve=()=>[...new Set(Object.values(Vf.signals).sort((t,e)=>t-e))].join(", "),fb=t=>S9[t].description});import{setTimeout as qve}from"node:timers/promises";var A9,Bve,T9,Hve,Gve,Zve,PR,pb=y(()=>{Ra();Wf();A9=t=>{if(t===!1)return t;if(t===!0)return Bve;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},Bve=1e3*5,T9=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:i,controller:o},s,a)=>{let{signal:c,error:l}=Hve(s,a,r);Gve(l,n);let u=t(c);return Zve({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:u,context:i,controller:o}),u},Hve=(t,e,r)=>{let[n=r,i]=db(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(i!==void 0&&!db(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:k9(n),error:i}},Gve=(t,e)=>{t!==void 0&&e.reject(t)},Zve=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:s})=>{e===n&&i&&PR({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal})},PR=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await qve(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}}});import{once as Vve}from"node:events";var mb,CR=y(()=>{mb=async(t,e)=>{t.aborted||await Vve(t,"abort",{signal:e})}});var O9,R9,Wve,DR=y(()=>{CR();O9=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},R9=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:i})=>e===void 0||r?[]:[Wve(t,e,n,i)],Wve=async(t,e,r,{signal:n})=>{throw await mb(e,n),r.terminationReason??="cancel",t.kill(),e.reason}});var Tl,Kve,NR,I9,P9,hb,C9,D9,N9,j9,M9,F9,Jve,Yve,Xve,ti,Qve,us,Ol,Rl=y(()=>{Tl=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{Kve(t,e,r),NR(t,e,n)},Kve=(t,e,r)=>{if(!r)throw new Error(`${ti(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},NR=(t,e,r)=>{if(!r)throw new Error(`${ti(t,e)} cannot be used: the ${us(e)} has already exited or disconnected.`)},I9=t=>{throw new Error(`${ti("getOneMessage",t)} could not complete: the ${us(t)} exited or disconnected.`)},P9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} is sending a message too, instead of listening to incoming messages. +Available signal numbers: ${Uve()}.`,zve=()=>Object.keys(Vf.signals).sort().map(t=>`'${t}'`).join(", "),Uve=()=>[...new Set(Object.values(Vf.signals).sort((t,e)=>t-e))].join(", "),fb=t=>S9[t].description});import{setTimeout as qve}from"node:timers/promises";var A9,Bve,T9,Hve,Gve,Zve,PR,pb=y(()=>{Ra();Wf();A9=t=>{if(t===!1)return t;if(t===!0)return Bve;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},Bve=1e3*5,T9=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:i,controller:o},s,a)=>{let{signal:c,error:l}=Hve(s,a,r);Gve(l,n);let u=t(c);return Zve({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:u,context:i,controller:o}),u},Hve=(t,e,r)=>{let[n=r,i]=db(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(i!==void 0&&!db(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:k9(n),error:i}},Gve=(t,e)=>{t!==void 0&&e.reject(t)},Zve=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:s})=>{e===n&&i&&PR({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal})},PR=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await qve(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}}});import{once as Vve}from"node:events";var mb,CR=y(()=>{mb=async(t,e)=>{t.aborted||await Vve(t,"abort",{signal:e})}});var O9,R9,Wve,DR=y(()=>{CR();O9=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},R9=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:i})=>e===void 0||r?[]:[Wve(t,e,n,i)],Wve=async(t,e,r,{signal:n})=>{throw await mb(e,n),r.terminationReason??="cancel",t.kill(),e.reason}});var Ol,Kve,NR,I9,P9,hb,C9,D9,N9,j9,M9,F9,Jve,Yve,Xve,ti,Qve,us,Rl,Il=y(()=>{Ol=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{Kve(t,e,r),NR(t,e,n)},Kve=(t,e,r)=>{if(!r)throw new Error(`${ti(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},NR=(t,e,r)=>{if(!r)throw new Error(`${ti(t,e)} cannot be used: the ${us(e)} has already exited or disconnected.`)},I9=t=>{throw new Error(`${ti("getOneMessage",t)} could not complete: the ${us(t)} exited or disconnected.`)},P9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} is sending a message too, instead of listening to incoming messages. This can be fixed by both sending a message and listening to incoming messages at the same time: const [receivedMessage] = await Promise.all([ ${ti("getOneMessage",t)}, ${ti("sendMessage",t,"message, {strict: true}")}, -]);`)},hb=(t,e)=>new Error(`${ti("sendMessage",e)} failed when sending an acknowledgment response to the ${us(e)}.`,{cause:t}),C9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} is not listening to incoming messages.`)},D9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} exited without listening to incoming messages.`)},N9=()=>new Error(`\`cancelSignal\` aborted: the ${us(!0)} disconnected.`),j9=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},M9=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${ti(e,r)} cannot be used: the ${us(r)} is disconnecting.`,{cause:t})},F9=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(Jve(t))throw new Error(`${ti(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},Jve=({code:t,message:e})=>Yve.has(t)||Xve.some(r=>e.includes(r)),Yve=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Xve=["could not be cloned","circular structure","call stack size exceeded"],ti=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Qve(e)}${t}(${r})`,Qve=t=>t?"":"subprocess.",us=t=>t?"parent process":"subprocess",Ol=t=>{t.connected&&t.disconnect()}});var Ci,Il=y(()=>{Ci=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)}});var yb,Pl,Di,L9,eSe,tSe,z9,rSe,U9,Kf,gb,ds=y(()=>{So();yb=(t,e="stdin")=>{let{options:n,fileDescriptors:i}=Di.get(t),o=L9(i,e,!0),s=t.stdio[o];if(s===null)throw new TypeError(z9(o,e,n,!0));return s},Pl=(t,e="stdout")=>{let{options:n,fileDescriptors:i}=Di.get(t),o=L9(i,e,!1),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(z9(o,e,n,!1));return s},Di=new WeakMap,L9=(t,e,r)=>{let n=eSe(e,r);return tSe(n,e,r,t),n},eSe=(t,e)=>{let r=mR(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Kf(e)}" must not be "${t}". +]);`)},hb=(t,e)=>new Error(`${ti("sendMessage",e)} failed when sending an acknowledgment response to the ${us(e)}.`,{cause:t}),C9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} is not listening to incoming messages.`)},D9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} exited without listening to incoming messages.`)},N9=()=>new Error(`\`cancelSignal\` aborted: the ${us(!0)} disconnected.`),j9=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},M9=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${ti(e,r)} cannot be used: the ${us(r)} is disconnecting.`,{cause:t})},F9=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(Jve(t))throw new Error(`${ti(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},Jve=({code:t,message:e})=>Yve.has(t)||Xve.some(r=>e.includes(r)),Yve=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Xve=["could not be cloned","circular structure","call stack size exceeded"],ti=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Qve(e)}${t}(${r})`,Qve=t=>t?"":"subprocess.",us=t=>t?"parent process":"subprocess",Rl=t=>{t.connected&&t.disconnect()}});var Ci,Pl=y(()=>{Ci=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)}});var yb,Cl,Di,L9,eSe,tSe,z9,rSe,U9,Kf,gb,ds=y(()=>{So();yb=(t,e="stdin")=>{let{options:n,fileDescriptors:i}=Di.get(t),o=L9(i,e,!0),s=t.stdio[o];if(s===null)throw new TypeError(z9(o,e,n,!0));return s},Cl=(t,e="stdout")=>{let{options:n,fileDescriptors:i}=Di.get(t),o=L9(i,e,!1),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(z9(o,e,n,!1));return s},Di=new WeakMap,L9=(t,e,r)=>{let n=eSe(e,r);return tSe(n,e,r,t),n},eSe=(t,e)=>{let r=mR(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Kf(e)}" must not be "${t}". It must be ${n} or "fd3", "fd4" (and so on). It is optional and defaults to "${i}".`)},tSe=(t,e,r,n)=>{let i=n[U9(t)];if(i===void 0)throw new TypeError(`"${Kf(r)}" must not be ${e}. That file descriptor does not exist. Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!r)throw new TypeError(`"${Kf(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&r)throw new TypeError(`"${Kf(r)}" must not be ${e}. It must be a writable stream, not readable.`)},z9=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:o}=rSe(t,r);return`The "${i}: ${gb(o)}" option is incompatible with using "${Kf(n)}: ${gb(e)}". -Please set this option with "pipe" instead.`},rSe=(t,{stdin:e,stdout:r,stderr:n,stdio:i})=>{let o=U9(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},U9=t=>t==="all"?1:t,Kf=t=>t?"to":"from",gb=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream"});import{addAbortListener as nSe}from"node:events";var Ia,_b=y(()=>{Ia=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),nSe(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))}});var bb,jR,vb,MR,q9,B9,Jf=y(()=>{bb=(t,e)=>{e&&jR(t)},jR=t=>{t.refCounted()},vb=(t,e)=>{e&&MR(t)},MR=t=>{t.unrefCounted()},q9=(t,e)=>{e&&(MR(t),MR(t))},B9=(t,e)=>{e&&(jR(t),jR(t))}});import{once as iSe}from"node:events";import{scheduler as oSe}from"node:timers/promises";var H9,G9,Sb,Z9=y(()=>{xb();Jf();wb();$b();H9=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},i)=>{if(W9(i)||J9(i))return;Sb.has(t)||Sb.set(t,[]);let o=Sb.get(t);if(o.push(i),!(o.length>1))for(;o.length>0;){await K9(t,n,i),await oSe.yield();let s=await V9({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",s),n.emit("message:done")}},G9=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{FR();let o=Sb.get(t);for(;o?.length>0;)await iSe(n,"message:done");t.removeListener("message",i),B9(e,r),n.connected=!1,n.emit("disconnect")},Sb=new WeakMap});import{EventEmitter as sSe}from"node:events";var fs,kb,aSe,Eb,Yf=y(()=>{Z9();Jf();fs=(t,e,r)=>{if(kb.has(t))return kb.get(t);let n=new sSe;return n.connected=!0,kb.set(t,n),aSe({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},kb=new WeakMap,aSe=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let i=H9.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",i),e.once("disconnect",G9.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:i})),q9(r,n)},Eb=t=>{let e=kb.get(t);return e===void 0?t.channel!==null:e.connected}});import{once as cSe}from"node:events";var Y9,lSe,X9,V9,W9,Q9,Ab,uSe,Tb,eV,wb=y(()=>{Il();_b();Ib();Rl();Yf();xb();Y9=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:i})=>{if(!i)return n;let o=fs(t,e,r),s=Ob(t,o);return{id:lSe++,type:Tb,message:n,hasListeners:s}},lSe=0n,X9=(t,e)=>{if(!(e?.type!==Tb||e.hasListeners))for(let{id:r}of t)r!==void 0&&Ab[r].resolve({isDeadlock:!0,hasListeners:!1})},V9=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(t?.type!==Tb||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:eV,message:Ob(e,i)};try{await Rb({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return s},W9=t=>{if(t?.type!==eV)return!1;let{id:e,message:r}=t;return Ab[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},Q9=async(t,e,r)=>{if(t?.type!==Tb)return;let n=Ci();Ab[t.id]=n;let i=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([n,uSe(e,r,i)]);o&&P9(r),s||C9(r)}finally{i.abort(),delete Ab[t.id]}},Ab={},uSe=async(t,e,{signal:r})=>{Ia(t,1,r),await cSe(t,"disconnect",{signal:r}),D9(e)},Tb="execa:ipc:request",eV="execa:ipc:response"});var tV,rV,K9,Xf,Ob,dSe,xb=y(()=>{Il();So();ds();wb();tV=(t,e,r)=>{Xf.has(t)||Xf.set(t,new Set);let n=Xf.get(t),i=Ci(),o=r?e.id:void 0,s={onMessageSent:i,id:o};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},rV=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},K9=async(t,e,r)=>{for(;!Ob(t,e)&&Xf.get(t)?.size>0;){let n=[...Xf.get(t)];X9(n,r),await Promise.all(n.map(({onMessageSent:i})=>i))}},Xf=new WeakMap,Ob=(t,e)=>e.listenerCount("message")>dSe(t),dSe=t=>Di.has(t)&&!vo(Di.get(t).options.buffer,"ipc")?1:0});import{promisify as fSe}from"node:util";var Rb,pSe,zR,mSe,LR,Ib=y(()=>{Rl();xb();wb();Rb=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},i,{strict:o=!1}={})=>{let s="sendMessage";return Tl({methodName:s,isSubprocess:r,ipc:n,isConnected:t.connected}),pSe({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:i,strict:o})},pSe=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:i,strict:o})=>{let s=Y9({anyProcess:t,channel:e,isSubprocess:n,message:i,strict:o}),a=tV(t,s,o);try{await zR({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:s,message:i})}catch(c){throw Ol(t),c}finally{rV(a)}},zR=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:i})=>{let o=mSe(t);try{await Promise.all([Q9(n,t,r),o(n)])}catch(s){throw M9({error:s,methodName:e,isSubprocess:r}),F9({error:s,methodName:e,isSubprocess:r,message:i}),s}},mSe=t=>{if(LR.has(t))return LR.get(t);let e=fSe(t.send.bind(t));return LR.set(t,e),e},LR=new WeakMap});import{scheduler as hSe}from"node:timers/promises";var iV,oV,gSe,nV,J9,sV,FR,UR,$b=y(()=>{Ib();Yf();Rl();iV=(t,e)=>{let r="cancelSignal";return NR(r,!1,t.connected),zR({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:sV,message:e},message:e})},oV=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await gSe({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),UR.signal),gSe=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!nV){if(nV=!0,!n){j9();return}if(e===null){FR();return}fs(t,e,r),await hSe.yield()}},nV=!1,J9=t=>t?.type!==sV?!1:(UR.abort(t.message),!0),sV="execa:ipc:cancel",FR=()=>{UR.abort(N9())},UR=new AbortController});var aV,cV,ySe,_Se,qR=y(()=>{CR();$b();pb();aV=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},cV=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[ySe({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:i,controller:o})]:[],ySe=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:i}})=>{await mb(e,i);let o=_Se(e);throw await iV(t,o),PR({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:i}),n.terminationReason??="gracefulCancel",e.reason},_Se=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e}});import{setTimeout as bSe}from"node:timers/promises";var lV,uV,vSe,BR=y(()=>{Ra();lV=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},uV=(t,e,r,n)=>e===0||e===void 0?[]:[vSe(t,e,r,n)],vSe=async(t,e,r,{signal:n})=>{throw await bSe(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new ei}});import{execPath as SSe,execArgv as wSe}from"node:process";import dV from"node:path";var fV,pV,HR=y(()=>{wl();fV=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},pV=(t,e,{node:r=!1,nodePath:n=SSe,nodeOptions:i=wSe.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=Sl(n,'The "nodePath" option'),l=dV.resolve(o,c),u={...a,nodePath:l,node:r,cwd:o};if(!r)return[t,e,u];if(dV.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...i,t,...e],{ipc:!0,...u,shell:!1}]}});import{serialize as xSe}from"node:v8";var mV,$Se,kSe,ESe,hV,GR=y(()=>{mV=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");ESe[r](t)}},$Se=t=>{try{xSe(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},kSe=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},ESe={advanced:$Se,json:kSe},hV=async(t,e)=>{e!==void 0&&await t.sendMessage(e)}});var yV,ASe,on,ZR,TSe,gV,Pb,Pa=y(()=>{yV=({encoding:t})=>{if(ZR.has(t))return;let e=TSe(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Pb(t)}\`. +Please set this option with "pipe" instead.`},rSe=(t,{stdin:e,stdout:r,stderr:n,stdio:i})=>{let o=U9(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},U9=t=>t==="all"?1:t,Kf=t=>t?"to":"from",gb=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream"});import{addAbortListener as nSe}from"node:events";var Ia,_b=y(()=>{Ia=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),nSe(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))}});var bb,jR,vb,MR,q9,B9,Jf=y(()=>{bb=(t,e)=>{e&&jR(t)},jR=t=>{t.refCounted()},vb=(t,e)=>{e&&MR(t)},MR=t=>{t.unrefCounted()},q9=(t,e)=>{e&&(MR(t),MR(t))},B9=(t,e)=>{e&&(jR(t),jR(t))}});import{once as iSe}from"node:events";import{scheduler as oSe}from"node:timers/promises";var H9,G9,Sb,Z9=y(()=>{xb();Jf();wb();$b();H9=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},i)=>{if(W9(i)||J9(i))return;Sb.has(t)||Sb.set(t,[]);let o=Sb.get(t);if(o.push(i),!(o.length>1))for(;o.length>0;){await K9(t,n,i),await oSe.yield();let s=await V9({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",s),n.emit("message:done")}},G9=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{FR();let o=Sb.get(t);for(;o?.length>0;)await iSe(n,"message:done");t.removeListener("message",i),B9(e,r),n.connected=!1,n.emit("disconnect")},Sb=new WeakMap});import{EventEmitter as sSe}from"node:events";var fs,kb,aSe,Eb,Yf=y(()=>{Z9();Jf();fs=(t,e,r)=>{if(kb.has(t))return kb.get(t);let n=new sSe;return n.connected=!0,kb.set(t,n),aSe({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},kb=new WeakMap,aSe=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let i=H9.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",i),e.once("disconnect",G9.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:i})),q9(r,n)},Eb=t=>{let e=kb.get(t);return e===void 0?t.channel!==null:e.connected}});import{once as cSe}from"node:events";var Y9,lSe,X9,V9,W9,Q9,Ab,uSe,Tb,eV,wb=y(()=>{Pl();_b();Ib();Il();Yf();xb();Y9=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:i})=>{if(!i)return n;let o=fs(t,e,r),s=Ob(t,o);return{id:lSe++,type:Tb,message:n,hasListeners:s}},lSe=0n,X9=(t,e)=>{if(!(e?.type!==Tb||e.hasListeners))for(let{id:r}of t)r!==void 0&&Ab[r].resolve({isDeadlock:!0,hasListeners:!1})},V9=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(t?.type!==Tb||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:eV,message:Ob(e,i)};try{await Rb({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return s},W9=t=>{if(t?.type!==eV)return!1;let{id:e,message:r}=t;return Ab[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},Q9=async(t,e,r)=>{if(t?.type!==Tb)return;let n=Ci();Ab[t.id]=n;let i=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([n,uSe(e,r,i)]);o&&P9(r),s||C9(r)}finally{i.abort(),delete Ab[t.id]}},Ab={},uSe=async(t,e,{signal:r})=>{Ia(t,1,r),await cSe(t,"disconnect",{signal:r}),D9(e)},Tb="execa:ipc:request",eV="execa:ipc:response"});var tV,rV,K9,Xf,Ob,dSe,xb=y(()=>{Pl();So();ds();wb();tV=(t,e,r)=>{Xf.has(t)||Xf.set(t,new Set);let n=Xf.get(t),i=Ci(),o=r?e.id:void 0,s={onMessageSent:i,id:o};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},rV=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},K9=async(t,e,r)=>{for(;!Ob(t,e)&&Xf.get(t)?.size>0;){let n=[...Xf.get(t)];X9(n,r),await Promise.all(n.map(({onMessageSent:i})=>i))}},Xf=new WeakMap,Ob=(t,e)=>e.listenerCount("message")>dSe(t),dSe=t=>Di.has(t)&&!vo(Di.get(t).options.buffer,"ipc")?1:0});import{promisify as fSe}from"node:util";var Rb,pSe,zR,mSe,LR,Ib=y(()=>{Il();xb();wb();Rb=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},i,{strict:o=!1}={})=>{let s="sendMessage";return Ol({methodName:s,isSubprocess:r,ipc:n,isConnected:t.connected}),pSe({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:i,strict:o})},pSe=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:i,strict:o})=>{let s=Y9({anyProcess:t,channel:e,isSubprocess:n,message:i,strict:o}),a=tV(t,s,o);try{await zR({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:s,message:i})}catch(c){throw Rl(t),c}finally{rV(a)}},zR=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:i})=>{let o=mSe(t);try{await Promise.all([Q9(n,t,r),o(n)])}catch(s){throw M9({error:s,methodName:e,isSubprocess:r}),F9({error:s,methodName:e,isSubprocess:r,message:i}),s}},mSe=t=>{if(LR.has(t))return LR.get(t);let e=fSe(t.send.bind(t));return LR.set(t,e),e},LR=new WeakMap});import{scheduler as hSe}from"node:timers/promises";var iV,oV,gSe,nV,J9,sV,FR,UR,$b=y(()=>{Ib();Yf();Il();iV=(t,e)=>{let r="cancelSignal";return NR(r,!1,t.connected),zR({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:sV,message:e},message:e})},oV=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await gSe({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),UR.signal),gSe=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!nV){if(nV=!0,!n){j9();return}if(e===null){FR();return}fs(t,e,r),await hSe.yield()}},nV=!1,J9=t=>t?.type!==sV?!1:(UR.abort(t.message),!0),sV="execa:ipc:cancel",FR=()=>{UR.abort(N9())},UR=new AbortController});var aV,cV,ySe,_Se,qR=y(()=>{CR();$b();pb();aV=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},cV=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[ySe({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:i,controller:o})]:[],ySe=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:i}})=>{await mb(e,i);let o=_Se(e);throw await iV(t,o),PR({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:i}),n.terminationReason??="gracefulCancel",e.reason},_Se=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e}});import{setTimeout as bSe}from"node:timers/promises";var lV,uV,vSe,BR=y(()=>{Ra();lV=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},uV=(t,e,r,n)=>e===0||e===void 0?[]:[vSe(t,e,r,n)],vSe=async(t,e,r,{signal:n})=>{throw await bSe(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new ei}});import{execPath as SSe,execArgv as wSe}from"node:process";import dV from"node:path";var fV,pV,HR=y(()=>{xl();fV=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},pV=(t,e,{node:r=!1,nodePath:n=SSe,nodeOptions:i=wSe.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=wl(n,'The "nodePath" option'),l=dV.resolve(o,c),u={...a,nodePath:l,node:r,cwd:o};if(!r)return[t,e,u];if(dV.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...i,t,...e],{ipc:!0,...u,shell:!1}]}});import{serialize as xSe}from"node:v8";var mV,$Se,kSe,ESe,hV,GR=y(()=>{mV=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");ESe[r](t)}},$Se=t=>{try{xSe(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},kSe=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},ESe={advanced:$Se,json:kSe},hV=async(t,e)=>{e!==void 0&&await t.sendMessage(e)}});var yV,ASe,on,ZR,TSe,gV,Pb,Pa=y(()=>{yV=({encoding:t})=>{if(ZR.has(t))return;let e=TSe(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Pb(t)}\`. Please rename it to ${Pb(e)}.`);let r=[...ZR].map(n=>Pb(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Pb(t)}\`. -Please rename it to one of: ${r}.`)},ASe=new Set(["utf8","utf16le"]),on=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),ZR=new Set([...ASe,...on]),TSe=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in gV)return gV[e];if(ZR.has(e))return e},gV={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Pb=t=>typeof t=="string"?`"${t}"`:String(t)});import{statSync as OSe}from"node:fs";import RSe from"node:path";import ISe from"node:process";var _V,bV,vV,VR=y(()=>{wl();_V=(t=bV())=>{let e=Sl(t,'The "cwd" option');return RSe.resolve(e)},bV=()=>{try{return ISe.cwd()}catch(t){throw t.message=`The current directory does not exist. +Please rename it to one of: ${r}.`)},ASe=new Set(["utf8","utf16le"]),on=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),ZR=new Set([...ASe,...on]),TSe=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in gV)return gV[e];if(ZR.has(e))return e},gV={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Pb=t=>typeof t=="string"?`"${t}"`:String(t)});import{statSync as OSe}from"node:fs";import RSe from"node:path";import ISe from"node:process";var _V,bV,vV,VR=y(()=>{xl();_V=(t=bV())=>{let e=wl(t,'The "cwd" option');return RSe.resolve(e)},bV=()=>{try{return ISe.cwd()}catch(t){throw t.message=`The current directory does not exist. ${t.message}`,t}},vV=(t,e)=>{if(e===bV())return t;let r;try{r=OSe(e)}catch(n){return`The "cwd" option is invalid: ${e}. ${n.message} ${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}. -${t}`}});import PSe from"node:path";import SV from"node:process";var wV,Cb,CSe,DSe,WR=y(()=>{wV=St(r9(),1);l9();pb();Wf();DR();qR();BR();HR();GR();Pa();VR();wl();So();Cb=(t,e,r)=>{r.cwd=_V(r.cwd);let[n,i,o]=pV(t,e,r),{command:s,args:a,options:c}=wV.default._parse(n,i,o),l=GG(c),u=CSe(l);return lV(u),yV(u),mV(u),O9(u),aV(u),u.shell=lR(u.shell),u.env=DSe(u),u.killSignal=$9(u.killSignal),u.forceKillAfterDelay=A9(u.forceKillAfterDelay),u.lines=u.lines.map((d,f)=>d&&!on.has(u.encoding)&&u.buffer[f]),SV.platform==="win32"&&PSe.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},CSe=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m="advanced",...h})=>({...h,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),DSe=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...SV.env,...t}:t;return r||n?c9({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s}});var Db,KR=y(()=>{Db=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r]});function Cl(t){if(typeof t=="string")return NSe(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return jSe(t)}var NSe,jSe,xV,MSe,$V,FSe,JR=y(()=>{NSe=t=>t.at(-1)===xV?t.slice(0,t.at(-2)===$V?-2:-1):t,jSe=t=>t.at(-1)===MSe?t.subarray(0,t.at(-2)===FSe?-2:-1):t,xV=` -`,MSe=xV.codePointAt(0),$V="\r",FSe=$V.codePointAt(0)});function ri(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function YR(t,{checkOpen:e=!0}={}){return ri(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Ca(t,{checkOpen:e=!0}={}){return ri(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function XR(t,e){return YR(t,e)&&Ca(t,e)}var Da=y(()=>{});function kV(){return this[eI].next()}function EV(t){return this[eI].return(t)}function tI({preventCancel:t=!1}={}){let e=this.getReader(),r=new QR(e,t),n=Object.create(zSe);return n[eI]=r,n}var LSe,QR,eI,zSe,AV=y(()=>{LSe=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),QR=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#i(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},eI=Symbol();Object.defineProperty(kV,"name",{value:"next"});Object.defineProperty(EV,"name",{value:"return"});zSe=Object.create(LSe,{next:{enumerable:!0,configurable:!0,writable:!0,value:kV},return:{enumerable:!0,configurable:!0,writable:!0,value:EV}})});var TV=y(()=>{});var OV=y(()=>{AV();TV()});var RV,USe,qSe,BSe,Qf,rI=y(()=>{Da();OV();RV=t=>{if(Ca(t,{checkOpen:!1})&&Qf.on!==void 0)return qSe(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(USe.call(t)==="[object ReadableStream]")return tI.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:USe}=Object.prototype,qSe=async function*(t){let e=new AbortController,r={};BSe(t,e,r);try{for await(let[n]of Qf.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},BSe=async(t,e,r)=>{try{await Qf.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},Qf={}});var Dl,HSe,CV,IV,GSe,PV,Ni,ep=y(()=>{rI();Dl=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let l=RV(t),u=e();u.length=0;try{for await(let d of l){let f=GSe(d),p=r[f](d,u);CV({convertedChunk:p,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:c})}return HSe({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(u)}catch(d){let f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(u),f}},HSe=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let s=i(t);s!==void 0&&CV({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:o})},CV=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){IV(t,e,i,a);return}let c=n(t,o-e.length);throw c!==void 0&&IV(c,e,i,o),new Ni},IV=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},GSe=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=PV.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&PV.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:PV}=Object.prototype,Ni=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var wo,tp,Nb,jb,Mb,Fb=y(()=>{wo=t=>t,tp=()=>{},Nb=({contents:t})=>t,jb=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},Mb=t=>t.length});async function Lb(t,e){return Dl(t,KSe,e)}var ZSe,VSe,WSe,KSe,DV=y(()=>{ep();Fb();ZSe=()=>({contents:[]}),VSe=()=>1,WSe=(t,{contents:e})=>(e.push(t),e),KSe={init:ZSe,convertChunk:{string:wo,buffer:wo,arrayBuffer:wo,dataView:wo,typedArray:wo,others:wo},getSize:VSe,truncateChunk:tp,addChunk:WSe,getFinalChunk:tp,finalize:Nb}});async function zb(t,e){return Dl(t,iwe,e)}var JSe,YSe,XSe,NV,jV,QSe,ewe,twe,rwe,FV,MV,nwe,LV,iwe,zV=y(()=>{ep();Fb();JSe=()=>({contents:new ArrayBuffer(0)}),YSe=t=>XSe.encode(t),XSe=new TextEncoder,NV=t=>new Uint8Array(t),jV=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),QSe=(t,e)=>t.slice(0,e),ewe=(t,{contents:e,length:r},n)=>{let i=LV()?rwe(e,n):twe(e,n);return new Uint8Array(i).set(t,r),i},twe=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(FV(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},rwe=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:FV(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},FV=t=>MV**Math.ceil(Math.log(t)/Math.log(MV)),MV=2,nwe=({contents:t,length:e})=>LV()?t:t.slice(0,e),LV=()=>"resize"in ArrayBuffer.prototype,iwe={init:JSe,convertChunk:{string:YSe,buffer:NV,arrayBuffer:NV,dataView:jV,typedArray:jV,others:jb},getSize:Mb,truncateChunk:QSe,addChunk:ewe,getFinalChunk:tp,finalize:nwe}});async function qb(t,e){return Dl(t,lwe,e)}var owe,Ub,swe,awe,cwe,lwe,UV=y(()=>{ep();Fb();owe=()=>({contents:"",textDecoder:new TextDecoder}),Ub=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),swe=(t,{contents:e})=>e+t,awe=(t,e)=>t.slice(0,e),cwe=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},lwe={init:owe,convertChunk:{string:wo,buffer:Ub,arrayBuffer:Ub,dataView:Ub,typedArray:Ub,others:jb},getSize:Mb,truncateChunk:awe,addChunk:swe,getFinalChunk:cwe,finalize:Nb}});var qV=y(()=>{DV();zV();UV();ep()});import{on as uwe}from"node:events";import{finished as dwe}from"node:stream/promises";var Bb=y(()=>{rI();qV();Object.assign(Qf,{on:uwe,finished:dwe})});var BV,fwe,HV,GV,pwe,ZV,VV,Hb,Na=y(()=>{Bb();bo();So();BV=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{if(!(t instanceof Ni))throw t;if(o==="all")return t;let s=fwe(r,n,i);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},fwe=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",HV=(t,e,r)=>{if(e.length!==r)return;let n=new Ni;throw n.maxBufferInfo={fdNumber:"ipc"},n},GV=(t,e)=>{let{streamName:r,threshold:n,unit:i}=pwe(t,e);return`Command's ${r} was larger than ${n} ${i}`},pwe=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let i=vo(e,r);return r==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:J_(r),threshold:i,unit:n}},ZV=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>Hb(r)),VV=(t,e,r)=>{if(!e)return t;let n=Hb(r);return t.length>n?t.slice(0,n):t},Hb=([,t])=>t});import{inspect as mwe}from"node:util";var KV,hwe,gwe,ywe,_we,bwe,WV,JV=y(()=>{JR();nn();VR();Q_();Na();Wf();Ra();KV=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:b})=>{let _=n?.code,S=hwe({originalError:n,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:_,signal:i,signalDescription:o,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),x=ywe(n,b),w=x===void 0?"":` +${t}`}});import PSe from"node:path";import SV from"node:process";var wV,Cb,CSe,DSe,WR=y(()=>{wV=St(r9(),1);l9();pb();Wf();DR();qR();BR();HR();GR();Pa();VR();xl();So();Cb=(t,e,r)=>{r.cwd=_V(r.cwd);let[n,i,o]=pV(t,e,r),{command:s,args:a,options:c}=wV.default._parse(n,i,o),l=GG(c),u=CSe(l);return lV(u),yV(u),mV(u),O9(u),aV(u),u.shell=lR(u.shell),u.env=DSe(u),u.killSignal=$9(u.killSignal),u.forceKillAfterDelay=A9(u.forceKillAfterDelay),u.lines=u.lines.map((d,f)=>d&&!on.has(u.encoding)&&u.buffer[f]),SV.platform==="win32"&&PSe.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},CSe=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m="advanced",...h})=>({...h,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),DSe=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...SV.env,...t}:t;return r||n?c9({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s}});var Db,KR=y(()=>{Db=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r]});function Dl(t){if(typeof t=="string")return NSe(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return jSe(t)}var NSe,jSe,xV,MSe,$V,FSe,JR=y(()=>{NSe=t=>t.at(-1)===xV?t.slice(0,t.at(-2)===$V?-2:-1):t,jSe=t=>t.at(-1)===MSe?t.subarray(0,t.at(-2)===FSe?-2:-1):t,xV=` +`,MSe=xV.codePointAt(0),$V="\r",FSe=$V.codePointAt(0)});function ri(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function YR(t,{checkOpen:e=!0}={}){return ri(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Ca(t,{checkOpen:e=!0}={}){return ri(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function XR(t,e){return YR(t,e)&&Ca(t,e)}var Da=y(()=>{});function kV(){return this[eI].next()}function EV(t){return this[eI].return(t)}function tI({preventCancel:t=!1}={}){let e=this.getReader(),r=new QR(e,t),n=Object.create(zSe);return n[eI]=r,n}var LSe,QR,eI,zSe,AV=y(()=>{LSe=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),QR=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#i(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},eI=Symbol();Object.defineProperty(kV,"name",{value:"next"});Object.defineProperty(EV,"name",{value:"return"});zSe=Object.create(LSe,{next:{enumerable:!0,configurable:!0,writable:!0,value:kV},return:{enumerable:!0,configurable:!0,writable:!0,value:EV}})});var TV=y(()=>{});var OV=y(()=>{AV();TV()});var RV,USe,qSe,BSe,Qf,rI=y(()=>{Da();OV();RV=t=>{if(Ca(t,{checkOpen:!1})&&Qf.on!==void 0)return qSe(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(USe.call(t)==="[object ReadableStream]")return tI.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:USe}=Object.prototype,qSe=async function*(t){let e=new AbortController,r={};BSe(t,e,r);try{for await(let[n]of Qf.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},BSe=async(t,e,r)=>{try{await Qf.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},Qf={}});var Nl,HSe,CV,IV,GSe,PV,Ni,ep=y(()=>{rI();Nl=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let l=RV(t),u=e();u.length=0;try{for await(let d of l){let f=GSe(d),p=r[f](d,u);CV({convertedChunk:p,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:c})}return HSe({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(u)}catch(d){let f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(u),f}},HSe=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let s=i(t);s!==void 0&&CV({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:o})},CV=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){IV(t,e,i,a);return}let c=n(t,o-e.length);throw c!==void 0&&IV(c,e,i,o),new Ni},IV=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},GSe=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=PV.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&PV.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:PV}=Object.prototype,Ni=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var wo,tp,Nb,jb,Mb,Fb=y(()=>{wo=t=>t,tp=()=>{},Nb=({contents:t})=>t,jb=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},Mb=t=>t.length});async function Lb(t,e){return Nl(t,KSe,e)}var ZSe,VSe,WSe,KSe,DV=y(()=>{ep();Fb();ZSe=()=>({contents:[]}),VSe=()=>1,WSe=(t,{contents:e})=>(e.push(t),e),KSe={init:ZSe,convertChunk:{string:wo,buffer:wo,arrayBuffer:wo,dataView:wo,typedArray:wo,others:wo},getSize:VSe,truncateChunk:tp,addChunk:WSe,getFinalChunk:tp,finalize:Nb}});async function zb(t,e){return Nl(t,iwe,e)}var JSe,YSe,XSe,NV,jV,QSe,ewe,twe,rwe,FV,MV,nwe,LV,iwe,zV=y(()=>{ep();Fb();JSe=()=>({contents:new ArrayBuffer(0)}),YSe=t=>XSe.encode(t),XSe=new TextEncoder,NV=t=>new Uint8Array(t),jV=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),QSe=(t,e)=>t.slice(0,e),ewe=(t,{contents:e,length:r},n)=>{let i=LV()?rwe(e,n):twe(e,n);return new Uint8Array(i).set(t,r),i},twe=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(FV(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},rwe=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:FV(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},FV=t=>MV**Math.ceil(Math.log(t)/Math.log(MV)),MV=2,nwe=({contents:t,length:e})=>LV()?t:t.slice(0,e),LV=()=>"resize"in ArrayBuffer.prototype,iwe={init:JSe,convertChunk:{string:YSe,buffer:NV,arrayBuffer:NV,dataView:jV,typedArray:jV,others:jb},getSize:Mb,truncateChunk:QSe,addChunk:ewe,getFinalChunk:tp,finalize:nwe}});async function qb(t,e){return Nl(t,lwe,e)}var owe,Ub,swe,awe,cwe,lwe,UV=y(()=>{ep();Fb();owe=()=>({contents:"",textDecoder:new TextDecoder}),Ub=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),swe=(t,{contents:e})=>e+t,awe=(t,e)=>t.slice(0,e),cwe=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},lwe={init:owe,convertChunk:{string:wo,buffer:Ub,arrayBuffer:Ub,dataView:Ub,typedArray:Ub,others:jb},getSize:Mb,truncateChunk:awe,addChunk:swe,getFinalChunk:cwe,finalize:Nb}});var qV=y(()=>{DV();zV();UV();ep()});import{on as uwe}from"node:events";import{finished as dwe}from"node:stream/promises";var Bb=y(()=>{rI();qV();Object.assign(Qf,{on:uwe,finished:dwe})});var BV,fwe,HV,GV,pwe,ZV,VV,Hb,Na=y(()=>{Bb();bo();So();BV=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{if(!(t instanceof Ni))throw t;if(o==="all")return t;let s=fwe(r,n,i);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},fwe=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",HV=(t,e,r)=>{if(e.length!==r)return;let n=new Ni;throw n.maxBufferInfo={fdNumber:"ipc"},n},GV=(t,e)=>{let{streamName:r,threshold:n,unit:i}=pwe(t,e);return`Command's ${r} was larger than ${n} ${i}`},pwe=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let i=vo(e,r);return r==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:J_(r),threshold:i,unit:n}},ZV=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>Hb(r)),VV=(t,e,r)=>{if(!e)return t;let n=Hb(r);return t.length>n?t.slice(0,n):t},Hb=([,t])=>t});import{inspect as mwe}from"node:util";var KV,hwe,gwe,ywe,_we,bwe,WV,JV=y(()=>{JR();nn();VR();Q_();Na();Wf();Ra();KV=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:b})=>{let _=n?.code,S=hwe({originalError:n,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:_,signal:i,signalDescription:o,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),x=ywe(n,b),w=x===void 0?"":` ${x}`,O=`${S}: ${a}${w}`,T=e===void 0?[t[2],t[1]]:[e],A=[O,...T,...t.slice(3),r.map(D=>_we(D)).join(` -`)].map(D=>Hf(Cl(bwe(D)))).filter(Boolean).join(` +`)].map(D=>Hf(Dl(bwe(D)))).filter(Boolean).join(` -`);return{originalMessage:x,shortMessage:O,message:A}},hwe=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=gwe(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${GV(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${fb(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},gwe=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",ywe=(t,e)=>{if(t instanceof ei)return;let r=f9(t)?t.originalMessage:String(t?.message??t),n=Hf(vV(r,e));return n===""?void 0:n},_we=t=>typeof t=="string"?t:mwe(t),bwe=t=>Array.isArray(t)?t.map(e=>Cl(WV(e))).filter(Boolean).join(` -`):WV(t),WV=t=>typeof t=="string"?t:qt(t)?W_(t):""});var Gb,Nl,rp,vwe,YV,Swe,np=y(()=>{Wf();ob();Ra();JV();Gb=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>YV({command:t,escapedCommand:e,cwd:o,durationMs:bR(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),Nl=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>rp({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),rp=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:S},isSync:x})=>{let{exitCode:w,signal:O,signalDescription:T}=Swe(l,u),{originalMessage:A,shortMessage:D,message:$}=KV({stdio:d,all:f,ipcOutput:p,originalError:t,signal:O,signalDescription:T,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:S,timeout:h,cwd:_}),ie=u9(t,$,x);return Object.assign(ie,vwe({error:ie,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:O,signalDescription:T,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:A,shortMessage:D})),ie},vwe=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>YV({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:bR(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),YV=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Swe=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:fb(e);return{exitCode:r,signal:n,signalDescription:i}}});function wwe(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(XV(t*1e3)%1e3),nanoseconds:Math.trunc(XV(t*1e6)%1e3)}}function xwe(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function nI(t){switch(typeof t){case"number":{if(Number.isFinite(t))return wwe(t);break}case"bigint":return xwe(t)}throw new TypeError("Expected a finite number or bigint")}var XV,QV=y(()=>{XV=t=>Number.isFinite(t)?t:0});function iI(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+Ewe);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&$we(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+kwe(d,u):f;i.push(p)}},a=nI(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%Awe):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var $we,kwe,Ewe,Awe,eW=y(()=>{QV();$we=t=>t===0||t===0n,kwe=(t,e)=>e===1||e===1n?t:`${t}s`,Ewe=1e-7,Awe=24n*60n*60n*1000n});var tW,rW=y(()=>{kl();tW=(t,e)=>{t.failed&&Pi({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var nW,Twe,iW=y(()=>{eW();ls();kl();rW();nW=(t,e)=>{xl(e)&&(tW(t,e),Twe(t,e))},Twe=(t,e)=>{let r=`(done in ${iI(t.durationMs)})`;Pi({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var jl,Zb=y(()=>{iW();jl=(t,e,{reject:r})=>{if(nW(t,e),t.failed&&r)throw t;return t}});var aW,Owe,Rwe,cW,lW,oW,Iwe,oI,sW,ja,uW,Pwe,Vb,dW,Cwe,Dwe,sI,fW,Nwe,pW,Wb,jwe,aI,Mwe,Fwe,mW,On,Kb,cI,hW,gW,ps,Sr=y(()=>{Da();yo();nn();aW=(t,e)=>ja(t)?"asyncGenerator":uW(t)?"generator":Vb(t)?"fileUrl":Cwe(t)?"filePath":jwe(t)?"webStream":ri(t,{checkOpen:!1})?"native":qt(t)?"uint8Array":Mwe(t)?"asyncIterable":Fwe(t)?"iterable":aI(t)?cW({transform:t},e):Pwe(t)?Owe(t,e):"native",Owe=(t,e)=>XR(t.transform,{checkOpen:!1})?Rwe(t,e):aI(t.transform)?cW(t,e):Iwe(t,e),Rwe=(t,e)=>(lW(t,e,"Duplex stream"),"duplex"),cW=(t,e)=>(lW(t,e,"web TransformStream"),"webTransform"),lW=({final:t,binary:e,objectMode:r},n,i)=>{oW(t,`${n}.final`,i),oW(e,`${n}.binary`,i),oI(r,`${n}.objectMode`)},oW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},Iwe=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!sW(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(XR(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(aI(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!sW(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return oI(r,`${i}.binary`),oI(n,`${i}.objectMode`),ja(t)||ja(e)?"asyncGenerator":"generator"},oI=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},sW=t=>ja(t)||uW(t),ja=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",uW=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",Pwe=t=>Ot(t)&&(t.transform!==void 0||t.final!==void 0),Vb=t=>Object.prototype.toString.call(t)==="[object URL]",dW=t=>Vb(t)&&t.protocol!=="file:",Cwe=t=>Ot(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Dwe.has(e))&&sI(t.file),Dwe=new Set(["file","append"]),sI=t=>typeof t=="string",fW=(t,e)=>t==="native"&&typeof e=="string"&&!Nwe.has(e),Nwe=new Set(["ipc","ignore","inherit","overlapped","pipe"]),pW=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Wb=t=>Object.prototype.toString.call(t)==="[object WritableStream]",jwe=t=>pW(t)||Wb(t),aI=t=>pW(t?.readable)&&Wb(t?.writable),Mwe=t=>mW(t)&&typeof t[Symbol.asyncIterator]=="function",Fwe=t=>mW(t)&&typeof t[Symbol.iterator]=="function",mW=t=>typeof t=="object"&&t!==null,On=new Set(["generator","asyncGenerator","duplex","webTransform"]),Kb=new Set(["fileUrl","filePath","fileNumber"]),cI=new Set(["fileUrl","filePath"]),hW=new Set([...cI,"webStream","nodeStream"]),gW=new Set(["webTransform","duplex"]),ps={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var lI,Lwe,zwe,yW,uI=y(()=>{Sr();lI=(t,e,r,n)=>n==="output"?Lwe(t,e,r):zwe(t,e,r),Lwe=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},zwe=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},yW=(t,e)=>{let r=t.findLast(({type:n})=>On.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var _W,Uwe,qwe,Bwe,Hwe,Gwe,Zwe,bW=y(()=>{yo();Pa();Sr();uI();_W=(t,e,r,n)=>[...t.filter(({type:i})=>!On.has(i)),...Uwe(t,e,r,n)],Uwe=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>On.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=qwe({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return Zwe(o,r)},qwe=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?Bwe({stdioItem:t,optionName:i}):e==="webTransform"?Hwe({stdioItem:t,index:r,newTransforms:n,direction:o}):Gwe({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),Bwe=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Hwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=Ot(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=lI(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},Gwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Ot(e)?e:{transform:e},d=c||on.has(o),{writableObjectMode:f,readableObjectMode:p}=lI(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Zwe=(t,e)=>e==="input"?t.reverse():t});import dI from"node:process";var vW,Vwe,Wwe,Ml,fI,SW,Kwe,Jwe,wW=y(()=>{Da();Sr();vW=(t,e,r)=>{let n=t.map(i=>Vwe(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Jwe},Vwe=({type:t,value:e},r)=>Wwe[r]??SW[t](e),Wwe=["input","output","output"],Ml=()=>{},fI=()=>"input",SW={generator:Ml,asyncGenerator:Ml,fileUrl:Ml,filePath:Ml,iterable:fI,asyncIterable:fI,uint8Array:fI,webStream:t=>Wb(t)?"output":"input",nodeStream(t){return Ca(t,{checkOpen:!1})?YR(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Ml,duplex:Ml,native(t){let e=Kwe(t);if(e!==void 0)return e;if(ri(t,{checkOpen:!1}))return SW.nodeStream(t)}},Kwe=t=>{if([0,dI.stdin].includes(t))return"input";if([1,2,dI.stdout,dI.stderr].includes(t))return"output"},Jwe="output"});var xW,$W=y(()=>{xW=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var kW,Ywe,Xwe,EW,Qwe,exe,AW=y(()=>{bo();$W();ls();kW=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Ywe(t,n).map((a,c)=>EW(a,c));return o?Qwe(s,r,i):xW(s,e)},Ywe=(t,e)=>{if(t===void 0)return Tn.map(n=>e[n]);if(Xwe(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Tn.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,Tn.length);return Array.from({length:r},(n,i)=>t[i])},Xwe=t=>Tn.some(e=>t[e]!==void 0),EW=(t,e)=>Array.isArray(t)?t.map(r=>EW(r,e)):t??(e>=Tn.length?"ignore":"pipe"),Qwe=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!$l(r,i)&&exe(n)?"ignore":n),exe=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as txe}from"node:fs";import rxe from"node:tty";var OW,nxe,ixe,oxe,sxe,TW,RW=y(()=>{Da();bo();nn();ds();OW=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?nxe({stdioItem:t,fdNumber:n,direction:i}):sxe({stdioItem:t,fdNumber:n}),nxe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=ixe({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(ri(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},ixe=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=oxe(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(rxe.isatty(i))throw new TypeError(`The \`${e}: ${gb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:_o(txe(i)),optionName:e}}},oxe=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=K_.indexOf(t);if(r!==-1)return r},sxe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:TW(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:TW(e,e,r),optionName:r}:ri(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,TW=(t,e,r)=>{let n=K_[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var IW,axe,cxe,lxe,uxe,PW=y(()=>{Da();nn();Sr();IW=({input:t,inputFile:e},r)=>r===0?[...axe(t),...lxe(e)]:[],axe=t=>t===void 0?[]:[{type:cxe(t),value:t,optionName:"input"}],cxe=t=>{if(Ca(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(qt(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},lxe=t=>t===void 0?[]:[{...uxe(t),optionName:"inputFile"}],uxe=t=>{if(Vb(t))return{type:"fileUrl",value:t};if(sI(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var CW,DW,dxe,fxe,NW,pxe,mxe,jW,MW=y(()=>{Sr();CW=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),DW=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=dxe(i,t);if(s.length!==0){if(o){fxe({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(hW.has(t))return NW({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});gW.has(t)&&mxe({otherStdioItems:s,type:t,value:e,optionName:r})}},dxe=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),fxe=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{cI.has(e)&&NW({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},NW=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>pxe(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return jW(s,n,e),i==="output"?o[0].stream:void 0},pxe=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,mxe=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);jW(i,n,e)},jW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${ps[r]} that is the same.`)}});var Jb,hxe,gxe,yxe,_xe,bxe,vxe,Sxe,wxe,xxe,$xe,kxe,pI,Exe,Yb=y(()=>{bo();bW();uI();Sr();wW();AW();RW();PW();MW();Jb=(t,e,r,n)=>{let o=kW(e,r,n).map((a,c)=>hxe({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=xxe({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>Exe(a)),s},hxe=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=J_(e),{stdioItems:o,isStdioArray:s}=gxe({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=vW(o,e,i),c=o.map(d=>OW({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=_W(c,i,a,r),u=yW(l,a);return wxe(l,u),{direction:a,objectMode:u,stdioItems:l}},gxe=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>yxe(c,n)),...IW(r,e)],s=CW(o),a=s.length>1;return _xe(s,a,n),vxe(s),{stdioItems:s,isStdioArray:a}},yxe=(t,e)=>({type:aW(t,e),value:t,optionName:e}),_xe=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(bxe.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},bxe=new Set(["ignore","ipc"]),vxe=t=>{for(let e of t)Sxe(e)},Sxe=({type:t,value:e,optionName:r})=>{if(dW(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. -For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(fW(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},wxe=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>Kb.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},xxe=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push($xe({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw pI(i),o}},$xe=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>kxe({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},kxe=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=DW({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},pI=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Qn(r)&&r.destroy()},Exe=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as FW}from"node:fs";var zW,ji,Axe,UW,LW,Txe,qW=y(()=>{nn();Yb();Sr();zW=(t,e)=>Jb(Txe,t,e,!0),ji=({type:t,optionName:e})=>{UW(e,ps[t])},Axe=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&UW(t,`"${e}"`),{}),UW=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},LW={generator(){},asyncGenerator:ji,webStream:ji,nodeStream:ji,webTransform:ji,duplex:ji,asyncIterable:ji,native:Axe},Txe={input:{...LW,fileUrl:({value:t})=>({contents:[_o(FW(t))]}),filePath:({value:{file:t}})=>({contents:[_o(FW(t))]}),fileNumber:ji,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...LW,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:ji,string:ji,uint8Array:ji}}});var xo,mI,ip=y(()=>{JR();xo=(t,{stripFinalNewline:e},r)=>mI(e,r)&&t!==void 0&&!Array.isArray(t)?Cl(t):t,mI=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var Xb,gI,BW,HW,Oxe,Rxe,Ixe,GW,Pxe,hI,Cxe,Dxe,Nxe,Qb=y(()=>{Xb=(t,e,r,n)=>t||r?void 0:HW(e,n),gI=(t,e,r)=>r?t.flatMap(n=>BW(n,e)):BW(t,e),BW=(t,e)=>{let{transform:r,final:n}=HW(e,{});return[...r(t),...n()]},HW=(t,e)=>(e.previousChunks="",{transform:Oxe.bind(void 0,e,t),final:Ixe.bind(void 0,e)}),Oxe=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o{let m=gwe(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${GV(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${fb(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},gwe=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",ywe=(t,e)=>{if(t instanceof ei)return;let r=f9(t)?t.originalMessage:String(t?.message??t),n=Hf(vV(r,e));return n===""?void 0:n},_we=t=>typeof t=="string"?t:mwe(t),bwe=t=>Array.isArray(t)?t.map(e=>Dl(WV(e))).filter(Boolean).join(` +`):WV(t),WV=t=>typeof t=="string"?t:qt(t)?W_(t):""});var Gb,jl,rp,vwe,YV,Swe,np=y(()=>{Wf();ob();Ra();JV();Gb=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>YV({command:t,escapedCommand:e,cwd:o,durationMs:bR(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),jl=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>rp({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),rp=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:S},isSync:x})=>{let{exitCode:w,signal:O,signalDescription:T}=Swe(l,u),{originalMessage:A,shortMessage:D,message:$}=KV({stdio:d,all:f,ipcOutput:p,originalError:t,signal:O,signalDescription:T,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:S,timeout:h,cwd:_}),ie=u9(t,$,x);return Object.assign(ie,vwe({error:ie,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:O,signalDescription:T,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:A,shortMessage:D})),ie},vwe=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>YV({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:bR(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),YV=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Swe=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:fb(e);return{exitCode:r,signal:n,signalDescription:i}}});function wwe(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(XV(t*1e3)%1e3),nanoseconds:Math.trunc(XV(t*1e6)%1e3)}}function xwe(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function nI(t){switch(typeof t){case"number":{if(Number.isFinite(t))return wwe(t);break}case"bigint":return xwe(t)}throw new TypeError("Expected a finite number or bigint")}var XV,QV=y(()=>{XV=t=>Number.isFinite(t)?t:0});function iI(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+Ewe);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&$we(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+kwe(d,u):f;i.push(p)}},a=nI(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%Awe):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var $we,kwe,Ewe,Awe,eW=y(()=>{QV();$we=t=>t===0||t===0n,kwe=(t,e)=>e===1||e===1n?t:`${t}s`,Ewe=1e-7,Awe=24n*60n*60n*1000n});var tW,rW=y(()=>{El();tW=(t,e)=>{t.failed&&Pi({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var nW,Twe,iW=y(()=>{eW();ls();El();rW();nW=(t,e)=>{$l(e)&&(tW(t,e),Twe(t,e))},Twe=(t,e)=>{let r=`(done in ${iI(t.durationMs)})`;Pi({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Ml,Zb=y(()=>{iW();Ml=(t,e,{reject:r})=>{if(nW(t,e),t.failed&&r)throw t;return t}});var aW,Owe,Rwe,cW,lW,oW,Iwe,oI,sW,ja,uW,Pwe,Vb,dW,Cwe,Dwe,sI,fW,Nwe,pW,Wb,jwe,aI,Mwe,Fwe,mW,On,Kb,cI,hW,gW,ps,Sr=y(()=>{Da();yo();nn();aW=(t,e)=>ja(t)?"asyncGenerator":uW(t)?"generator":Vb(t)?"fileUrl":Cwe(t)?"filePath":jwe(t)?"webStream":ri(t,{checkOpen:!1})?"native":qt(t)?"uint8Array":Mwe(t)?"asyncIterable":Fwe(t)?"iterable":aI(t)?cW({transform:t},e):Pwe(t)?Owe(t,e):"native",Owe=(t,e)=>XR(t.transform,{checkOpen:!1})?Rwe(t,e):aI(t.transform)?cW(t,e):Iwe(t,e),Rwe=(t,e)=>(lW(t,e,"Duplex stream"),"duplex"),cW=(t,e)=>(lW(t,e,"web TransformStream"),"webTransform"),lW=({final:t,binary:e,objectMode:r},n,i)=>{oW(t,`${n}.final`,i),oW(e,`${n}.binary`,i),oI(r,`${n}.objectMode`)},oW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},Iwe=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!sW(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(XR(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(aI(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!sW(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return oI(r,`${i}.binary`),oI(n,`${i}.objectMode`),ja(t)||ja(e)?"asyncGenerator":"generator"},oI=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},sW=t=>ja(t)||uW(t),ja=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",uW=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",Pwe=t=>Ot(t)&&(t.transform!==void 0||t.final!==void 0),Vb=t=>Object.prototype.toString.call(t)==="[object URL]",dW=t=>Vb(t)&&t.protocol!=="file:",Cwe=t=>Ot(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Dwe.has(e))&&sI(t.file),Dwe=new Set(["file","append"]),sI=t=>typeof t=="string",fW=(t,e)=>t==="native"&&typeof e=="string"&&!Nwe.has(e),Nwe=new Set(["ipc","ignore","inherit","overlapped","pipe"]),pW=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Wb=t=>Object.prototype.toString.call(t)==="[object WritableStream]",jwe=t=>pW(t)||Wb(t),aI=t=>pW(t?.readable)&&Wb(t?.writable),Mwe=t=>mW(t)&&typeof t[Symbol.asyncIterator]=="function",Fwe=t=>mW(t)&&typeof t[Symbol.iterator]=="function",mW=t=>typeof t=="object"&&t!==null,On=new Set(["generator","asyncGenerator","duplex","webTransform"]),Kb=new Set(["fileUrl","filePath","fileNumber"]),cI=new Set(["fileUrl","filePath"]),hW=new Set([...cI,"webStream","nodeStream"]),gW=new Set(["webTransform","duplex"]),ps={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var lI,Lwe,zwe,yW,uI=y(()=>{Sr();lI=(t,e,r,n)=>n==="output"?Lwe(t,e,r):zwe(t,e,r),Lwe=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},zwe=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},yW=(t,e)=>{let r=t.findLast(({type:n})=>On.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var _W,Uwe,qwe,Bwe,Hwe,Gwe,Zwe,bW=y(()=>{yo();Pa();Sr();uI();_W=(t,e,r,n)=>[...t.filter(({type:i})=>!On.has(i)),...Uwe(t,e,r,n)],Uwe=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>On.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=qwe({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return Zwe(o,r)},qwe=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?Bwe({stdioItem:t,optionName:i}):e==="webTransform"?Hwe({stdioItem:t,index:r,newTransforms:n,direction:o}):Gwe({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),Bwe=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Hwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=Ot(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=lI(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},Gwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Ot(e)?e:{transform:e},d=c||on.has(o),{writableObjectMode:f,readableObjectMode:p}=lI(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Zwe=(t,e)=>e==="input"?t.reverse():t});import dI from"node:process";var vW,Vwe,Wwe,Fl,fI,SW,Kwe,Jwe,wW=y(()=>{Da();Sr();vW=(t,e,r)=>{let n=t.map(i=>Vwe(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Jwe},Vwe=({type:t,value:e},r)=>Wwe[r]??SW[t](e),Wwe=["input","output","output"],Fl=()=>{},fI=()=>"input",SW={generator:Fl,asyncGenerator:Fl,fileUrl:Fl,filePath:Fl,iterable:fI,asyncIterable:fI,uint8Array:fI,webStream:t=>Wb(t)?"output":"input",nodeStream(t){return Ca(t,{checkOpen:!1})?YR(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Fl,duplex:Fl,native(t){let e=Kwe(t);if(e!==void 0)return e;if(ri(t,{checkOpen:!1}))return SW.nodeStream(t)}},Kwe=t=>{if([0,dI.stdin].includes(t))return"input";if([1,2,dI.stdout,dI.stderr].includes(t))return"output"},Jwe="output"});var xW,$W=y(()=>{xW=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var kW,Ywe,Xwe,EW,Qwe,exe,AW=y(()=>{bo();$W();ls();kW=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Ywe(t,n).map((a,c)=>EW(a,c));return o?Qwe(s,r,i):xW(s,e)},Ywe=(t,e)=>{if(t===void 0)return Tn.map(n=>e[n]);if(Xwe(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Tn.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,Tn.length);return Array.from({length:r},(n,i)=>t[i])},Xwe=t=>Tn.some(e=>t[e]!==void 0),EW=(t,e)=>Array.isArray(t)?t.map(r=>EW(r,e)):t??(e>=Tn.length?"ignore":"pipe"),Qwe=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!kl(r,i)&&exe(n)?"ignore":n),exe=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as txe}from"node:fs";import rxe from"node:tty";var OW,nxe,ixe,oxe,sxe,TW,RW=y(()=>{Da();bo();nn();ds();OW=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?nxe({stdioItem:t,fdNumber:n,direction:i}):sxe({stdioItem:t,fdNumber:n}),nxe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=ixe({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(ri(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},ixe=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=oxe(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(rxe.isatty(i))throw new TypeError(`The \`${e}: ${gb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:_o(txe(i)),optionName:e}}},oxe=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=K_.indexOf(t);if(r!==-1)return r},sxe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:TW(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:TW(e,e,r),optionName:r}:ri(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,TW=(t,e,r)=>{let n=K_[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var IW,axe,cxe,lxe,uxe,PW=y(()=>{Da();nn();Sr();IW=({input:t,inputFile:e},r)=>r===0?[...axe(t),...lxe(e)]:[],axe=t=>t===void 0?[]:[{type:cxe(t),value:t,optionName:"input"}],cxe=t=>{if(Ca(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(qt(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},lxe=t=>t===void 0?[]:[{...uxe(t),optionName:"inputFile"}],uxe=t=>{if(Vb(t))return{type:"fileUrl",value:t};if(sI(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var CW,DW,dxe,fxe,NW,pxe,mxe,jW,MW=y(()=>{Sr();CW=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),DW=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=dxe(i,t);if(s.length!==0){if(o){fxe({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(hW.has(t))return NW({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});gW.has(t)&&mxe({otherStdioItems:s,type:t,value:e,optionName:r})}},dxe=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),fxe=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{cI.has(e)&&NW({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},NW=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>pxe(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return jW(s,n,e),i==="output"?o[0].stream:void 0},pxe=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,mxe=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);jW(i,n,e)},jW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${ps[r]} that is the same.`)}});var Jb,hxe,gxe,yxe,_xe,bxe,vxe,Sxe,wxe,xxe,$xe,kxe,pI,Exe,Yb=y(()=>{bo();bW();uI();Sr();wW();AW();RW();PW();MW();Jb=(t,e,r,n)=>{let o=kW(e,r,n).map((a,c)=>hxe({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=xxe({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>Exe(a)),s},hxe=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=J_(e),{stdioItems:o,isStdioArray:s}=gxe({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=vW(o,e,i),c=o.map(d=>OW({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=_W(c,i,a,r),u=yW(l,a);return wxe(l,u),{direction:a,objectMode:u,stdioItems:l}},gxe=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>yxe(c,n)),...IW(r,e)],s=CW(o),a=s.length>1;return _xe(s,a,n),vxe(s),{stdioItems:s,isStdioArray:a}},yxe=(t,e)=>({type:aW(t,e),value:t,optionName:e}),_xe=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(bxe.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},bxe=new Set(["ignore","ipc"]),vxe=t=>{for(let e of t)Sxe(e)},Sxe=({type:t,value:e,optionName:r})=>{if(dW(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. +For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(fW(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},wxe=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>Kb.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},xxe=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push($xe({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw pI(i),o}},$xe=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>kxe({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},kxe=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=DW({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},pI=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Qn(r)&&r.destroy()},Exe=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as FW}from"node:fs";var zW,ji,Axe,UW,LW,Txe,qW=y(()=>{nn();Yb();Sr();zW=(t,e)=>Jb(Txe,t,e,!0),ji=({type:t,optionName:e})=>{UW(e,ps[t])},Axe=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&UW(t,`"${e}"`),{}),UW=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},LW={generator(){},asyncGenerator:ji,webStream:ji,nodeStream:ji,webTransform:ji,duplex:ji,asyncIterable:ji,native:Axe},Txe={input:{...LW,fileUrl:({value:t})=>({contents:[_o(FW(t))]}),filePath:({value:{file:t}})=>({contents:[_o(FW(t))]}),fileNumber:ji,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...LW,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:ji,string:ji,uint8Array:ji}}});var xo,mI,ip=y(()=>{JR();xo=(t,{stripFinalNewline:e},r)=>mI(e,r)&&t!==void 0&&!Array.isArray(t)?Dl(t):t,mI=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var Xb,gI,BW,HW,Oxe,Rxe,Ixe,GW,Pxe,hI,Cxe,Dxe,Nxe,Qb=y(()=>{Xb=(t,e,r,n)=>t||r?void 0:HW(e,n),gI=(t,e,r)=>r?t.flatMap(n=>BW(n,e)):BW(t,e),BW=(t,e)=>{let{transform:r,final:n}=HW(e,{});return[...r(t),...n()]},HW=(t,e)=>(e.previousChunks="",{transform:Oxe.bind(void 0,e,t),final:Ixe.bind(void 0,e)}),Oxe=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o0&&(a=hI(n,a),n=""),yield a,i=o}i!==r.length-1&&(n=hI(n,r.slice(i+1))),t.previousChunks=n},Rxe=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),Ixe=function*({previousChunks:t}){t.length>0&&(yield t)},GW=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:Pxe.bind(void 0,n)},Pxe=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}=typeof e=="string"?Cxe:Nxe;if(e.at(-1)===i){yield e;return}yield o(e,t?n:r)},hI=(t,e)=>`${t}${e}`,Cxe={windowsNewline:`\r `,unixNewline:` `,LF:` `,concatBytes:hI},Dxe=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},Nxe={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Dxe}});import{Buffer as jxe}from"node:buffer";var ZW,Mxe,VW,Fxe,Lxe,WW,KW=y(()=>{nn();ZW=(t,e)=>t?void 0:Mxe.bind(void 0,e),Mxe=function*(t,e){if(typeof e!="string"&&!qt(e)&&!jxe.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},VW=(t,e)=>t?Fxe.bind(void 0,e):Lxe.bind(void 0,e),Fxe=function*(t,e){WW(t,e),yield e},Lxe=function*(t,e){if(WW(t,e),typeof e!="string"&&!qt(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},WW=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`. Instead, \`yield\` should either be called with a value, or not be called at all. For example: - if (condition) { yield value; }`)}});import{Buffer as zxe}from"node:buffer";import{StringDecoder as Uxe}from"node:string_decoder";var ev,qxe,Bxe,Hxe,yI=y(()=>{nn();ev=(t,e,r)=>{if(r)return;if(t)return{transform:qxe.bind(void 0,new TextEncoder)};let n=new Uxe(e);return{transform:Bxe.bind(void 0,n),final:Hxe.bind(void 0,n)}},qxe=function*(t,e){zxe.isBuffer(e)?yield _o(e):typeof e=="string"?yield t.encode(e):yield e},Bxe=function*(t,e){yield qt(e)?t.write(e):e},Hxe=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as JW}from"node:util";var _I,tv,YW,Gxe,XW,Zxe,QW=y(()=>{_I=JW(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),tv=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Zxe}=e[r];for await(let i of n(t))yield*tv(i,e,r+1)},YW=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Gxe(r,Number(e),t)},Gxe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*tv(n,r,e+1)},XW=JW(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Zxe=function*(t){yield t}});var bI,e3,Ma,op,Vxe,Wxe,vI=y(()=>{bI=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},e3=(t,e)=>[...e.flatMap(r=>[...Ma(r,t,0)]),...op(t)],Ma=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Wxe}=e[r];for(let i of n(t))yield*Ma(i,e,r+1)},op=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Vxe(r,Number(e),t)},Vxe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ma(n,r,e+1)},Wxe=function*(t){yield t}});import{Transform as Kxe,getDefaultHighWaterMark as t3}from"node:stream";var SI,rv,r3,nv=y(()=>{Sr();Qb();KW();yI();QW();vI();SI=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=r3(t,s,o),l=ja(e),u=ja(r),d=l?_I.bind(void 0,tv,a):bI.bind(void 0,Ma),f=l||u?_I.bind(void 0,YW,a):bI.bind(void 0,op),p=l||u?XW.bind(void 0,a):void 0;return{stream:new Kxe({writableObjectMode:n,writableHighWaterMark:t3(n),readableObjectMode:i,readableHighWaterMark:t3(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},rv=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=r3(s,r,a);t=e3(c,t)}return t},r3=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:ZW(n,a)},ev(r,s,n),Xb(r,o,n,c),{transform:t,final:e},{transform:VW(i,a)},GW({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var n3,Jxe,Yxe,Xxe,Qxe,i3=y(()=>{nv();nn();Sr();n3=(t,e)=>{for(let r of Jxe(t))Yxe(t,r,e)},Jxe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Yxe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ps[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>Xxe(a,n));r.input=Bf(s)},Xxe=(t,e)=>{let r=rv(t,e,"utf8",!0);return Qxe(r),Bf(r)},Qxe=t=>{let e=t.find(r=>typeof r!="string"&&!qt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var iv,e0e,t0e,o3,s3,r0e,a3,wI=y(()=>{Pa();Sr();kl();ls();iv=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&$l(r,n)&&!on.has(e)&&e0e(n)&&(t.some(({type:i,value:o})=>i==="native"&&t0e.has(o))||t.every(({type:i})=>On.has(i))),e0e=t=>t===1||t===2,t0e=new Set(["pipe","overlapped"]),o3=async(t,e,r,n)=>{for await(let i of t)r0e(e)||a3(i,r,n)},s3=(t,e,r)=>{for(let n of t)a3(n,e,r)},r0e=t=>t._readableState.pipes.length>0,a3=(t,e,r)=>{let n=nb(t);Pi({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as n0e,appendFileSync as i0e}from"node:fs";var c3,o0e,s0e,a0e,c0e,l0e,l3=y(()=>{wI();nv();Qb();nn();Sr();Na();c3=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>o0e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},o0e=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=VV(t,o,d),p=_o(f),{stdioItems:m,objectMode:h}=e[r],g=s0e([p],m,c,n),{serializedResult:b,finalResult:_=b}=a0e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});c0e({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&l0e(b,m,i),S}catch(x){return n.error=x,S}},s0e=(t,e,r,n)=>{try{return rv(t,e,r,!1)}catch(i){return n.error=i,t}},a0e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Bf(t)};let s=MG(t,r);return n[o]?{serializedResult:s,finalResult:gI(s,!i[o],e)}:{serializedResult:s}},c0e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!iv({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=gI(t,!1,s);try{s3(a,e,n)}catch(c){r.error??=c}},l0e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>Kb.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?i0e(n,t):(r.add(o),n0e(n,t))}}});var u3,d3=y(()=>{nn();ip();u3=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,xo(e,r,"all")]:Array.isArray(e)?[xo(t,r,"all"),...e]:qt(t)&&qt(e)?dR([t,e]):`${t}${e}`}});import{once as xI}from"node:events";var f3,u0e,p3,m3,d0e,$I,kI=y(()=>{Ra();f3=async(t,e)=>{let[r,n]=await u0e(t);return e.isForcefullyTerminated??=!1,[r,n]},u0e=async t=>{let[e,r]=await Promise.allSettled([xI(t,"spawn"),xI(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?p3(t):r.value},p3=async t=>{try{return await xI(t,"exit")}catch{return p3(t)}},m3=async t=>{let[e,r]=await t;if(!d0e(e,r)&&$I(e,r))throw new ei;return[e,r]},d0e=(t,e)=>t===void 0&&e===void 0,$I=(t,e)=>t!==0||e!==null});var h3,f0e,g3=y(()=>{Ra();Na();kI();h3=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=f0e(t,e,r),s=o?.code==="ETIMEDOUT",a=ZV(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},f0e=(t,e,r)=>t!==void 0?t:$I(e,r)?new ei:void 0});import{spawnSync as p0e}from"node:child_process";var y3,m0e,h0e,g0e,ov,y0e,_0e,b0e,v0e,_3=y(()=>{vR();WR();KR();np();Zb();qW();ip();i3();l3();Na();d3();g3();y3=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=m0e(t,e,r),d=y0e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return jl(d,c,l)},m0e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=sb(t,e,r),a=h0e(r),{file:c,commandArguments:l,options:u}=Cb(t,e,a);g0e(u);let d=zW(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},h0e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,g0e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&ov("ipcInput"),t&&ov("ipc: true"),r&&ov("detached: true"),n&&ov("cancelSignal")},ov=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},y0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=_0e({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=h3(c,r),{output:m,error:h=l}=c3({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>xo(_,r,S)),b=xo(u3(m,r),r,"all");return v0e({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},_0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{n3(o,r);let a=b0e(r);return p0e(...Db(t,e,a))}catch(a){return Nl({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},b0e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Hb(e)}),v0e=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?Gb({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):rp({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as EI,on as S0e}from"node:events";var b3,w0e,x0e,$0e,k0e,v3=y(()=>{Rl();Yf();Jf();b3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(Tl({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Eb(t)}),w0e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),w0e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{bb(e,i);let o=fs(t,e,r),s=new AbortController;try{return await Promise.race([x0e(o,n,s),$0e(o,r,s),k0e(o,r,s)])}catch(a){throw Ol(t),a}finally{s.abort(),vb(e,i)}},x0e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await EI(t,"message",{signal:r});return n}for await(let[n]of S0e(t,"message",{signal:r}))if(e(n))return n},$0e=async(t,e,{signal:r})=>{await EI(t,"disconnect",{signal:r}),I9(e)},k0e=async(t,e,{signal:r})=>{let[n]=await EI(t,"strict:error",{signal:r});throw hb(n,e)}});import{once as w3,on as E0e}from"node:events";var x3,AI,A0e,T0e,O0e,S3,TI=y(()=>{Rl();Yf();Jf();x3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>AI({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),AI=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{Tl({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Eb(t)}),bb(e,o);let s=fs(t,e,r),a=new AbortController,c={};return A0e(t,s,a),T0e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),O0e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},A0e=async(t,e,r)=>{try{await w3(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},T0e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await w3(t,"strict:error",{signal:r.signal});n.error=hb(i,e),r.abort()}catch{}},O0e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of E0e(r,"message",{signal:o.signal}))S3(s),yield c}catch{S3(s)}finally{o.abort(),vb(e,a),n||Ol(t),i&&await t}},S3=({error:t})=>{if(t)throw t}});import $3 from"node:process";var k3,E3,A3,OI=y(()=>{Ib();v3();TI();$b();k3=(t,{ipc:e})=>{Object.assign(t,A3(t,!1,e))},E3=()=>{let t=$3,e=!0,r=$3.channel!==void 0;return{...A3(t,e,r),getCancelSignal:oV.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},A3=(t,e,r)=>({sendMessage:Rb.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:b3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:x3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as R0e}from"node:child_process";import{PassThrough as I0e,Readable as P0e,Writable as C0e,Duplex as D0e}from"node:stream";var T3,N0e,sp,j0e,M0e,F0e,L0e,O3=y(()=>{Yb();np();Zb();T3=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{pI(n);let a=new R0e;N0e(a,n),Object.assign(a,{readable:j0e,writable:M0e,duplex:F0e});let c=Nl({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=L0e(c,s,i);return{subprocess:a,promise:l}},N0e=(t,e)=>{let r=sp(),n=sp(),i=sp(),o=Array.from({length:e.length-3},sp),s=sp(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},sp=()=>{let t=new I0e;return t.end(),t},j0e=()=>new P0e({read(){}}),M0e=()=>new C0e({write(){}}),F0e=()=>new D0e({read(){},write(){}}),L0e=async(t,e,r)=>jl(t,e,r)});import{createReadStream as R3,createWriteStream as I3}from"node:fs";import{Buffer as z0e}from"node:buffer";import{Readable as ap,Writable as U0e,Duplex as q0e}from"node:stream";var C3,cp,P3,B0e,D3=y(()=>{nv();Yb();Sr();C3=(t,e)=>Jb(B0e,t,e,!1),cp=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ps[t]}.`)},P3={fileNumber:cp,generator:SI,asyncGenerator:SI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:q0e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},B0e={input:{...P3,fileUrl:({value:t})=>({stream:R3(t)}),filePath:({value:{file:t}})=>({stream:R3(t)}),webStream:({value:t})=>({stream:ap.fromWeb(t)}),iterable:({value:t})=>({stream:ap.from(t)}),asyncIterable:({value:t})=>({stream:ap.from(t)}),string:({value:t})=>({stream:ap.from(t)}),uint8Array:({value:t})=>({stream:ap.from(z0e.from(t))})},output:{...P3,fileUrl:({value:t})=>({stream:I3(t)}),filePath:({value:{file:t,append:e}})=>({stream:I3(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:U0e.fromWeb(t)}),iterable:cp,asyncIterable:cp,string:cp,uint8Array:cp}}});import{on as H0e,once as N3}from"node:events";import{PassThrough as G0e,getDefaultHighWaterMark as Z0e}from"node:stream";import{finished as F3}from"node:stream/promises";function Fa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)II(i);let e=t.some(({readableObjectMode:i})=>i),r=V0e(t,e),n=new RI({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var V0e,RI,W0e,K0e,J0e,II,Y0e,X0e,Q0e,e$e,t$e,L3,z3,PI,U3,r$e,sv,j3,M3,av=y(()=>{V0e=(t,e)=>{if(t.length===0)return Z0e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},RI=class extends G0e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(II(e),this.#t.has(e))return;this.#t.add(e),this.#n??=W0e(this,this.#t,this.#o);let r=Y0e({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(II(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},W0e=async(t,e,r)=>{sv(t,j3);let n=new AbortController;try{await Promise.race([K0e(t,n),J0e(t,e,r,n)])}finally{n.abort(),sv(t,-j3)}},K0e=async(t,{signal:e})=>{try{await F3(t,{signal:e,cleanup:!0})}catch(r){throw L3(t,r),r}},J0e=async(t,e,r,{signal:n})=>{for await(let[i]of H0e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},II=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Y0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{sv(t,M3);let a=new AbortController;try{await Promise.race([X0e(o,e,a),Q0e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),e$e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),sv(t,-M3)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?PI(t):t$e(t))},X0e=async(t,e,{signal:r})=>{try{await t,r.aborted||PI(e)}catch(n){r.aborted||L3(e,n)}},Q0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await F3(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;z3(s)?i.add(e):U3(t,s)}},e$e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await N3(t,i,{signal:o}),!t.readable)return N3(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},t$e=t=>{t.writable&&t.end()},L3=(t,e)=>{z3(e)?PI(t):U3(t,e)},z3=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",PI=t=>{(t.readable||t.writable)&&t.destroy()},U3=(t,e)=>{t.destroyed||(t.once("error",r$e),t.destroy(e))},r$e=()=>{},sv=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},j3=2,M3=1});import{finished as q3}from"node:stream/promises";var Fl,n$e,CI,i$e,DI,cv=y(()=>{bo();Fl=(t,e)=>{t.pipe(e),n$e(t,e),i$e(t,e)},n$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await q3(t,{cleanup:!0,readable:!0,writable:!1})}catch{}CI(e)}},CI=t=>{t.writable&&t.end()},i$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await q3(e,{cleanup:!0,readable:!1,writable:!0})}catch{}DI(t)}},DI=t=>{t.readable&&t.destroy()}});var B3,o$e,s$e,a$e,c$e,l$e,H3=y(()=>{av();bo();_b();Sr();cv();B3=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>On.has(c)))o$e(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!On.has(c)))a$e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Fa(o);Fl(s,i)}},o$e=(t,e,r,n)=>{r==="output"?Fl(t.stdio[n],e):Fl(e,t.stdio[n]);let i=s$e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},s$e=["stdin","stdout","stderr"],a$e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;c$e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},c$e=(t,{signal:e})=>{Qn(t)&&Ia(t,l$e,e)},l$e=2});var La,G3=y(()=>{La=[];La.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&La.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&La.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var lv,NI,jI,u$e,MI,uv,d$e,FI,LI,zI,Z3,Qst,eat,V3=y(()=>{G3();lv=t=>!!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",NI=Symbol.for("signal-exit emitter"),jI=globalThis,u$e=Object.defineProperty.bind(Object),MI=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(jI[NI])return jI[NI];u$e(jI,NI,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},uv=class{},d$e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),FI=class extends uv{onExit(){return()=>{}}load(){}unload(){}},LI=class extends uv{#t=zI.platform==="win32"?"SIGINT":"SIGHUP";#r=new MI;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of La)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!lv(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of La)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,La.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return lv(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&lv(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},zI=globalThis.process,{onExit:Z3,load:Qst,unload:eat}=d$e(lv(zI)?new LI(zI):new FI)});import{addAbortListener as f$e}from"node:events";var W3,K3=y(()=>{V3();W3=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=Z3(()=>{t.kill()});f$e(n,()=>{i()})}});var Y3,p$e,m$e,J3,h$e,X3=y(()=>{uR();ob();ds();wl();Y3=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=ib(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=p$e(r,n,i),{sourceStream:d,sourceError:f}=h$e(t,l),{options:p,fileDescriptors:m}=Di.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},p$e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=m$e(t,e,...r),a=yb(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},m$e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(J3,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||cR(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=V_(r,...n);return{destination:e(J3)(i,o,s),pipeOptions:s}}if(Di.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},J3=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),h$e=(t,e)=>{try{return{sourceStream:Pl(t,e)}}catch(r){return{sourceError:r}}}});var eK,g$e,UI,Q3,qI=y(()=>{np();cv();eK=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=g$e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw UI({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},g$e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return DI(t),n;if(e!==void 0)return CI(r),e},UI=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Nl({error:t,command:Q3,escapedCommand:Q3,fileDescriptors:e,options:r,startTime:n,isSync:!1}),Q3="source.pipe(destination)"});var tK,rK=y(()=>{tK=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as y$e}from"node:stream/promises";var nK,_$e,b$e,v$e,dv,S$e,w$e,iK=y(()=>{av();_b();cv();nK=(t,e,r)=>{let n=dv.has(e)?b$e(t,e):_$e(t,e);return Ia(t,S$e,r.signal),Ia(e,w$e,r.signal),v$e(e),n},_$e=(t,e)=>{let r=Fa([t]);return Fl(r,e),dv.set(e,r),r},b$e=(t,e)=>{let r=dv.get(e);return r.add(t),r},v$e=async t=>{try{await y$e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}dv.delete(t)},dv=new WeakMap,S$e=2,w$e=1});import{aborted as x$e}from"node:util";var oK,$$e,sK=y(()=>{qI();oK=(t,e)=>t===void 0?[]:[$$e(t,e)],$$e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await x$e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw UI({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var fv,k$e,E$e,aK=y(()=>{yo();X3();qI();rK();iK();sK();fv=(t,...e)=>{if(Ot(e[0]))return fv.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Y3(t,...e),i=k$e({...n,destination:r});return i.pipe=fv.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},k$e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=E$e(t,i);eK({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=nK(e,o,d);return await Promise.race([tK(u),...oK(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},E$e=(t,e)=>Promise.allSettled([t,e])});import{on as A$e}from"node:events";import{getDefaultHighWaterMark as T$e}from"node:stream";var pv,O$e,BI,R$e,lK,HI,cK,I$e,P$e,mv=y(()=>{yI();Qb();vI();pv=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return O$e(e,s),lK({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},O$e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},BI=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;R$e(e,s,t);let a=t.readableObjectMode&&!o;return lK({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},R$e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},lK=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=A$e(t,"data",{signal:e.signal,highWaterMark:cK,highWatermark:cK});return I$e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},HI=T$e(!0),cK=HI,I$e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=P$e({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ma(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*op(a)}},P$e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[ev(t,r,!e),Xb(t,i,!n,{})].filter(Boolean)});import{setImmediate as C$e}from"node:timers/promises";var uK,D$e,N$e,j$e,GI,dK,ZI=y(()=>{Bb();nn();wI();mv();Na();ip();uK=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=D$e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([N$e(t),d]);return}let f=mI(c,r),p=BI({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([j$e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},D$e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!iv({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=BI({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await o3(a,t,r,o)},N$e=async t=>{await C$e(),t.readableFlowing===null&&t.resume()},j$e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await Lb(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await zb(r,{maxBuffer:o})):await qb(r,{maxBuffer:o})}catch(a){return dK(BV({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},GI=async t=>{try{return await t}catch(e){return dK(e)}},dK=({bufferedData:t})=>NG(t)?new Uint8Array(t):t});import{finished as M$e}from"node:stream/promises";var lp,F$e,L$e,z$e,U$e,q$e,VI,hv,fK,gv=y(()=>{lp=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=F$e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],M$e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||U$e(a,e,r,n)}finally{s.abort()}},F$e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&L$e(t,r,n),n},L$e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{z$e(e,r),n.call(t,...i)}},z$e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},U$e=(t,e,r,n)=>{if(!q$e(t,e,r,n))throw t},q$e=(t,e,r,n=!0)=>r.propagating?fK(t)||hv(t):(r.propagating=!0,VI(r,e)===n?fK(t):hv(t)),VI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",hv=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",fK=t=>t?.code==="EPIPE"});var pK,WI,KI=y(()=>{ZI();gv();pK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>WI({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),WI=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=lp(t,e,l);if(VI(l,e)){await u;return}let[d]=await Promise.all([uK({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var mK,hK,B$e,H$e,JI=y(()=>{av();KI();mK=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Fa([t,e].filter(Boolean)):void 0,hK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>WI({...B$e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:H$e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),B$e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},H$e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var gK,yK,_K=y(()=>{kl();ls();gK=t=>$l(t,"ipc"),yK=(t,e)=>{let r=nb(t);Pi({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var bK,vK,SK=y(()=>{Na();_K();So();TI();bK=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=gK(o),a=vo(e,"ipc"),c=vo(r,"ipc");for await(let l of AI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(HV(t,i,c),i.push(l)),s&&yK(l,o);return i},vK=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as G$e}from"node:events";var wK,Z$e,V$e,W$e,xK=y(()=>{Da();BR();DR();qR();bo();Sr();ZI();SK();GR();JI();KI();kI();gv();wK=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:b})=>{let _=f3(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=pK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=hK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),O=[],T=bK({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),A=Z$e(h,t,S),D=V$e(m,S);try{return await Promise.race([Promise.all([{},m3(_),Promise.all(x),w,T,hV(t,d),...A,...D]),g,W$e(t,b),...uV(t,o,f,b),...R9({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...cV({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch($){return f.terminationReason??="other",Promise.all([{error:$},_,Promise.all(x.map(ie=>GI(ie))),GI(w),vK(T,O),Promise.allSettled(A),Promise.allSettled(D)])}},Z$e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:lp(n,i,r)),V$e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>ri(o,{checkOpen:!1})&&!Qn(o)).map(({type:i,value:o,stream:s=o})=>lp(s,n,e,{isSameDirection:On.has(i),stopOnExit:i==="native"}))),W$e=async(t,{signal:e})=>{let[r]=await G$e(t,"error",{signal:e});throw r}});var $K,up,Ll,yv=y(()=>{Il();$K=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),up=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Ci();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Ll=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as kK}from"node:stream/promises";var YI,EK,XI,QI,_v,bv,eP=y(()=>{gv();YI=async t=>{if(t!==void 0)try{await XI(t)}catch{}},EK=async t=>{if(t!==void 0)try{await QI(t)}catch{}},XI=async t=>{await kK(t,{cleanup:!0,readable:!1,writable:!0})},QI=async t=>{await kK(t,{cleanup:!0,readable:!0,writable:!1})},_v=async(t,e)=>{if(await t,e)throw e},bv=(t,e,r)=>{r&&!hv(r)?t.destroy(r):e&&t.destroy()}});import{Readable as K$e}from"node:stream";import{callbackify as J$e}from"node:util";var AK,tP,rP,nP,Y$e,iP,oP,TK,sP=y(()=>{Pa();ds();mv();Il();yv();eP();AK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||on.has(r),{subprocessStdout:a,waitReadableDestroy:c}=tP(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=rP(a,s),{read:f,onStdoutDataDone:p}=nP({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new K$e({read:f,destroy:J$e(oP.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return iP({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},tP=(t,e,r)=>{let n=Pl(t,e),i=up(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},rP=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:HI},nP=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Ci(),s=pv({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){Y$e(this,s,o)},onStdoutDataDone:o}},Y$e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},iP=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await QI(t),await n,await YI(i),await e,r.readable&&r.push(null)}catch(o){await YI(i),TK(r,o)}},oP=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Ll(r,e)&&(TK(t,n),await _v(e,n))},TK=(t,e)=>{bv(t,t.readable,e)}});import{Writable as X$e}from"node:stream";import{callbackify as OK}from"node:util";var RK,aP,cP,Q$e,eke,lP,uP,IK,dP=y(()=>{ds();yv();eP();RK=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=aP(t,r,e),s=new X$e({...cP(n,t,i),destroy:OK(uP.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return lP(n,s),s},aP=(t,e,r)=>{let n=yb(t,e),i=up(r,n,"writableFinal"),o=up(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},cP=(t,e,r)=>({write:Q$e.bind(void 0,t),final:OK(eke.bind(void 0,t,e,r))}),Q$e=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},eke=async(t,e,r)=>{await Ll(r,e)&&(t.writable&&t.end(),await e)},lP=async(t,e,r)=>{try{await XI(t),e.writable&&e.end()}catch(n){await EK(r),IK(e,n)}},uP=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Ll(r,e),await Ll(n,e)&&(IK(t,i),await _v(e,i))},IK=(t,e)=>{bv(t,t.writable,e)}});import{Duplex as tke}from"node:stream";import{callbackify as rke}from"node:util";var PK,nke,CK=y(()=>{Pa();sP();dP();PK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||on.has(r),{subprocessStdout:c,waitReadableDestroy:l}=tP(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=aP(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=rP(c,a),{read:g,onStdoutDataDone:b}=nP({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new tke({read:g,...cP(u,t,d),destroy:rke(nke.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return iP({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),lP(u,_,c),_},nke=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([oP({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),uP({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var fP,ike,DK=y(()=>{Pa();ds();mv();fP=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||on.has(e),s=Pl(t,r),a=pv({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return ike(a,s,t)},ike=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var NK,jK=y(()=>{yv();sP();dP();CK();DK();NK=(t,{encoding:e})=>{let r=$K();t.readable=AK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=RK.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=PK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=fP.bind(void 0,t,e),t[Symbol.asyncIterator]=fP.bind(void 0,t,e,{})}});var MK,oke,ske,FK=y(()=>{MK=(t,e)=>{for(let[r,n]of ske){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},oke=(async()=>{})().constructor.prototype,ske=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(oke,t)])});import{setMaxListeners as ake}from"node:events";import{spawn as cke}from"node:child_process";var LK,lke,uke,dke,fke,pke,zK=y(()=>{Bb();vR();WR();ds();KR();OI();np();Zb();O3();D3();ip();H3();pb();K3();aK();JI();xK();jK();Il();FK();LK=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=lke(t,e,r),{subprocess:f,promise:p}=dke({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=fv.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),MK(f,p),Di.set(f,{options:u,fileDescriptors:d}),f},lke=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=sb(t,e,r),{file:a,commandArguments:c,options:l}=Cb(t,e,r),u=uke(l),d=C3(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},uke=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},dke=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=cke(...Db(t,e,r))}catch(m){return T3({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;ake(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];B3(c,a,l),W3(c,r,l);let d={},f=Ci();c.kill=T9.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=mK(c,r),NK(c,r),k3(c,r);let p=fke({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},fke=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await wK({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map((x,w)=>xo(x,e,w)),_=xo(h,e,"all"),S=pke({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return jl(S,n,e)},pke=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?rp({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Ni,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):Gb({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var vv,mke,hke,UK=y(()=>{yo();So();vv=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,mke(n,t[n],i)]));return{...t,...r}},mke=(t,e,r)=>hke.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,hke=new Set(["env",...hR])});var ms,gke,yke,qK=y(()=>{yo();uR();BG();_3();zK();UK();ms=(t,e,r,n)=>{let i=(s,a,c)=>ms(s,a,r,c),o=(...s)=>gke({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},gke=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Ot(o))return i(t,vv(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=yke({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?y3(a,c,l):LK(a,c,l,i)},yke=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=UG(e)?qG(e,r):[e,...r],[s,a,c]=V_(...o),l=vv(vv(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var BK,HK,GK,_ke,bke,ZK=y(()=>{BK=({file:t,commandArguments:e})=>GK(t,e),HK=({file:t,commandArguments:e})=>({...GK(t,e),isSync:!0}),GK=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=_ke(t);return{file:r,commandArguments:n}},_ke=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(bke)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},bke=/ +/g});var VK,WK,vke,KK,Ske,JK,YK=y(()=>{VK=(t,e,r)=>{t.sync=e(vke,r),t.s=t.sync},WK=({options:t})=>KK(t),vke=({options:t})=>({...KK(t),isSync:!0}),KK=t=>({options:{...Ske(t),...t}}),Ske=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},JK={preferLocal:!0}});var Blt,We,Hlt,Glt,Zlt,Vlt,Wlt,Klt,Jlt,Ylt,Mr=y(()=>{qK();ZK();HR();YK();OI();Blt=ms(()=>({})),We=ms(()=>({isSync:!0})),Hlt=ms(BK),Glt=ms(HK),Zlt=ms(fV),Vlt=ms(WK,{},JK,VK),{sendMessage:Wlt,getOneMessage:Klt,getEachMessage:Jlt,getCancelSignal:Ylt}=E3()});import{existsSync as Sv,statSync as wke}from"node:fs";import{dirname as pP,extname as xke,isAbsolute as XK,join as mP,relative as hP,resolve as wv,sep as $ke}from"node:path";function xv(t){return t==="./gradlew"||t==="gradle"}function kke(t){return(Sv(mP(t,"build.gradle.kts"))||Sv(mP(t,"build.gradle")))&&Sv(mP(t,"gradle.properties"))}function Eke(t,e){let n=hP(t,e).split($ke).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function hs(t,e){return t===":"?`:${e}`:`${t}:${e}`}function Ake(t,e){let r=wv(t,e),n=r;Sv(r)?wke(r).isFile()&&(n=pP(r)):xke(r)!==""&&(n=pP(r));let i=hP(t,n);if(i.startsWith("..")||XK(i))return null;let o=n;for(;;){if(kke(o))return o;if(wv(o)===wv(t))return null;let s=pP(o);if(s===o)return null;let a=hP(t,s);if(a.startsWith("..")||XK(a))return null;o=s}}function $v(t,e){let r=wv(t),n=new Map,i=[];for(let o of e){let s=Ake(r,o);if(!s){i.push(o);continue}let a=Eke(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var kv=y(()=>{"use strict"});import{existsSync as yP,readFileSync as Tke}from"node:fs";import{join as zl}from"node:path";function Ul(t="."){let e=zl(t,".cladding","config.yaml");if(!yP(e))return gP;try{let n=(0,QK.parse)(Tke(e,"utf8"))?.gate;if(!n)return gP;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of Oke){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return gP}}function eJ(t="."){let e=Ul(t).testReport,r=e?[e,..._P]:_P;return[...new Set(r.map(n=>zl(t,n)))]}function tJ(t="."){let e=Ul(t).testReport;if(e){let r=zl(t,e);return yP(r)?r:null}return _P.map(r=>zl(t,r)).find(r=>yP(r))??null}function rJ(t,e){let r=[],n=!1;for(let i of t){let o=Rke.exec(i);if(o){n=!0;for(let s of e)r.push(hs(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var QK,Oke,gP,_P,Rke,dp=y(()=>{"use strict";QK=St(er(),1);kv();Oke=["type","lint","test","coverage"],gP={scope:"feature"},_P=["test-report.junit.xml",zl("coverage","junit.xml"),zl(".cladding","test-report.junit.xml")];Rke=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as vP,readFileSync as nJ,readdirSync as Ike,statSync as Pke}from"node:fs";import{join as Ev}from"node:path";function xP(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=Ev(t,e);if(vP(r))try{if(iJ.test(nJ(r,"utf8")))return!0}catch{}}return!1}function oJ(t){try{return vP(t)&&iJ.test(nJ(t,"utf8"))}catch{return!1}}function sJ(t,e=0){if(e>4||!vP(t))return!1;let r;try{r=Ike(t)}catch{return!1}for(let n of r){let i=Ev(t,n),o=!1;try{o=Pke(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(sJ(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&oJ(i))return!0}return!1}function Nke(t){if(xP(t))return!0;for(let e of Cke)if(oJ(Ev(t,e)))return!0;for(let e of Dke)if(sJ(Ev(t,e)))return!0;return!1}function aJ(t="."){let e=Ul(t).coverage;return e||(Nke(t)?"kover":"jacoco")}function cJ(t="."){return SP[aJ(t)]}function lJ(t="."){return bP[aJ(t)]}var SP,bP,wP,iJ,Cke,Dke,Av=y(()=>{"use strict";dp();SP={kover:"koverXmlReport",jacoco:"jacocoTestReport"},bP={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},wP=[bP.kover,bP.jacoco],iJ=/kover/i;Cke=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],Dke=["buildSrc","build-logic"]});import{existsSync as pp,readFileSync as dJ,readdirSync as fJ}from"node:fs";import{join as gs}from"node:path";function kP(t){return pp(gs(t,"gradlew"))?"./gradlew":"gradle"}function jke(t){let e=kP(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[cJ(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function Mke(t){let e=!1;try{e=/(^|\n)\s*flutter\s*:|sdk:\s*flutter/.test(dJ(gs(t,"pubspec.yaml"),"utf8"))}catch{}let r={cmd:"dart",args:["format","--output=none","--set-exit-if-changed","."]},n={cmd:"gitleaks",args:["detect","--no-banner"]};return e?{type:{cmd:"flutter",args:["analyze"]},lint:r,test:{cmd:"flutter",args:["test"]},coverage:{cmd:"flutter",args:["test","--coverage"]},secret:n}:{type:{cmd:"dart",args:["analyze"]},lint:r,test:{cmd:"dart",args:["test"]},coverage:{cmd:"dart",args:["test","--coverage=coverage"]},secret:n}}function Lke(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function qke(t,e){for(let r of e)if(pp(gs(t,r)))return r}function Bke(t,e){try{return fJ(t).find(n=>n.endsWith(e))}catch{return}}function Zke(t){try{return JSON.parse(dJ(gs(t,"package.json"),"utf8"))}catch{return{}}}function fp(t,e){let r=t.scripts?.[e];return typeof r=="string"&&r.trim().length>0?r.trim():void 0}function uJ(t,e){return[t.dependencies,t.devDependencies,t.optionalDependencies,t.peerDependencies].some(r=>r?.[e]!==void 0)}function Vke(t,e,r){if(fp(r,"lint"))return{cmd:"npm",args:["run","--silent","lint"]};for(let n of Hke)if(n.configs.some(i=>pp(gs(t,i))))return n.gate;if(Gke.some(n=>pp(gs(t,n)))||r.eslintConfig!==void 0)return e}function Kke(t,e){return Wke.some(r=>pp(gs(t,r)))?!0:e.jest!==void 0}function Jke(t){if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?vitest(?:\s+run)?$/i.test(t))return"vitest";if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?jest$/i.test(t))return"jest"}function $P(t,e){let r={...t};return e==="lint"?delete r.lint:delete r.coverage,r}function Yke(t,e){let r=Zke(t),n=e.lint?Vke(t,e.lint,r):void 0,i=n?{...e,lint:n}:$P(e,"lint"),o=fp(r,"test"),s=o?Jke(o):void 0;return o&&!s?(i=$P(i,"coverage"),{...i,test:{cmd:"npm",args:["test"]},...fp(r,"coverage")?{coverage:{cmd:"npm",args:["run","--silent","coverage"]}}:{}}):s==="jest"||!o&&Kke(t,r)?{...i,test:{cmd:"npx",args:[...Mi,"jest"]},coverage:{cmd:"npx",args:[...Mi,"jest","--coverage"]}}:(s==="vitest"&&!fp(r,"coverage")&&!uJ(r,"@vitest/coverage-v8")&&!uJ(r,"@vitest/coverage-istanbul")?i=$P(i,"coverage"):s==="vitest"&&fp(r,"coverage")&&(i={...i,coverage:{cmd:"npm",args:["run","--silent","coverage"]}}),i)}function dt(t="."){for(let e of zke){let r;for(let o of e.manifests)if(o.startsWith(".")?r=Bke(t,o):r=qke(t,[o]),r)break;if(!r||e.requiresSource&&!Lke(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"?Yke(t,n):n;return{language:e.language,manifest:r,gates:i}}return Uke}var Mi,Fke,zke,Uke,Hke,Gke,Wke,sn=y(()=>{"use strict";Av();Mi=["--offline","--no-install"];Fke=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);zke=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:[...Mi,"tsc","--noEmit"]},lint:{cmd:"npx",args:[...Mi,"eslint","."]},test:{cmd:"npx",args:[...Mi,"vitest","run"]},coverage:{cmd:"npx",args:[...Mi,"vitest","run","--coverage"]},secret:{cmd:"npx",args:[...Mi,"secretlint","**/*"]},arch:{cmd:"npx",args:[...Mi,"madge","--circular","--extensions","ts,tsx,js,jsx","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:jke},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"swift",manifests:["Package.swift"],gates:{type:{cmd:"swift",args:["build"]},lint:{cmd:"swiftlint",args:["lint"]},test:{cmd:"swift",args:["test"]},coverage:{cmd:"swift",args:["test","--enable-code-coverage"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dart",manifests:["pubspec.yaml"],gates:Mke}],Uke={language:"unknown",manifest:"",gates:{}};Hke=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:[...Mi,"biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:[...Mi,"oxlint"]}}],Gke=["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts",".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"];Wke=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs","jest.config.json"]});import{existsSync as Xke,readFileSync as Qke}from"node:fs";import{join as eEe}from"node:path";function za(t){return t.code==="ENOENT"}function Tv(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return pJ.test(o)||pJ.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function Nt(t,e,r,n=[]){if(za(r))return{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`};let i=`${String(r.stderr??"")} -${String(r.stdout??"")}`,o=/ENOTCACHED|ENOTFOUND|EAI_AGAIN|canceled due to missing packages|could not determine executable/i.test(i),a=n.find(l=>l!=="--"&&!l.startsWith("-"))?.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=r.exitCode===127&&a!==void 0&&new RegExp(`(?:^|[\\s:])${a}: (?:command )?not found\\b`,"i").test(i);return e==="npx"&&(o||c)?{stage:t,pass:!1,exitCode:2,stderr:"setup gap: 'npx' could not resolve the configured tool without installing it; the inferred tool is not installed or unavailable offline"}:null}function Yt(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function ql(t,e){let r=eEe(t,"package.json");if(!Xke(r))return!1;try{return!!JSON.parse(Qke(r,"utf8")).scripts?.[e]}catch{return!1}}var pJ,Rn=y(()=>{"use strict";pJ=/config (is |file )?not found|no such file|ENOENT|ENOTCACHED|ENOTFOUND|EAI_AGAIN|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function tEe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.arch;if(!n)return[{detector:Ov,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=We(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Ov,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:Tv(i,Ov,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var Ov,Ua,Rv=y(()=>{"use strict";Mr();sn();Rn();Ov="ARCHITECTURE_VIOLATION";Ua={name:Ov,subprocess:!0,run:tEe}});function rEe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.secret;if(!n)return[{detector:Iv,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=We(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Iv,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:Tv(i,Iv,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var Iv,qa,Pv=y(()=>{"use strict";Mr();sn();Rn();Iv="HARDCODED_SECRET";qa={name:Iv,subprocess:!0,run:rEe}});import{existsSync as EP,readdirSync as mJ}from"node:fs";import{join as Cv}from"node:path";function iEe(t,e){let r=Cv(t,e.path);if(!EP(r))return!0;if(e.isDirectory)try{return mJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function oEe(t){let{cwd:e="."}=t,r=[];for(let i of nEe)iEe(e,i)&&r.push({detector:mp,severity:i.severity,path:i.path,message:`${i.path} is absent \u2014 cladding scaffold incomplete (${i.purpose}). Run \`clad init --intent ""\` to populate it.`});let n=Cv(e,"spec.yaml");if(EP(n)){let i=cEe(n),o=i?null:sEe(e);if(i)r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present but unreadable (${i}) \u2014 cladding is governing nothing. Fix the SSoT root, then \`clad sync\` to validate.`});else if(o)r.push({detector:mp,severity:"error",path:o.path,message:`spec shard '${o.path}' is present but unparseable (${o.reason}) \u2014 loadSpec throws on it, so every spec-gated detector silently passes. Fix it, then \`clad sync\`.`});else{let s=aEe(e);s&&r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present and parses, but the assembled spec does not load (${s}) \u2014 every spec-gated detector then degrades to non-blocking info, so the gate would pass GREEN on an unloadable SSoT. Fix it, then \`clad sync\` to validate.`})}}return r}function sEe(t){for(let e of["spec/features","spec/scenarios"]){let r=Cv(t,e);if(!EP(r))continue;let n;try{n=mJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{Oi(Cv(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function aEe(t){try{return B(t),null}catch(e){return e.message}}function cEe(t){let e;try{e=Oi(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var mp,nEe,hJ,gJ=y(()=>{"use strict";Ue();M_();mp="ABSENCE_OF_GOVERNANCE",nEe=[{path:"spec.yaml",severity:"error",purpose:"SSoT root \u2014 every spec-gated detector needs it"},{path:"spec/architecture.yaml",severity:"warn",purpose:"architecture invariants (layers + forbidden_imports)"},{path:"spec/capabilities.yaml",severity:"warn",purpose:"capability \u2194 feature traceability"},{path:"docs/project-context.md",severity:"warn",purpose:"intent narrative + decision history"},{path:"docs/conventions.md",severity:"info",purpose:"project style guide (recommended)"},{path:"spec/scenarios",severity:"info",purpose:"user-journey scenarios (recommended)",isDirectory:!0}];hJ={name:mp,run:oEe}});function Dv(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function AP(t,e){let r=e?.trim()??"";if(!t)return r.length>0?"condition is present but ears pattern is not declared":null;if(t==="ubiquitous")return r.length>0?`ears='ubiquitous' but condition is present ('${r.slice(0,40)}\u2026')`:null;if(t==="complex"){if(r.length===0)return"ears='complex' requires a 'while' precondition and a 'when' trigger \u2014 empty";let i=Dv(r)==="while",o=uEe.test(r);return i?o?null:"ears='complex' requires a 'when' trigger clause after the 'while' precondition \u2014 none found":`ears='complex' requires the condition to start with 'while' (precondition) \u2014 got '${Dv(r)}'`}let n=lEe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:Dv(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${Dv(r)}'`:null}function dEe(t,e){let r=AP(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function yJ(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...dEe(r,n));return e}var lEe,uEe,TP=y(()=>{"use strict";lEe={event:"when",state:"while",optional:"where",unwanted:"if"},uEe=/\bwhen\b/i});function ge(t,e,r){let n;try{n=B(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var wt=y(()=>{"use strict";Ue()});function fEe(t){let{cwd:e="."}=t;return ge(e,Nv,pEe)}function pEe(t){let e=[];for(let r of t.features)for(let n of r.acceptance_criteria??[]){let i=!!n.text?.trim(),o=!!(n.condition?.trim()||n.action?.trim()||n.response?.trim());!i&&!o&&e.push({detector:Nv,severity:"error",message:`${r.id}.${n.id} has neither rendered text nor any EARS field (condition/action/response) \u2014 structurally empty AC`})}for(let r of yJ(t.features))e.push({detector:Nv,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var Nv,_J,bJ=y(()=>{"use strict";TP();wt();Nv="AC_DRIFT";_J={name:Nv,run:fEe}});function Fi(t=".",e){let n=(e??"").trim().toLowerCase()||dt(t).language;return SJ[n]??vJ}var mEe,hEe,gEe,vJ,yEe,_Ee,SJ,bEe,wJ,Ba=y(()=>{"use strict";sn();mEe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,hEe=/^[ \t]*import\s+([\w.]+)/gm,gEe=/^[ \t]*(?:from|import)\s+([\w.]+)/gm,vJ={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:mEe,importStyle:"relative"},yEe={ext:"kt",extensions:[".kt",".kts"],sourceRoots:["src/main/kotlin","src/test/kotlin"],mainRoot:"src/main/kotlin",testGlobs:["src/test/kotlin/**/*Test.kt","src/test/kotlin/**/*Tests.kt"],coverageSummary:"build/reports/jacoco/test/jacocoTestReport.xml",coverageFormat:"jacoco-xml",importMatcher:hEe,importStyle:"dotted"},_Ee={ext:"py",extensions:[".py"],sourceRoots:["."],mainRoot:"src",testGlobs:["tests/test_*.py","tests/**/test_*.py","tests/**/*_test.py"],coverageSummary:"coverage.xml",coverageFormat:"cobertura-xml",importMatcher:gEe,importStyle:"dotted"},SJ={typescript:vJ,kotlin:yEe,python:_Ee},bEe=[".js",".jsx",".mts",".cts",".rs",".go",".java",".rb",".php",".cs",".fs",".ex",".exs"],wJ=new Set([...Object.values(SJ).flatMap(t=>t?.extensions??[]),...bEe].map(t=>t.toLowerCase()))});import{existsSync as vEe,readFileSync as SEe,readdirSync as wEe,statSync as xEe}from"node:fs";import{join as $J,relative as xJ}from"node:path";function $Ee(t,e){if(!vEe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=wEe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=$J(i,s),c;try{c=xEe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function kEe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function AEe(t){return EEe.test(t)}function TEe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=Fi(e,r.project?.language),o=i.sourceRoots.flatMap(a=>$Ee($J(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=SEe(a,"utf8")}catch{continue}let l=c.split(` -`);for(let u=0;u{"use strict";Ue();Ba();kJ="AI_HINTS_FORBIDDEN_PATTERN";EEe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;EJ={name:kJ,run:TEe}});function OEe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:TJ,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var TJ,OJ,RJ=y(()=>{"use strict";Ue();TJ="AC_DUPLICATE_WITHIN_FEATURE";OJ={name:TJ,run:OEe}});import{createRequire as REe}from"module";import{basename as IEe,dirname as RP,normalize as PEe,relative as CEe,resolve as DEe,sep as CJ}from"path";import*as NEe from"fs";function jEe(t){let e=PEe(t);return e.length>1&&e[e.length-1]===CJ&&(e=e.substring(0,e.length-1)),e}function DJ(t,e){return t.replace(MEe,e)}function LEe(t){return t==="/"||FEe.test(t)}function OP(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=DEe(t)),(n||o)&&(t=jEe(t)),t===".")return"";let s=t[t.length-1]!==i;return DJ(s?t+i:t,i)}function NJ(t,e){return e+t}function zEe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:DJ(CEe(t,n),e.pathSeparator)+e.pathSeparator+r}}function UEe(t){return t}function qEe(t,e,r){return e+t+r}function BEe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?zEe(t,e):n?NJ:UEe}function HEe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function GEe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function KEe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?GEe(t):HEe(t):n&&n.length?VEe:ZEe:WEe}function tAe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?eAe:r&&r.length?n?JEe:YEe:n?XEe:QEe}function iAe(t){return t.group?nAe:rAe}function aAe(t){return t.group?oAe:sAe}function uAe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?lAe:cAe}function jJ(t,e,r){if(r.options.useRealPaths)return dAe(e,r);let n=RP(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=RP(n)}return r.symlinks.set(t,e),i>1}function dAe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function jv(t,e,r,n){e(t&&!n?t:null,r)}function vAe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?fAe:gAe:n?e?pAe:bAe:i?e?hAe:_Ae:e?mAe:yAe}function xAe(t){return t?wAe:SAe}function AAe(t,e){return new Promise((r,n)=>{LJ(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function LJ(t,e,r){new FJ(t,e,r).start()}function TAe(t,e){return new FJ(t,e).start()}var IJ,MEe,FEe,ZEe,VEe,WEe,JEe,YEe,XEe,QEe,eAe,rAe,nAe,oAe,sAe,cAe,lAe,fAe,pAe,mAe,hAe,gAe,yAe,_Ae,bAe,MJ,SAe,wAe,$Ae,kAe,EAe,FJ,PJ,zJ,UJ,qJ=y(()=>{IJ=REe(import.meta.url);MEe=/[\\/]/g;FEe=/^[a-z]:[\\/]$/i;ZEe=(t,e)=>{e.push(t||".")},VEe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},WEe=()=>{};JEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},YEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},XEe=(t,e,r,n)=>{r.files++},QEe=(t,e)=>{e.push(t)},eAe=()=>{};rAe=t=>t,nAe=()=>[""].slice(0,0);oAe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},sAe=()=>{};cAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&jJ(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},lAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&jJ(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};fAe=t=>t.counts,pAe=t=>t.groups,mAe=t=>t.paths,hAe=t=>t.paths.slice(0,t.options.maxFiles),gAe=(t,e,r)=>(jv(e,r,t.counts,t.options.suppressErrors),null),yAe=(t,e,r)=>(jv(e,r,t.paths,t.options.suppressErrors),null),_Ae=(t,e,r)=>(jv(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),bAe=(t,e,r)=>(jv(e,r,t.groups,t.options.suppressErrors),null);MJ={withFileTypes:!0},SAe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",MJ,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},wAe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",MJ)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};$Ae=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},kAe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},EAe=class{aborted=!1;abort(){this.aborted=!0}},FJ=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=vAe(e,this.isSynchronous),this.root=OP(t,e),this.state={root:LEe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new kAe,options:e,queue:new $Ae((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new EAe,fs:e.fs||NEe},this.joinPath=BEe(this.root,e),this.pushDirectory=KEe(this.root,e),this.pushFile=tAe(e),this.getArray=iAe(e),this.groupFiles=aAe(e),this.resolveSymlink=uAe(e,this.isSynchronous),this.walkDirectory=xAe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(b.isDirectory()){if(_=OP(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let S=IEe(_),x=OP(RP(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};PJ=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return AAe(this.root,this.options)}withCallback(t){LJ(this.root,this.options,t)}sync(){return TAe(this.root,this.options)}},zJ=null;try{IJ.resolve("picomatch"),zJ=IJ("picomatch")}catch{}UJ=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:CJ,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new PJ(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new PJ(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||zJ;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var hp=v((edt,VJ)=>{"use strict";var BJ="[^\\\\/]",OAe="(?=.)",HJ="[^/]",IP="(?:\\/|$)",GJ="(?:^|\\/)",PP=`\\.{1,2}${IP}`,RAe="(?!\\.)",IAe=`(?!${GJ}${PP})`,PAe=`(?!\\.{0,1}${IP})`,CAe=`(?!${PP})`,DAe="[^.\\/]",NAe=`${HJ}*?`,jAe="/",ZJ={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:OAe,QMARK:HJ,END_ANCHOR:IP,DOTS_SLASH:PP,NO_DOT:RAe,NO_DOTS:IAe,NO_DOT_SLASH:PAe,NO_DOTS_SLASH:CAe,QMARK_NO_DOT:DAe,STAR:NAe,START_ANCHOR:GJ,SEP:jAe},MAe={...ZJ,SLASH_LITERAL:"[\\\\/]",QMARK:BJ,STAR:`${BJ}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},FAe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};VJ.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:FAe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?MAe:ZJ}}});var gp=v(Fr=>{"use strict";var{REGEX_BACKSLASH:LAe,REGEX_REMOVE_BACKSLASH:zAe,REGEX_SPECIAL_CHARS:UAe,REGEX_SPECIAL_CHARS_GLOBAL:qAe}=hp();Fr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Fr.hasRegexChars=t=>UAe.test(t);Fr.isRegexChar=t=>t.length===1&&Fr.hasRegexChars(t);Fr.escapeRegex=t=>t.replace(qAe,"\\$1");Fr.toPosixSlashes=t=>t.replace(LAe,"/");Fr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Fr.removeBackslashes=t=>t.replace(zAe,e=>e==="\\"?"":e);Fr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Fr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Fr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Fr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Fr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var t8=v((rdt,e8)=>{"use strict";var WJ=gp(),{CHAR_ASTERISK:CP,CHAR_AT:BAe,CHAR_BACKWARD_SLASH:yp,CHAR_COMMA:HAe,CHAR_DOT:DP,CHAR_EXCLAMATION_MARK:NP,CHAR_FORWARD_SLASH:QJ,CHAR_LEFT_CURLY_BRACE:jP,CHAR_LEFT_PARENTHESES:MP,CHAR_LEFT_SQUARE_BRACKET:GAe,CHAR_PLUS:ZAe,CHAR_QUESTION_MARK:KJ,CHAR_RIGHT_CURLY_BRACE:VAe,CHAR_RIGHT_PARENTHESES:JJ,CHAR_RIGHT_SQUARE_BRACKET:WAe}=hp(),YJ=t=>t===QJ||t===yp,XJ=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},KAe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,b=!1,_=!1,S=!1,x=!1,w=!1,O=0,T,A,D={value:"",depth:0,isGlob:!1},$=()=>l>=n,ie=()=>c.charCodeAt(l+1),K=()=>(T=A,c.charCodeAt(++l));for(;l0&&(C=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),P=c.slice(d)):m===!0?(xe="",P=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&YJ(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(P&&(P=WJ.removeBackslashes(P)),xe&&_===!0&&(xe=WJ.removeBackslashes(xe)));let Ir={prefix:C,input:t,start:u,base:xe,glob:P,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&(Ir.maxDepth=0,YJ(A)||s.push(D),Ir.tokens=s),r.parts===!0||r.tokens===!0){let se;for(let Ce=0;Ce{"use strict";var _p=hp(),an=gp(),{MAX_LENGTH:Mv,POSIX_REGEX_SOURCE:JAe,REGEX_NON_SPECIAL_CHARS:YAe,REGEX_SPECIAL_CHARS_BACKREF:XAe,REPLACEMENTS:r8}=_p,QAe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>an.escapeRegex(i)).join("..")}return r},Bl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,n8=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},eTe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},i8=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(eTe(e))return e.replace(/\\(.)/g,"$1")},tTe=t=>{let e=t.map(i8).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},rTe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=i8(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?an.escapeRegex(r[0]):`[${r.map(i=>an.escapeRegex(i)).join("")}]`}*`},nTe=t=>{let e=0,r=t.trim(),n=FP(r);for(;n;)e++,r=n.body.trim(),n=FP(r);return e},iTe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:_p.DEFAULT_MAX_EXTGLOB_RECURSION,n=n8(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||tTe(n)))return{risky:!0};for(let i of n){let o=rTe(i);if(o)return{risky:!0,safeOutput:o};if(nTe(i)>r)return{risky:!0}}return{risky:!1}},LP=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=r8[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Mv,r.maxLength):Mv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=_p.globChars(r.windows),l=_p.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:b,QMARK:_,QMARK_NO_DOT:S,STAR:x,START_ANCHOR:w}=c,O=H=>`(${a}(?:(?!${w}${H.dot?m:u}).)*?)`,T=r.dot?"":h,A=r.dot?_:S,D=r.bash===!0?O(r):x;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let $={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=an.removePrefix(t,$),i=t.length;let ie=[],K=[],xe=[],C=o,P,Ir=()=>$.index===i-1,se=$.peek=(H=1)=>t[$.index+H],Ce=$.advance=()=>t[++$.index]||"",Kt=()=>t.slice($.index+1),dr=(H="",ht=0)=>{$.consumed+=H,$.index+=ht},Xt=H=>{$.output+=H.output!=null?H.output:H.value,dr(H.value)},lo=()=>{let H=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)Ce(),$.start++,H++;return H%2===0?!1:($.negated=!0,$.start++,!0)},$i=H=>{$[H]++,xe.push(H)},Xr=H=>{$[H]--,xe.pop()},de=H=>{if(C.type==="globstar"){let ht=$.braces>0&&(H.type==="comma"||H.type==="brace"),q=H.extglob===!0||ie.length&&(H.type==="pipe"||H.type==="paren");H.type!=="slash"&&H.type!=="paren"&&!ht&&!q&&($.output=$.output.slice(0,-C.output.length),C.type="star",C.value="*",C.output=D,$.output+=C.output)}if(ie.length&&H.type!=="paren"&&(ie[ie.length-1].inner+=H.value),(H.value||H.output)&&Xt(H),C&&C.type==="text"&&H.type==="text"){C.output=(C.output||C.value)+H.value,C.value+=H.value;return}H.prev=C,s.push(H),C=H},uo=(H,ht)=>{let q={...l[ht],conditions:1,inner:""};q.prev=C,q.parens=$.parens,q.output=$.output,q.startIndex=$.index,q.tokensIndex=s.length;let Oe=(r.capture?"(":"")+q.open;$i("parens"),de({type:H,value:ht,output:$.output?"":p}),de({type:"paren",extglob:!0,value:Ce(),output:Oe}),ie.push(q)},jde=H=>{let ht=t.slice(H.startIndex,$.index+1),q=t.slice(H.startIndex+2,$.index),Oe=iTe(q,r);if((H.type==="plus"||H.type==="star")&&Oe.risky){let lt=Oe.safeOutput?(H.output?"":p)+(r.capture?`(${Oe.safeOutput})`:Oe.safeOutput):void 0,ki=s[H.tokensIndex];ki.type="text",ki.value=ht,ki.output=lt||an.escapeRegex(ht);for(let Ei=H.tokensIndex+1;Ei1&&H.inner.includes("/")&&(lt=O(r)),(lt!==D||Ir()||/^\)+$/.test(Kt()))&&(ut=H.close=`)$))${lt}`),H.inner.includes("*")&&(zt=Kt())&&/^\.[^\\/.]+$/.test(zt)){let ki=LP(zt,{...e,fastpaths:!1}).output;ut=H.close=`)${ki})${lt})`}H.prev.type==="bos"&&($.negatedExtglob=!0)}de({type:"paren",extglob:!0,value:P,output:ut}),Xr("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let H=!1,ht=t.replace(XAe,(q,Oe,ut,zt,lt,ki)=>zt==="\\"?(H=!0,q):zt==="?"?Oe?Oe+zt+(lt?_.repeat(lt.length):""):ki===0?A+(lt?_.repeat(lt.length):""):_.repeat(ut.length):zt==="."?u.repeat(ut.length):zt==="*"?Oe?Oe+zt+(lt?D:""):D:Oe?q:`\\${q}`);return H===!0&&(r.unescape===!0?ht=ht.replace(/\\/g,""):ht=ht.replace(/\\+/g,q=>q.length%2===0?"\\\\":q?"\\":"")),ht===t&&r.contains===!0?($.output=t,$):($.output=an.wrapOutput(ht,$,e),$)}for(;!Ir();){if(P=Ce(),P==="\0")continue;if(P==="\\"){let q=se();if(q==="/"&&r.bash!==!0||q==="."||q===";")continue;if(!q){P+="\\",de({type:"text",value:P});continue}let Oe=/^\\+/.exec(Kt()),ut=0;if(Oe&&Oe[0].length>2&&(ut=Oe[0].length,$.index+=ut,ut%2!==0&&(P+="\\")),r.unescape===!0?P=Ce():P+=Ce(),$.brackets===0){de({type:"text",value:P});continue}}if($.brackets>0&&(P!=="]"||C.value==="["||C.value==="[^")){if(r.posix!==!1&&P===":"){let q=C.value.slice(1);if(q.includes("[")&&(C.posix=!0,q.includes(":"))){let Oe=C.value.lastIndexOf("["),ut=C.value.slice(0,Oe),zt=C.value.slice(Oe+2),lt=JAe[zt];if(lt){C.value=ut+lt,$.backtrack=!0,Ce(),!o.output&&s.indexOf(C)===1&&(o.output=p);continue}}}(P==="["&&se()!==":"||P==="-"&&se()==="]")&&(P=`\\${P}`),P==="]"&&(C.value==="["||C.value==="[^")&&(P=`\\${P}`),r.posix===!0&&P==="!"&&C.value==="["&&(P="^"),C.value+=P,Xt({value:P});continue}if($.quotes===1&&P!=='"'){P=an.escapeRegex(P),C.value+=P,Xt({value:P});continue}if(P==='"'){$.quotes=$.quotes===1?0:1,r.keepQuotes===!0&&de({type:"text",value:P});continue}if(P==="("){$i("parens"),de({type:"paren",value:P});continue}if(P===")"){if($.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Bl("opening","("));let q=ie[ie.length-1];if(q&&$.parens===q.parens+1){jde(ie.pop());continue}de({type:"paren",value:P,output:$.parens?")":"\\)"}),Xr("parens");continue}if(P==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Bl("closing","]"));P=`\\${P}`}else $i("brackets");de({type:"bracket",value:P});continue}if(P==="]"){if(r.nobracket===!0||C&&C.type==="bracket"&&C.value.length===1){de({type:"text",value:P,output:`\\${P}`});continue}if($.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Bl("opening","["));de({type:"text",value:P,output:`\\${P}`});continue}Xr("brackets");let q=C.value.slice(1);if(C.posix!==!0&&q[0]==="^"&&!q.includes("/")&&(P=`/${P}`),C.value+=P,Xt({value:P}),r.literalBrackets===!1||an.hasRegexChars(q))continue;let Oe=an.escapeRegex(C.value);if($.output=$.output.slice(0,-C.value.length),r.literalBrackets===!0){$.output+=Oe,C.value=Oe;continue}C.value=`(${a}${Oe}|${C.value})`,$.output+=C.value;continue}if(P==="{"&&r.nobrace!==!0){$i("braces");let q={type:"brace",value:P,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};K.push(q),de(q);continue}if(P==="}"){let q=K[K.length-1];if(r.nobrace===!0||!q){de({type:"text",value:P,output:P});continue}let Oe=")";if(q.dots===!0){let ut=s.slice(),zt=[];for(let lt=ut.length-1;lt>=0&&(s.pop(),ut[lt].type!=="brace");lt--)ut[lt].type!=="dots"&&zt.unshift(ut[lt].value);Oe=QAe(zt,r),$.backtrack=!0}if(q.comma!==!0&&q.dots!==!0){let ut=$.output.slice(0,q.outputIndex),zt=$.tokens.slice(q.tokensIndex);q.value=q.output="\\{",P=Oe="\\}",$.output=ut;for(let lt of zt)$.output+=lt.output||lt.value}de({type:"brace",value:P,output:Oe}),Xr("braces"),K.pop();continue}if(P==="|"){ie.length>0&&ie[ie.length-1].conditions++,de({type:"text",value:P});continue}if(P===","){let q=P,Oe=K[K.length-1];Oe&&xe[xe.length-1]==="braces"&&(Oe.comma=!0,q="|"),de({type:"comma",value:P,output:q});continue}if(P==="/"){if(C.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",s.pop(),C=o;continue}de({type:"slash",value:P,output:f});continue}if(P==="."){if($.braces>0&&C.type==="dot"){C.value==="."&&(C.output=u);let q=K[K.length-1];C.type="dots",C.output+=P,C.value+=P,q.dots=!0;continue}if($.braces+$.parens===0&&C.type!=="bos"&&C.type!=="slash"){de({type:"text",value:P,output:u});continue}de({type:"dot",value:P,output:u});continue}if(P==="?"){if(!(C&&C.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("qmark",P);continue}if(C&&C.type==="paren"){let Oe=se(),ut=P;(C.value==="("&&!/[!=<:]/.test(Oe)||Oe==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(ut=`\\${P}`),de({type:"text",value:P,output:ut});continue}if(r.dot!==!0&&(C.type==="slash"||C.type==="bos")){de({type:"qmark",value:P,output:S});continue}de({type:"qmark",value:P,output:_});continue}if(P==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){uo("negate",P);continue}if(r.nonegate!==!0&&$.index===0){lo();continue}}if(P==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("plus",P);continue}if(C&&C.value==="("||r.regex===!1){de({type:"plus",value:P,output:d});continue}if(C&&(C.type==="bracket"||C.type==="paren"||C.type==="brace")||$.parens>0){de({type:"plus",value:P});continue}de({type:"plus",value:d});continue}if(P==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){de({type:"at",extglob:!0,value:P,output:""});continue}de({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let q=YAe.exec(Kt());q&&(P+=q[0],$.index+=q[0].length),de({type:"text",value:P});continue}if(C&&(C.type==="globstar"||C.star===!0)){C.type="star",C.star=!0,C.value+=P,C.output=D,$.backtrack=!0,$.globstar=!0,dr(P);continue}let H=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(H)){uo("star",P);continue}if(C.type==="star"){if(r.noglobstar===!0){dr(P);continue}let q=C.prev,Oe=q.prev,ut=q.type==="slash"||q.type==="bos",zt=Oe&&(Oe.type==="star"||Oe.type==="globstar");if(r.bash===!0&&(!ut||H[0]&&H[0]!=="/")){de({type:"star",value:P,output:""});continue}let lt=$.braces>0&&(q.type==="comma"||q.type==="brace"),ki=ie.length&&(q.type==="pipe"||q.type==="paren");if(!ut&&q.type!=="paren"&&!lt&&!ki){de({type:"star",value:P,output:""});continue}for(;H.slice(0,3)==="/**";){let Ei=t[$.index+4];if(Ei&&Ei!=="/")break;H=H.slice(3),dr("/**",3)}if(q.type==="bos"&&Ir()){C.type="globstar",C.value+=P,C.output=O(r),$.output=C.output,$.globstar=!0,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&!zt&&Ir()){$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=O(r)+(r.strictSlashes?")":"|$)"),C.value+=P,$.globstar=!0,$.output+=q.output+C.output,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&H[0]==="/"){let Ei=H[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=`${O(r)}${f}|${f}${Ei})`,C.value+=P,$.output+=q.output+C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}if(q.type==="bos"&&H[0]==="/"){C.type="globstar",C.value+=P,C.output=`(?:^|${f}|${O(r)}${f})`,$.output=C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-C.output.length),C.type="globstar",C.output=O(r),C.value+=P,$.output+=C.output,$.globstar=!0,dr(P);continue}let ht={type:"star",value:P,output:D};if(r.bash===!0){ht.output=".*?",(C.type==="bos"||C.type==="slash")&&(ht.output=T+ht.output),de(ht);continue}if(C&&(C.type==="bracket"||C.type==="paren")&&r.regex===!0){ht.output=P,de(ht);continue}($.index===$.start||C.type==="slash"||C.type==="dot")&&(C.type==="dot"?($.output+=g,C.output+=g):r.dot===!0?($.output+=b,C.output+=b):($.output+=T,C.output+=T),se()!=="*"&&($.output+=p,C.output+=p)),de(ht)}for(;$.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Bl("closing","]"));$.output=an.escapeLast($.output,"["),Xr("brackets")}for(;$.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Bl("closing",")"));$.output=an.escapeLast($.output,"("),Xr("parens")}for(;$.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Bl("closing","}"));$.output=an.escapeLast($.output,"{"),Xr("braces")}if(r.strictSlashes!==!0&&(C.type==="star"||C.type==="bracket")&&de({type:"maybe_slash",value:"",output:`${f}?`}),$.backtrack===!0){$.output="";for(let H of $.tokens)$.output+=H.output!=null?H.output:H.value,H.suffix&&($.output+=H.suffix)}return $};LP.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Mv,r.maxLength):Mv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=r8[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=_p.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=T=>T.noglobstar===!0?_:`(${g}(?:(?!${p}${T.dot?c:o}).)*?)`,x=T=>{switch(T){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${S(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${S(r)}${s})?${o}${a}${_}`;default:{let A=/^(.*?)\.(\w+)$/.exec(T);if(!A)return;let D=x(A[1]);return D?D+o+A[2]:void 0}}},w=an.removePrefix(t,b),O=x(w);return O&&r.strictSlashes!==!0&&(O+=`${s}?`),O};o8.exports=LP});var l8=v((idt,c8)=>{"use strict";var oTe=t8(),zP=s8(),a8=gp(),sTe=hp(),aTe=t=>t&&typeof t=="object"&&!Array.isArray(t),Rt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Rt(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=aTe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?Rt.compileRe(t,e):Rt.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Rt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Rt.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};Rt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?a8.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Rt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Rt.matchBase=(t,e,r)=>(e instanceof RegExp?e:Rt.makeRe(e,r)).test(a8.basename(t));Rt.isMatch=(t,e,r)=>Rt(e,r)(t);Rt.parse=(t,e)=>Array.isArray(t)?t.map(r=>Rt.parse(r,e)):zP(t,{...e,fastpaths:!1});Rt.scan=(t,e)=>oTe(t,e);Rt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Rt.toRegex(a,e);return n===!0&&(c.state=t),c};Rt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=zP.fastpaths(t,e)),i.output||(i=zP(t,e)),Rt.compileRe(i,e,r,n)};Rt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Rt.constants=sTe;c8.exports=Rt});var p8=v((odt,f8)=>{"use strict";var u8=l8(),cTe=gp();function d8(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:cTe.isWindows()}),u8(t,e,r)}Object.assign(d8,u8);f8.exports=d8});import{readdir as lTe,readdirSync as uTe,realpath as dTe,realpathSync as fTe,stat as pTe,statSync as mTe}from"fs";import{isAbsolute as hTe,posix as Ha,resolve as gTe}from"path";import{fileURLToPath as yTe}from"url";function vTe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&bTe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>Ha.relative(t,n)||".":n=>Ha.relative(t,`${e}/${n}`)||"."}function xTe(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=Ha.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function y8(t){var e;let r=Hl.default.scan(t,$Te);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function RTe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Hl.default.scan(t);return r.isGlob||r.negated}function bp(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function _8(t){return typeof t=="string"?[t]:t??[]}function UP(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=OTe(o);s=hTe(s.replace(PTe,""))?Ha.relative(a,s):Ha.normalize(s);let c=(i=ITe.exec(s))===null||i===void 0?void 0:i[0],l=y8(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?Ha.join(o,...d):o}return s}function CTe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(UP(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(UP(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(UP(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function DTe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=CTe(t,e,n);t.debug&&bp("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(h8,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Hl.default)(i.match,f),m=(0,Hl.default)(i.ignore,f),h=vTe(i.match,f),g=m8(r,d,o),b=o?g:m8(r,d,!0),_=(w,O)=>{let T=b(O,!0);return T!=="."&&!h(T)||m(T)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let x=new UJ({filters:[a?(w,O)=>{let T=g(w,O),A=p(T)&&!m(T);return A&&bp(`matched ${T}`),A}:(w,O)=>{let T=g(w,O);return p(T)&&!m(T)}],exclude:a?(w,O)=>{let T=_(w,O);return bp(`${T?"skipped":"crawling"} ${O}`),T}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:S,signal:t.signal}).crawl(d);return t.debug&&bp("internal properties:",{...n,root:d}),[x,r!==d&&!o&&xTe(r,d)]}function NTe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function MTe(t){let e={...jTe,...t};return e.cwd=(e.cwd instanceof URL?yTe(e.cwd):gTe(e.cwd)).replace(h8,"/"),e.ignore=_8(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||lTe,readdirSync:e.fs.readdirSync||uTe,realpath:e.fs.realpath||dTe,realpathSync:e.fs.realpathSync||fTe,stat:e.fs.stat||pTe,statSync:e.fs.statSync||mTe}),e.debug&&bp("globbing with options:",e),e}function FTe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=_Te(t)||typeof t=="string",i=_8((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=MTe(n?e:t);return i.length>0?DTe(o,i):[]}function ys(t,e){let[r,n]=FTe(t,e);return r?NTe(r.sync(),n):[]}var Hl,_Te,h8,g8,bTe,STe,wTe,$Te,kTe,ETe,ATe,TTe,OTe,ITe,PTe,jTe,vp=y(()=>{qJ();Hl=St(p8(),1),_Te=Array.isArray,h8=/\\/g,g8=process.platform==="win32",bTe=/^(\/?\.\.)+$/;STe=/^[A-Z]:\/$/i,wTe=g8?t=>STe.test(t):t=>t==="/";$Te={parts:!0};kTe=/(?t.replace(kTe,"\\$&"),TTe=t=>t.replace(ETe,"\\$&"),OTe=g8?TTe:ATe;ITe=/^(\/?\.\.)+/,PTe=/\\(?=[()[\]{}!*+?@|])/g;jTe={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as Sp,readFileSync as LTe,readdirSync as zTe,statSync as b8}from"node:fs";import{join as Ga}from"node:path";function UTe(t){let{cwd:e="."}=t,r,n;try{let c=B(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=Fi(e,n),o=[],{layers:s,forbiddenImports:a}=qP(r);return(s.size>0||a.length>0)&&!Sp(Ga(e,i.mainRoot))?[{detector:wp,severity:"info",path:`${i.mainRoot}/`,message:`architecture layers declared but ${i.mainRoot}/ not found \u2014 layer checks skipped (flat layout not yet supported)`}]:(s.size>0&&(qTe(e,i,s,o),BTe(e,i,s,o)),a.length>0&&HTe(e,i,a,o),o)}function qP(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function qTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of zTe(o)){let a=Ga(o,s);b8(a).isDirectory()&&(r.has(s)||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function BTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of r){let a=Ga(o,s);Sp(a)&&b8(a).isDirectory()||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function HTe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Ga(t,i,s.from);if(!Sp(a))continue;let c=ys([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Ga(a,l),d;try{d=LTe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];GTe(p,s.to,e.importStyle)&&n.push({detector:wp,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function GTe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var wp,v8,BP=y(()=>{"use strict";vp();Ue();Ba();wp="ARCHITECTURE_FROM_SPEC";v8={name:wp,run:UTe}});import{existsSync as ZTe,readFileSync as VTe}from"node:fs";import{join as WTe}from"node:path";function JTe(t){let{cwd:e="."}=t,r=WTe(e,"spec/capabilities.yaml");if(!ZTe(r))return[];let n;try{let u=VTe(r,"utf8"),d=S8.default.parse(u);if(!d||typeof d!="object")return[];n=d}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o,s=!1;try{let u=B(e);o=new Set(u.features.map(d=>d.id)),s=u.project.onboarding_seeded===!0}catch{return[]}let a=[],c=new Set,l=s&&o.size{"use strict";S8=St(er(),1);Ue();Fv="CAPABILITIES_FEATURE_MAPPING",KTe=8;w8={name:Fv,run:JTe}});import{existsSync as YTe,readFileSync as XTe}from"node:fs";import{join as QTe}from"node:path";function eOe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("#")||e.startsWith('"""')||e.startsWith("'''")}function tOe(t){let{cwd:e="."}=t;return ge(e,HP,r=>rOe(r,e))}function rOe(t,e){let r=Fi(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=QTe(e,o);if(!YTe(s))continue;let a=XTe(s,"utf8");eOe(a)||n.push({detector:HP,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var HP,$8,k8=y(()=>{"use strict";Ba();wt();HP="CONVENTION_DRIFT";$8={name:HP,run:tOe}});import{existsSync as GP,readFileSync as E8}from"node:fs";import{join as Lv}from"node:path";function nOe(t){return JSON.parse(t).total?.lines?.pct??0}function A8(t){let e=/]*\bline-rate="([0-9]*\.?[0-9]+)"/.exec(t);return e?Number(e[1])*100:null}function sOe(t,e){if(!xv(dt(t).gates.coverage?.cmd))return null;let r;try{r=$v(t,e)}catch(c){return[{detector:$o,severity:"error",message:c.message}]}let n=0,i=0,o=0,s=[];for(let c of r){let l=wP.find(d=>GP(Lv(c.dir,d)));if(!l){s.push(c.path);continue}let u=A8(E8(Lv(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:$o,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=T8(n,i);return a0?[{detector:$o,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function aOe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let a=sOe(e,t.focusModules);if(a)return a}let r;try{r=B(e).project?.language}catch{}let n=Fi(e,r),i=dt(e).language==="kotlin"?wP.find(a=>GP(Lv(e,a)))??lJ(e):n.coverageSummary,o=Lv(e,i);if(!GP(o))return[{detector:$o,severity:"info",message:`${i} not present \u2014 run stage_2.2 first`}];let s;try{let a=E8(o,"utf8");s=n.coverageFormat==="jacoco-xml"?iOe(a):n.coverageFormat==="cobertura-xml"?oOe(a):nOe(a)}catch(a){return[{detector:$o,severity:"warn",message:`${i} unparseable: ${a.message}`}]}return s===null?n.coverageFormat==="cobertura-xml"?[]:[{detector:$o,severity:"warn",message:`${i} contained no line-coverage counter`}]:s>=zv?[]:[{detector:$o,severity:"warn",message:`line coverage ${s.toFixed(1)}% < floor ${zv}%`}]}var $o,zv,O8,R8=y(()=>{"use strict";Ue();Av();Ba();kv();sn();$o="COVERAGE_DROP",zv=70;O8={name:$o,run:aOe}});import{existsSync as cOe}from"node:fs";import{join as lOe}from"node:path";function dOe(t){let{cwd:e="."}=t;return ge(e,Uv,r=>fOe(r,e))}function fOe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);if(!r){if(n.length===0)return[];let i=t.project.onboarding_seeded===!0&&t.features.length{"use strict";wt();Uv="DELIVERABLE_INTEGRITY",uOe=8;I8={name:Uv,run:dOe}});function pOe(t){let e=new Set((t.features??[]).map(n=>n.id)),r=[];for(let n of t.project?.smoke??[]){let i=n.feature;if(i===void 0||e.has(i))continue;let o=(n.run??[]).join(" ")||`kind:${n.kind}`;r.push({detector:qv,severity:"warn",path:"spec.yaml",message:`smoke probe '${o}' binds feature ${i}, which is not in the spec \u2014 a dangling binding is annotation drift (the bound feature was renamed, archived, or never existed). Fix the id or drop the binding.`})}return r}function mOe(t){let e=pOe(t),r=(t.features??[]).filter(o=>o.status==="done");return r.length===0||!!!t.project?.deliverable||(t.project?.smoke??[]).length>0?e:[...e,{detector:qv,severity:"warn",path:"spec.yaml",message:`${r.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function hOe(t){let{cwd:e="."}=t;return ge(e,qv,r=>mOe(r))}var qv,C8,D8=y(()=>{"use strict";wt();qv="SMOKE_PROBE_DEMAND";C8={name:qv,run:hOe}});function gOe(t){let{cwd:e="."}=t;return ge(e,Bv,r=>yOe(r,e))}function yOe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=as(e);if(n===null)return[{detector:Bv,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=B_(n,e,o);s.state!=="fresh"&&i.push({detector:Bv,severity:"warn",path:"spec/attestation.yaml",message:s.state==="unattested"?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:s.module?`${o.id}'s module ${s.module} changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var Bv,Hv,ZP=y(()=>{"use strict";bl();wt();Bv="STALE_ATTESTATION";Hv={name:Bv,run:gOe}});function _Oe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}return bOe(r)}function bOe(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:N8,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var N8,Gv,VP=y(()=>{"use strict";Ue();N8="DEPENDENCY_CYCLE";Gv={name:N8,run:_Oe}});import{appendFileSync as vOe,existsSync as j8,mkdirSync as SOe,readFileSync as wOe}from"node:fs";import{dirname as xOe,join as $Oe}from"node:path";function M8(t){return $Oe(t,kOe,EOe)}function F8(t){return WP.add(t),()=>WP.delete(t)}function Za(t,e){let r=M8(t),n=xOe(r);j8(n)||SOe(n,{recursive:!0}),vOe(r,`${JSON.stringify(e)} + if (condition) { yield value; }`)}});import{Buffer as zxe}from"node:buffer";import{StringDecoder as Uxe}from"node:string_decoder";var ev,qxe,Bxe,Hxe,yI=y(()=>{nn();ev=(t,e,r)=>{if(r)return;if(t)return{transform:qxe.bind(void 0,new TextEncoder)};let n=new Uxe(e);return{transform:Bxe.bind(void 0,n),final:Hxe.bind(void 0,n)}},qxe=function*(t,e){zxe.isBuffer(e)?yield _o(e):typeof e=="string"?yield t.encode(e):yield e},Bxe=function*(t,e){yield qt(e)?t.write(e):e},Hxe=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as JW}from"node:util";var _I,tv,YW,Gxe,XW,Zxe,QW=y(()=>{_I=JW(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),tv=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Zxe}=e[r];for await(let i of n(t))yield*tv(i,e,r+1)},YW=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Gxe(r,Number(e),t)},Gxe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*tv(n,r,e+1)},XW=JW(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Zxe=function*(t){yield t}});var bI,e3,Ma,op,Vxe,Wxe,vI=y(()=>{bI=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},e3=(t,e)=>[...e.flatMap(r=>[...Ma(r,t,0)]),...op(t)],Ma=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Wxe}=e[r];for(let i of n(t))yield*Ma(i,e,r+1)},op=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Vxe(r,Number(e),t)},Vxe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ma(n,r,e+1)},Wxe=function*(t){yield t}});import{Transform as Kxe,getDefaultHighWaterMark as t3}from"node:stream";var SI,rv,r3,nv=y(()=>{Sr();Qb();KW();yI();QW();vI();SI=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=r3(t,s,o),l=ja(e),u=ja(r),d=l?_I.bind(void 0,tv,a):bI.bind(void 0,Ma),f=l||u?_I.bind(void 0,YW,a):bI.bind(void 0,op),p=l||u?XW.bind(void 0,a):void 0;return{stream:new Kxe({writableObjectMode:n,writableHighWaterMark:t3(n),readableObjectMode:i,readableHighWaterMark:t3(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},rv=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=r3(s,r,a);t=e3(c,t)}return t},r3=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:ZW(n,a)},ev(r,s,n),Xb(r,o,n,c),{transform:t,final:e},{transform:VW(i,a)},GW({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var n3,Jxe,Yxe,Xxe,Qxe,i3=y(()=>{nv();nn();Sr();n3=(t,e)=>{for(let r of Jxe(t))Yxe(t,r,e)},Jxe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Yxe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ps[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>Xxe(a,n));r.input=Bf(s)},Xxe=(t,e)=>{let r=rv(t,e,"utf8",!0);return Qxe(r),Bf(r)},Qxe=t=>{let e=t.find(r=>typeof r!="string"&&!qt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var iv,e0e,t0e,o3,s3,r0e,a3,wI=y(()=>{Pa();Sr();El();ls();iv=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&kl(r,n)&&!on.has(e)&&e0e(n)&&(t.some(({type:i,value:o})=>i==="native"&&t0e.has(o))||t.every(({type:i})=>On.has(i))),e0e=t=>t===1||t===2,t0e=new Set(["pipe","overlapped"]),o3=async(t,e,r,n)=>{for await(let i of t)r0e(e)||a3(i,r,n)},s3=(t,e,r)=>{for(let n of t)a3(n,e,r)},r0e=t=>t._readableState.pipes.length>0,a3=(t,e,r)=>{let n=nb(t);Pi({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as n0e,appendFileSync as i0e}from"node:fs";var c3,o0e,s0e,a0e,c0e,l0e,l3=y(()=>{wI();nv();Qb();nn();Sr();Na();c3=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>o0e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},o0e=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=VV(t,o,d),p=_o(f),{stdioItems:m,objectMode:h}=e[r],g=s0e([p],m,c,n),{serializedResult:b,finalResult:_=b}=a0e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});c0e({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&l0e(b,m,i),S}catch(x){return n.error=x,S}},s0e=(t,e,r,n)=>{try{return rv(t,e,r,!1)}catch(i){return n.error=i,t}},a0e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Bf(t)};let s=MG(t,r);return n[o]?{serializedResult:s,finalResult:gI(s,!i[o],e)}:{serializedResult:s}},c0e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!iv({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=gI(t,!1,s);try{s3(a,e,n)}catch(c){r.error??=c}},l0e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>Kb.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?i0e(n,t):(r.add(o),n0e(n,t))}}});var u3,d3=y(()=>{nn();ip();u3=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,xo(e,r,"all")]:Array.isArray(e)?[xo(t,r,"all"),...e]:qt(t)&&qt(e)?dR([t,e]):`${t}${e}`}});import{once as xI}from"node:events";var f3,u0e,p3,m3,d0e,$I,kI=y(()=>{Ra();f3=async(t,e)=>{let[r,n]=await u0e(t);return e.isForcefullyTerminated??=!1,[r,n]},u0e=async t=>{let[e,r]=await Promise.allSettled([xI(t,"spawn"),xI(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?p3(t):r.value},p3=async t=>{try{return await xI(t,"exit")}catch{return p3(t)}},m3=async t=>{let[e,r]=await t;if(!d0e(e,r)&&$I(e,r))throw new ei;return[e,r]},d0e=(t,e)=>t===void 0&&e===void 0,$I=(t,e)=>t!==0||e!==null});var h3,f0e,g3=y(()=>{Ra();Na();kI();h3=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=f0e(t,e,r),s=o?.code==="ETIMEDOUT",a=ZV(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},f0e=(t,e,r)=>t!==void 0?t:$I(e,r)?new ei:void 0});import{spawnSync as p0e}from"node:child_process";var y3,m0e,h0e,g0e,ov,y0e,_0e,b0e,v0e,_3=y(()=>{vR();WR();KR();np();Zb();qW();ip();i3();l3();Na();d3();g3();y3=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=m0e(t,e,r),d=y0e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Ml(d,c,l)},m0e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=sb(t,e,r),a=h0e(r),{file:c,commandArguments:l,options:u}=Cb(t,e,a);g0e(u);let d=zW(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},h0e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,g0e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&ov("ipcInput"),t&&ov("ipc: true"),r&&ov("detached: true"),n&&ov("cancelSignal")},ov=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},y0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=_0e({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=h3(c,r),{output:m,error:h=l}=c3({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>xo(_,r,S)),b=xo(u3(m,r),r,"all");return v0e({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},_0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{n3(o,r);let a=b0e(r);return p0e(...Db(t,e,a))}catch(a){return jl({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},b0e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Hb(e)}),v0e=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?Gb({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):rp({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as EI,on as S0e}from"node:events";var b3,w0e,x0e,$0e,k0e,v3=y(()=>{Il();Yf();Jf();b3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(Ol({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Eb(t)}),w0e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),w0e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{bb(e,i);let o=fs(t,e,r),s=new AbortController;try{return await Promise.race([x0e(o,n,s),$0e(o,r,s),k0e(o,r,s)])}catch(a){throw Rl(t),a}finally{s.abort(),vb(e,i)}},x0e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await EI(t,"message",{signal:r});return n}for await(let[n]of S0e(t,"message",{signal:r}))if(e(n))return n},$0e=async(t,e,{signal:r})=>{await EI(t,"disconnect",{signal:r}),I9(e)},k0e=async(t,e,{signal:r})=>{let[n]=await EI(t,"strict:error",{signal:r});throw hb(n,e)}});import{once as w3,on as E0e}from"node:events";var x3,AI,A0e,T0e,O0e,S3,TI=y(()=>{Il();Yf();Jf();x3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>AI({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),AI=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{Ol({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Eb(t)}),bb(e,o);let s=fs(t,e,r),a=new AbortController,c={};return A0e(t,s,a),T0e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),O0e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},A0e=async(t,e,r)=>{try{await w3(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},T0e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await w3(t,"strict:error",{signal:r.signal});n.error=hb(i,e),r.abort()}catch{}},O0e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of E0e(r,"message",{signal:o.signal}))S3(s),yield c}catch{S3(s)}finally{o.abort(),vb(e,a),n||Rl(t),i&&await t}},S3=({error:t})=>{if(t)throw t}});import $3 from"node:process";var k3,E3,A3,OI=y(()=>{Ib();v3();TI();$b();k3=(t,{ipc:e})=>{Object.assign(t,A3(t,!1,e))},E3=()=>{let t=$3,e=!0,r=$3.channel!==void 0;return{...A3(t,e,r),getCancelSignal:oV.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},A3=(t,e,r)=>({sendMessage:Rb.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:b3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:x3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as R0e}from"node:child_process";import{PassThrough as I0e,Readable as P0e,Writable as C0e,Duplex as D0e}from"node:stream";var T3,N0e,sp,j0e,M0e,F0e,L0e,O3=y(()=>{Yb();np();Zb();T3=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{pI(n);let a=new R0e;N0e(a,n),Object.assign(a,{readable:j0e,writable:M0e,duplex:F0e});let c=jl({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=L0e(c,s,i);return{subprocess:a,promise:l}},N0e=(t,e)=>{let r=sp(),n=sp(),i=sp(),o=Array.from({length:e.length-3},sp),s=sp(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},sp=()=>{let t=new I0e;return t.end(),t},j0e=()=>new P0e({read(){}}),M0e=()=>new C0e({write(){}}),F0e=()=>new D0e({read(){},write(){}}),L0e=async(t,e,r)=>Ml(t,e,r)});import{createReadStream as R3,createWriteStream as I3}from"node:fs";import{Buffer as z0e}from"node:buffer";import{Readable as ap,Writable as U0e,Duplex as q0e}from"node:stream";var C3,cp,P3,B0e,D3=y(()=>{nv();Yb();Sr();C3=(t,e)=>Jb(B0e,t,e,!1),cp=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ps[t]}.`)},P3={fileNumber:cp,generator:SI,asyncGenerator:SI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:q0e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},B0e={input:{...P3,fileUrl:({value:t})=>({stream:R3(t)}),filePath:({value:{file:t}})=>({stream:R3(t)}),webStream:({value:t})=>({stream:ap.fromWeb(t)}),iterable:({value:t})=>({stream:ap.from(t)}),asyncIterable:({value:t})=>({stream:ap.from(t)}),string:({value:t})=>({stream:ap.from(t)}),uint8Array:({value:t})=>({stream:ap.from(z0e.from(t))})},output:{...P3,fileUrl:({value:t})=>({stream:I3(t)}),filePath:({value:{file:t,append:e}})=>({stream:I3(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:U0e.fromWeb(t)}),iterable:cp,asyncIterable:cp,string:cp,uint8Array:cp}}});import{on as H0e,once as N3}from"node:events";import{PassThrough as G0e,getDefaultHighWaterMark as Z0e}from"node:stream";import{finished as F3}from"node:stream/promises";function Fa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)II(i);let e=t.some(({readableObjectMode:i})=>i),r=V0e(t,e),n=new RI({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var V0e,RI,W0e,K0e,J0e,II,Y0e,X0e,Q0e,e$e,t$e,L3,z3,PI,U3,r$e,sv,j3,M3,av=y(()=>{V0e=(t,e)=>{if(t.length===0)return Z0e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},RI=class extends G0e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(II(e),this.#t.has(e))return;this.#t.add(e),this.#n??=W0e(this,this.#t,this.#o);let r=Y0e({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(II(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},W0e=async(t,e,r)=>{sv(t,j3);let n=new AbortController;try{await Promise.race([K0e(t,n),J0e(t,e,r,n)])}finally{n.abort(),sv(t,-j3)}},K0e=async(t,{signal:e})=>{try{await F3(t,{signal:e,cleanup:!0})}catch(r){throw L3(t,r),r}},J0e=async(t,e,r,{signal:n})=>{for await(let[i]of H0e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},II=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Y0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{sv(t,M3);let a=new AbortController;try{await Promise.race([X0e(o,e,a),Q0e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),e$e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),sv(t,-M3)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?PI(t):t$e(t))},X0e=async(t,e,{signal:r})=>{try{await t,r.aborted||PI(e)}catch(n){r.aborted||L3(e,n)}},Q0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await F3(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;z3(s)?i.add(e):U3(t,s)}},e$e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await N3(t,i,{signal:o}),!t.readable)return N3(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},t$e=t=>{t.writable&&t.end()},L3=(t,e)=>{z3(e)?PI(t):U3(t,e)},z3=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",PI=t=>{(t.readable||t.writable)&&t.destroy()},U3=(t,e)=>{t.destroyed||(t.once("error",r$e),t.destroy(e))},r$e=()=>{},sv=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},j3=2,M3=1});import{finished as q3}from"node:stream/promises";var Ll,n$e,CI,i$e,DI,cv=y(()=>{bo();Ll=(t,e)=>{t.pipe(e),n$e(t,e),i$e(t,e)},n$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await q3(t,{cleanup:!0,readable:!0,writable:!1})}catch{}CI(e)}},CI=t=>{t.writable&&t.end()},i$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await q3(e,{cleanup:!0,readable:!1,writable:!0})}catch{}DI(t)}},DI=t=>{t.readable&&t.destroy()}});var B3,o$e,s$e,a$e,c$e,l$e,H3=y(()=>{av();bo();_b();Sr();cv();B3=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>On.has(c)))o$e(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!On.has(c)))a$e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Fa(o);Ll(s,i)}},o$e=(t,e,r,n)=>{r==="output"?Ll(t.stdio[n],e):Ll(e,t.stdio[n]);let i=s$e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},s$e=["stdin","stdout","stderr"],a$e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;c$e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},c$e=(t,{signal:e})=>{Qn(t)&&Ia(t,l$e,e)},l$e=2});var La,G3=y(()=>{La=[];La.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&La.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&La.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var lv,NI,jI,u$e,MI,uv,d$e,FI,LI,zI,Z3,Qst,eat,V3=y(()=>{G3();lv=t=>!!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",NI=Symbol.for("signal-exit emitter"),jI=globalThis,u$e=Object.defineProperty.bind(Object),MI=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(jI[NI])return jI[NI];u$e(jI,NI,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},uv=class{},d$e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),FI=class extends uv{onExit(){return()=>{}}load(){}unload(){}},LI=class extends uv{#t=zI.platform==="win32"?"SIGINT":"SIGHUP";#r=new MI;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of La)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!lv(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of La)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,La.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return lv(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&lv(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},zI=globalThis.process,{onExit:Z3,load:Qst,unload:eat}=d$e(lv(zI)?new LI(zI):new FI)});import{addAbortListener as f$e}from"node:events";var W3,K3=y(()=>{V3();W3=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=Z3(()=>{t.kill()});f$e(n,()=>{i()})}});var Y3,p$e,m$e,J3,h$e,X3=y(()=>{uR();ob();ds();xl();Y3=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=ib(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=p$e(r,n,i),{sourceStream:d,sourceError:f}=h$e(t,l),{options:p,fileDescriptors:m}=Di.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},p$e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=m$e(t,e,...r),a=yb(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},m$e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(J3,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||cR(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=V_(r,...n);return{destination:e(J3)(i,o,s),pipeOptions:s}}if(Di.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},J3=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),h$e=(t,e)=>{try{return{sourceStream:Cl(t,e)}}catch(r){return{sourceError:r}}}});var eK,g$e,UI,Q3,qI=y(()=>{np();cv();eK=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=g$e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw UI({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},g$e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return DI(t),n;if(e!==void 0)return CI(r),e},UI=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>jl({error:t,command:Q3,escapedCommand:Q3,fileDescriptors:e,options:r,startTime:n,isSync:!1}),Q3="source.pipe(destination)"});var tK,rK=y(()=>{tK=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as y$e}from"node:stream/promises";var nK,_$e,b$e,v$e,dv,S$e,w$e,iK=y(()=>{av();_b();cv();nK=(t,e,r)=>{let n=dv.has(e)?b$e(t,e):_$e(t,e);return Ia(t,S$e,r.signal),Ia(e,w$e,r.signal),v$e(e),n},_$e=(t,e)=>{let r=Fa([t]);return Ll(r,e),dv.set(e,r),r},b$e=(t,e)=>{let r=dv.get(e);return r.add(t),r},v$e=async t=>{try{await y$e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}dv.delete(t)},dv=new WeakMap,S$e=2,w$e=1});import{aborted as x$e}from"node:util";var oK,$$e,sK=y(()=>{qI();oK=(t,e)=>t===void 0?[]:[$$e(t,e)],$$e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await x$e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw UI({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var fv,k$e,E$e,aK=y(()=>{yo();X3();qI();rK();iK();sK();fv=(t,...e)=>{if(Ot(e[0]))return fv.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Y3(t,...e),i=k$e({...n,destination:r});return i.pipe=fv.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},k$e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=E$e(t,i);eK({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=nK(e,o,d);return await Promise.race([tK(u),...oK(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},E$e=(t,e)=>Promise.allSettled([t,e])});import{on as A$e}from"node:events";import{getDefaultHighWaterMark as T$e}from"node:stream";var pv,O$e,BI,R$e,lK,HI,cK,I$e,P$e,mv=y(()=>{yI();Qb();vI();pv=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return O$e(e,s),lK({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},O$e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},BI=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;R$e(e,s,t);let a=t.readableObjectMode&&!o;return lK({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},R$e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},lK=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=A$e(t,"data",{signal:e.signal,highWaterMark:cK,highWatermark:cK});return I$e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},HI=T$e(!0),cK=HI,I$e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=P$e({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ma(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*op(a)}},P$e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[ev(t,r,!e),Xb(t,i,!n,{})].filter(Boolean)});import{setImmediate as C$e}from"node:timers/promises";var uK,D$e,N$e,j$e,GI,dK,ZI=y(()=>{Bb();nn();wI();mv();Na();ip();uK=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=D$e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([N$e(t),d]);return}let f=mI(c,r),p=BI({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([j$e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},D$e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!iv({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=BI({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await o3(a,t,r,o)},N$e=async t=>{await C$e(),t.readableFlowing===null&&t.resume()},j$e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await Lb(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await zb(r,{maxBuffer:o})):await qb(r,{maxBuffer:o})}catch(a){return dK(BV({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},GI=async t=>{try{return await t}catch(e){return dK(e)}},dK=({bufferedData:t})=>NG(t)?new Uint8Array(t):t});import{finished as M$e}from"node:stream/promises";var lp,F$e,L$e,z$e,U$e,q$e,VI,hv,fK,gv=y(()=>{lp=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=F$e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],M$e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||U$e(a,e,r,n)}finally{s.abort()}},F$e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&L$e(t,r,n),n},L$e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{z$e(e,r),n.call(t,...i)}},z$e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},U$e=(t,e,r,n)=>{if(!q$e(t,e,r,n))throw t},q$e=(t,e,r,n=!0)=>r.propagating?fK(t)||hv(t):(r.propagating=!0,VI(r,e)===n?fK(t):hv(t)),VI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",hv=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",fK=t=>t?.code==="EPIPE"});var pK,WI,KI=y(()=>{ZI();gv();pK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>WI({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),WI=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=lp(t,e,l);if(VI(l,e)){await u;return}let[d]=await Promise.all([uK({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var mK,hK,B$e,H$e,JI=y(()=>{av();KI();mK=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Fa([t,e].filter(Boolean)):void 0,hK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>WI({...B$e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:H$e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),B$e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},H$e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var gK,yK,_K=y(()=>{El();ls();gK=t=>kl(t,"ipc"),yK=(t,e)=>{let r=nb(t);Pi({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var bK,vK,SK=y(()=>{Na();_K();So();TI();bK=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=gK(o),a=vo(e,"ipc"),c=vo(r,"ipc");for await(let l of AI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(HV(t,i,c),i.push(l)),s&&yK(l,o);return i},vK=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as G$e}from"node:events";var wK,Z$e,V$e,W$e,xK=y(()=>{Da();BR();DR();qR();bo();Sr();ZI();SK();GR();JI();KI();kI();gv();wK=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:b})=>{let _=f3(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=pK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=hK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),O=[],T=bK({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),A=Z$e(h,t,S),D=V$e(m,S);try{return await Promise.race([Promise.all([{},m3(_),Promise.all(x),w,T,hV(t,d),...A,...D]),g,W$e(t,b),...uV(t,o,f,b),...R9({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...cV({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch($){return f.terminationReason??="other",Promise.all([{error:$},_,Promise.all(x.map(ie=>GI(ie))),GI(w),vK(T,O),Promise.allSettled(A),Promise.allSettled(D)])}},Z$e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:lp(n,i,r)),V$e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>ri(o,{checkOpen:!1})&&!Qn(o)).map(({type:i,value:o,stream:s=o})=>lp(s,n,e,{isSameDirection:On.has(i),stopOnExit:i==="native"}))),W$e=async(t,{signal:e})=>{let[r]=await G$e(t,"error",{signal:e});throw r}});var $K,up,zl,yv=y(()=>{Pl();$K=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),up=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Ci();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},zl=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as kK}from"node:stream/promises";var YI,EK,XI,QI,_v,bv,eP=y(()=>{gv();YI=async t=>{if(t!==void 0)try{await XI(t)}catch{}},EK=async t=>{if(t!==void 0)try{await QI(t)}catch{}},XI=async t=>{await kK(t,{cleanup:!0,readable:!1,writable:!0})},QI=async t=>{await kK(t,{cleanup:!0,readable:!0,writable:!1})},_v=async(t,e)=>{if(await t,e)throw e},bv=(t,e,r)=>{r&&!hv(r)?t.destroy(r):e&&t.destroy()}});import{Readable as K$e}from"node:stream";import{callbackify as J$e}from"node:util";var AK,tP,rP,nP,Y$e,iP,oP,TK,sP=y(()=>{Pa();ds();mv();Pl();yv();eP();AK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||on.has(r),{subprocessStdout:a,waitReadableDestroy:c}=tP(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=rP(a,s),{read:f,onStdoutDataDone:p}=nP({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new K$e({read:f,destroy:J$e(oP.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return iP({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},tP=(t,e,r)=>{let n=Cl(t,e),i=up(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},rP=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:HI},nP=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Ci(),s=pv({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){Y$e(this,s,o)},onStdoutDataDone:o}},Y$e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},iP=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await QI(t),await n,await YI(i),await e,r.readable&&r.push(null)}catch(o){await YI(i),TK(r,o)}},oP=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await zl(r,e)&&(TK(t,n),await _v(e,n))},TK=(t,e)=>{bv(t,t.readable,e)}});import{Writable as X$e}from"node:stream";import{callbackify as OK}from"node:util";var RK,aP,cP,Q$e,eke,lP,uP,IK,dP=y(()=>{ds();yv();eP();RK=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=aP(t,r,e),s=new X$e({...cP(n,t,i),destroy:OK(uP.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return lP(n,s),s},aP=(t,e,r)=>{let n=yb(t,e),i=up(r,n,"writableFinal"),o=up(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},cP=(t,e,r)=>({write:Q$e.bind(void 0,t),final:OK(eke.bind(void 0,t,e,r))}),Q$e=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},eke=async(t,e,r)=>{await zl(r,e)&&(t.writable&&t.end(),await e)},lP=async(t,e,r)=>{try{await XI(t),e.writable&&e.end()}catch(n){await EK(r),IK(e,n)}},uP=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await zl(r,e),await zl(n,e)&&(IK(t,i),await _v(e,i))},IK=(t,e)=>{bv(t,t.writable,e)}});import{Duplex as tke}from"node:stream";import{callbackify as rke}from"node:util";var PK,nke,CK=y(()=>{Pa();sP();dP();PK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||on.has(r),{subprocessStdout:c,waitReadableDestroy:l}=tP(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=aP(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=rP(c,a),{read:g,onStdoutDataDone:b}=nP({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new tke({read:g,...cP(u,t,d),destroy:rke(nke.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return iP({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),lP(u,_,c),_},nke=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([oP({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),uP({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var fP,ike,DK=y(()=>{Pa();ds();mv();fP=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||on.has(e),s=Cl(t,r),a=pv({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return ike(a,s,t)},ike=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var NK,jK=y(()=>{yv();sP();dP();CK();DK();NK=(t,{encoding:e})=>{let r=$K();t.readable=AK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=RK.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=PK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=fP.bind(void 0,t,e),t[Symbol.asyncIterator]=fP.bind(void 0,t,e,{})}});var MK,oke,ske,FK=y(()=>{MK=(t,e)=>{for(let[r,n]of ske){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},oke=(async()=>{})().constructor.prototype,ske=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(oke,t)])});import{setMaxListeners as ake}from"node:events";import{spawn as cke}from"node:child_process";var LK,lke,uke,dke,fke,pke,zK=y(()=>{Bb();vR();WR();ds();KR();OI();np();Zb();O3();D3();ip();H3();pb();K3();aK();JI();xK();jK();Pl();FK();LK=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=lke(t,e,r),{subprocess:f,promise:p}=dke({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=fv.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),MK(f,p),Di.set(f,{options:u,fileDescriptors:d}),f},lke=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=sb(t,e,r),{file:a,commandArguments:c,options:l}=Cb(t,e,r),u=uke(l),d=C3(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},uke=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},dke=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=cke(...Db(t,e,r))}catch(m){return T3({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;ake(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];B3(c,a,l),W3(c,r,l);let d={},f=Ci();c.kill=T9.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=mK(c,r),NK(c,r),k3(c,r);let p=fke({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},fke=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await wK({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map((x,w)=>xo(x,e,w)),_=xo(h,e,"all"),S=pke({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Ml(S,n,e)},pke=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?rp({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Ni,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):Gb({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var vv,mke,hke,UK=y(()=>{yo();So();vv=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,mke(n,t[n],i)]));return{...t,...r}},mke=(t,e,r)=>hke.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,hke=new Set(["env",...hR])});var ms,gke,yke,qK=y(()=>{yo();uR();BG();_3();zK();UK();ms=(t,e,r,n)=>{let i=(s,a,c)=>ms(s,a,r,c),o=(...s)=>gke({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},gke=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Ot(o))return i(t,vv(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=yke({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?y3(a,c,l):LK(a,c,l,i)},yke=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=UG(e)?qG(e,r):[e,...r],[s,a,c]=V_(...o),l=vv(vv(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var BK,HK,GK,_ke,bke,ZK=y(()=>{BK=({file:t,commandArguments:e})=>GK(t,e),HK=({file:t,commandArguments:e})=>({...GK(t,e),isSync:!0}),GK=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=_ke(t);return{file:r,commandArguments:n}},_ke=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(bke)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},bke=/ +/g});var VK,WK,vke,KK,Ske,JK,YK=y(()=>{VK=(t,e,r)=>{t.sync=e(vke,r),t.s=t.sync},WK=({options:t})=>KK(t),vke=({options:t})=>({...KK(t),isSync:!0}),KK=t=>({options:{...Ske(t),...t}}),Ske=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},JK={preferLocal:!0}});var Blt,We,Hlt,Glt,Zlt,Vlt,Wlt,Klt,Jlt,Ylt,Mr=y(()=>{qK();ZK();HR();YK();OI();Blt=ms(()=>({})),We=ms(()=>({isSync:!0})),Hlt=ms(BK),Glt=ms(HK),Zlt=ms(fV),Vlt=ms(WK,{},JK,VK),{sendMessage:Wlt,getOneMessage:Klt,getEachMessage:Jlt,getCancelSignal:Ylt}=E3()});import{existsSync as Sv,statSync as wke}from"node:fs";import{dirname as pP,extname as xke,isAbsolute as XK,join as mP,relative as hP,resolve as wv,sep as $ke}from"node:path";function xv(t){return t==="./gradlew"||t==="gradle"}function kke(t){return(Sv(mP(t,"build.gradle.kts"))||Sv(mP(t,"build.gradle")))&&Sv(mP(t,"gradle.properties"))}function Eke(t,e){let n=hP(t,e).split($ke).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function hs(t,e){return t===":"?`:${e}`:`${t}:${e}`}function Ake(t,e){let r=wv(t,e),n=r;Sv(r)?wke(r).isFile()&&(n=pP(r)):xke(r)!==""&&(n=pP(r));let i=hP(t,n);if(i.startsWith("..")||XK(i))return null;let o=n;for(;;){if(kke(o))return o;if(wv(o)===wv(t))return null;let s=pP(o);if(s===o)return null;let a=hP(t,s);if(a.startsWith("..")||XK(a))return null;o=s}}function $v(t,e){let r=wv(t),n=new Map,i=[];for(let o of e){let s=Ake(r,o);if(!s){i.push(o);continue}let a=Eke(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var kv=y(()=>{"use strict"});import{existsSync as yP,readFileSync as Tke}from"node:fs";import{join as Ul}from"node:path";function ql(t="."){let e=Ul(t,".cladding","config.yaml");if(!yP(e))return gP;try{let n=(0,QK.parse)(Tke(e,"utf8"))?.gate;if(!n)return gP;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of Oke){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return gP}}function eJ(t="."){let e=ql(t).testReport,r=e?[e,..._P]:_P;return[...new Set(r.map(n=>Ul(t,n)))]}function tJ(t="."){let e=ql(t).testReport;if(e){let r=Ul(t,e);return yP(r)?r:null}return _P.map(r=>Ul(t,r)).find(r=>yP(r))??null}function rJ(t,e){let r=[],n=!1;for(let i of t){let o=Rke.exec(i);if(o){n=!0;for(let s of e)r.push(hs(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var QK,Oke,gP,_P,Rke,dp=y(()=>{"use strict";QK=St(er(),1);kv();Oke=["type","lint","test","coverage"],gP={scope:"feature"},_P=["test-report.junit.xml",Ul("coverage","junit.xml"),Ul(".cladding","test-report.junit.xml")];Rke=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as vP,readFileSync as nJ,readdirSync as Ike,statSync as Pke}from"node:fs";import{join as Ev}from"node:path";function xP(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=Ev(t,e);if(vP(r))try{if(iJ.test(nJ(r,"utf8")))return!0}catch{}}return!1}function oJ(t){try{return vP(t)&&iJ.test(nJ(t,"utf8"))}catch{return!1}}function sJ(t,e=0){if(e>4||!vP(t))return!1;let r;try{r=Ike(t)}catch{return!1}for(let n of r){let i=Ev(t,n),o=!1;try{o=Pke(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(sJ(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&oJ(i))return!0}return!1}function Nke(t){if(xP(t))return!0;for(let e of Cke)if(oJ(Ev(t,e)))return!0;for(let e of Dke)if(sJ(Ev(t,e)))return!0;return!1}function aJ(t="."){let e=ql(t).coverage;return e||(Nke(t)?"kover":"jacoco")}function cJ(t="."){return SP[aJ(t)]}function lJ(t="."){return bP[aJ(t)]}var SP,bP,wP,iJ,Cke,Dke,Av=y(()=>{"use strict";dp();SP={kover:"koverXmlReport",jacoco:"jacocoTestReport"},bP={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},wP=[bP.kover,bP.jacoco],iJ=/kover/i;Cke=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],Dke=["buildSrc","build-logic"]});import{existsSync as pp,readFileSync as dJ,readdirSync as fJ}from"node:fs";import{join as gs}from"node:path";function kP(t){return pp(gs(t,"gradlew"))?"./gradlew":"gradle"}function jke(t){let e=kP(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[cJ(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function Mke(t){let e=!1;try{e=/(^|\n)\s*flutter\s*:|sdk:\s*flutter/.test(dJ(gs(t,"pubspec.yaml"),"utf8"))}catch{}let r={cmd:"dart",args:["format","--output=none","--set-exit-if-changed","."]},n={cmd:"gitleaks",args:["detect","--no-banner"]};return e?{type:{cmd:"flutter",args:["analyze"]},lint:r,test:{cmd:"flutter",args:["test"]},coverage:{cmd:"flutter",args:["test","--coverage"]},secret:n}:{type:{cmd:"dart",args:["analyze"]},lint:r,test:{cmd:"dart",args:["test"]},coverage:{cmd:"dart",args:["test","--coverage=coverage"]},secret:n}}function Lke(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function qke(t,e){for(let r of e)if(pp(gs(t,r)))return r}function Bke(t,e){try{return fJ(t).find(n=>n.endsWith(e))}catch{return}}function Zke(t){try{return JSON.parse(dJ(gs(t,"package.json"),"utf8"))}catch{return{}}}function fp(t,e){let r=t.scripts?.[e];return typeof r=="string"&&r.trim().length>0?r.trim():void 0}function uJ(t,e){return[t.dependencies,t.devDependencies,t.optionalDependencies,t.peerDependencies].some(r=>r?.[e]!==void 0)}function Vke(t,e,r){if(fp(r,"lint"))return{cmd:"npm",args:["run","--silent","lint"]};for(let n of Hke)if(n.configs.some(i=>pp(gs(t,i))))return n.gate;if(Gke.some(n=>pp(gs(t,n)))||r.eslintConfig!==void 0)return e}function Kke(t,e){return Wke.some(r=>pp(gs(t,r)))?!0:e.jest!==void 0}function Jke(t){if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?vitest(?:\s+run)?$/i.test(t))return"vitest";if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?jest$/i.test(t))return"jest"}function $P(t,e){let r={...t};return e==="lint"?delete r.lint:delete r.coverage,r}function Yke(t,e){let r=Zke(t),n=e.lint?Vke(t,e.lint,r):void 0,i=n?{...e,lint:n}:$P(e,"lint"),o=fp(r,"test"),s=o?Jke(o):void 0;return o&&!s?(i=$P(i,"coverage"),{...i,test:{cmd:"npm",args:["test"]},...fp(r,"coverage")?{coverage:{cmd:"npm",args:["run","--silent","coverage"]}}:{}}):s==="jest"||!o&&Kke(t,r)?{...i,test:{cmd:"npx",args:[...Mi,"jest"]},coverage:{cmd:"npx",args:[...Mi,"jest","--coverage"]}}:(s==="vitest"&&!fp(r,"coverage")&&!uJ(r,"@vitest/coverage-v8")&&!uJ(r,"@vitest/coverage-istanbul")?i=$P(i,"coverage"):s==="vitest"&&fp(r,"coverage")&&(i={...i,coverage:{cmd:"npm",args:["run","--silent","coverage"]}}),i)}function dt(t="."){for(let e of zke){let r;for(let o of e.manifests)if(o.startsWith(".")?r=Bke(t,o):r=qke(t,[o]),r)break;if(!r||e.requiresSource&&!Lke(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"?Yke(t,n):n;return{language:e.language,manifest:r,gates:i}}return Uke}var Mi,Fke,zke,Uke,Hke,Gke,Wke,sn=y(()=>{"use strict";Av();Mi=["--offline","--no-install"];Fke=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);zke=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:[...Mi,"tsc","--noEmit"]},lint:{cmd:"npx",args:[...Mi,"eslint","."]},test:{cmd:"npx",args:[...Mi,"vitest","run"]},coverage:{cmd:"npx",args:[...Mi,"vitest","run","--coverage"]},secret:{cmd:"npx",args:[...Mi,"secretlint","**/*"]},arch:{cmd:"npx",args:[...Mi,"madge","--circular","--extensions","ts,tsx,js,jsx","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:jke},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"swift",manifests:["Package.swift"],gates:{type:{cmd:"swift",args:["build"]},lint:{cmd:"swiftlint",args:["lint"]},test:{cmd:"swift",args:["test"]},coverage:{cmd:"swift",args:["test","--enable-code-coverage"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dart",manifests:["pubspec.yaml"],gates:Mke}],Uke={language:"unknown",manifest:"",gates:{}};Hke=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:[...Mi,"biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:[...Mi,"oxlint"]}}],Gke=["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts",".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"];Wke=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs","jest.config.json"]});import{existsSync as Xke,readFileSync as Qke}from"node:fs";import{join as eEe}from"node:path";function za(t){return t.code==="ENOENT"}function Tv(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return pJ.test(o)||pJ.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function Nt(t,e,r,n=[]){if(za(r))return{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`};let i=`${String(r.stderr??"")} +${String(r.stdout??"")}`,o=/ENOTCACHED|ENOTFOUND|EAI_AGAIN|canceled due to missing packages|could not determine executable/i.test(i),a=n.find(l=>l!=="--"&&!l.startsWith("-"))?.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=r.exitCode===127&&a!==void 0&&new RegExp(`(?:^|[\\s:])${a}: (?:command )?not found\\b`,"i").test(i);return e==="npx"&&(o||c)?{stage:t,pass:!1,exitCode:2,stderr:"setup gap: 'npx' could not resolve the configured tool without installing it; the inferred tool is not installed or unavailable offline"}:null}function Yt(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Bl(t,e){let r=eEe(t,"package.json");if(!Xke(r))return!1;try{return!!JSON.parse(Qke(r,"utf8")).scripts?.[e]}catch{return!1}}var pJ,Rn=y(()=>{"use strict";pJ=/config (is |file )?not found|no such file|ENOENT|ENOTCACHED|ENOTFOUND|EAI_AGAIN|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function tEe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.arch;if(!n)return[{detector:Ov,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=We(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Ov,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:Tv(i,Ov,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var Ov,Ua,Rv=y(()=>{"use strict";Mr();sn();Rn();Ov="ARCHITECTURE_VIOLATION";Ua={name:Ov,subprocess:!0,run:tEe}});function rEe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.secret;if(!n)return[{detector:Iv,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=We(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Iv,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:Tv(i,Iv,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var Iv,qa,Pv=y(()=>{"use strict";Mr();sn();Rn();Iv="HARDCODED_SECRET";qa={name:Iv,subprocess:!0,run:rEe}});import{existsSync as EP,readdirSync as mJ}from"node:fs";import{join as Cv}from"node:path";function iEe(t,e){let r=Cv(t,e.path);if(!EP(r))return!0;if(e.isDirectory)try{return mJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function oEe(t){let{cwd:e="."}=t,r=[];for(let i of nEe)iEe(e,i)&&r.push({detector:mp,severity:i.severity,path:i.path,message:`${i.path} is absent \u2014 cladding scaffold incomplete (${i.purpose}). Run \`clad init --intent ""\` to populate it.`});let n=Cv(e,"spec.yaml");if(EP(n)){let i=cEe(n),o=i?null:sEe(e);if(i)r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present but unreadable (${i}) \u2014 cladding is governing nothing. Fix the SSoT root, then \`clad sync\` to validate.`});else if(o)r.push({detector:mp,severity:"error",path:o.path,message:`spec shard '${o.path}' is present but unparseable (${o.reason}) \u2014 loadSpec throws on it, so every spec-gated detector silently passes. Fix it, then \`clad sync\`.`});else{let s=aEe(e);s&&r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present and parses, but the assembled spec does not load (${s}) \u2014 every spec-gated detector then degrades to non-blocking info, so the gate would pass GREEN on an unloadable SSoT. Fix it, then \`clad sync\` to validate.`})}}return r}function sEe(t){for(let e of["spec/features","spec/scenarios"]){let r=Cv(t,e);if(!EP(r))continue;let n;try{n=mJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{Oi(Cv(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function aEe(t){try{return B(t),null}catch(e){return e.message}}function cEe(t){let e;try{e=Oi(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var mp,nEe,hJ,gJ=y(()=>{"use strict";Ue();M_();mp="ABSENCE_OF_GOVERNANCE",nEe=[{path:"spec.yaml",severity:"error",purpose:"SSoT root \u2014 every spec-gated detector needs it"},{path:"spec/architecture.yaml",severity:"warn",purpose:"architecture invariants (layers + forbidden_imports)"},{path:"spec/capabilities.yaml",severity:"warn",purpose:"capability \u2194 feature traceability"},{path:"docs/project-context.md",severity:"warn",purpose:"intent narrative + decision history"},{path:"docs/conventions.md",severity:"info",purpose:"project style guide (recommended)"},{path:"spec/scenarios",severity:"info",purpose:"user-journey scenarios (recommended)",isDirectory:!0}];hJ={name:mp,run:oEe}});function Dv(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function AP(t,e){let r=e?.trim()??"";if(!t)return r.length>0?"condition is present but ears pattern is not declared":null;if(t==="ubiquitous")return r.length>0?`ears='ubiquitous' but condition is present ('${r.slice(0,40)}\u2026')`:null;if(t==="complex"){if(r.length===0)return"ears='complex' requires a 'while' precondition and a 'when' trigger \u2014 empty";let i=Dv(r)==="while",o=uEe.test(r);return i?o?null:"ears='complex' requires a 'when' trigger clause after the 'while' precondition \u2014 none found":`ears='complex' requires the condition to start with 'while' (precondition) \u2014 got '${Dv(r)}'`}let n=lEe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:Dv(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${Dv(r)}'`:null}function dEe(t,e){let r=AP(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function yJ(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...dEe(r,n));return e}var lEe,uEe,TP=y(()=>{"use strict";lEe={event:"when",state:"while",optional:"where",unwanted:"if"},uEe=/\bwhen\b/i});function ge(t,e,r){let n;try{n=B(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var wt=y(()=>{"use strict";Ue()});function fEe(t){let{cwd:e="."}=t;return ge(e,Nv,pEe)}function pEe(t){let e=[];for(let r of t.features)for(let n of r.acceptance_criteria??[]){let i=!!n.text?.trim(),o=!!(n.condition?.trim()||n.action?.trim()||n.response?.trim());!i&&!o&&e.push({detector:Nv,severity:"error",message:`${r.id}.${n.id} has neither rendered text nor any EARS field (condition/action/response) \u2014 structurally empty AC`})}for(let r of yJ(t.features))e.push({detector:Nv,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var Nv,_J,bJ=y(()=>{"use strict";TP();wt();Nv="AC_DRIFT";_J={name:Nv,run:fEe}});function Fi(t=".",e){let n=(e??"").trim().toLowerCase()||dt(t).language;return SJ[n]??vJ}var mEe,hEe,gEe,vJ,yEe,_Ee,SJ,bEe,wJ,Ba=y(()=>{"use strict";sn();mEe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,hEe=/^[ \t]*import\s+([\w.]+)/gm,gEe=/^[ \t]*(?:from|import)\s+([\w.]+)/gm,vJ={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:mEe,importStyle:"relative"},yEe={ext:"kt",extensions:[".kt",".kts"],sourceRoots:["src/main/kotlin","src/test/kotlin"],mainRoot:"src/main/kotlin",testGlobs:["src/test/kotlin/**/*Test.kt","src/test/kotlin/**/*Tests.kt"],coverageSummary:"build/reports/jacoco/test/jacocoTestReport.xml",coverageFormat:"jacoco-xml",importMatcher:hEe,importStyle:"dotted"},_Ee={ext:"py",extensions:[".py"],sourceRoots:["."],mainRoot:"src",testGlobs:["tests/test_*.py","tests/**/test_*.py","tests/**/*_test.py"],coverageSummary:"coverage.xml",coverageFormat:"cobertura-xml",importMatcher:gEe,importStyle:"dotted"},SJ={typescript:vJ,kotlin:yEe,python:_Ee},bEe=[".js",".jsx",".mts",".cts",".rs",".go",".java",".rb",".php",".cs",".fs",".ex",".exs"],wJ=new Set([...Object.values(SJ).flatMap(t=>t?.extensions??[]),...bEe].map(t=>t.toLowerCase()))});import{existsSync as vEe,readFileSync as SEe,readdirSync as wEe,statSync as xEe}from"node:fs";import{join as $J,relative as xJ}from"node:path";function $Ee(t,e){if(!vEe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=wEe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=$J(i,s),c;try{c=xEe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function kEe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function AEe(t){return EEe.test(t)}function TEe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=Fi(e,r.project?.language),o=i.sourceRoots.flatMap(a=>$Ee($J(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=SEe(a,"utf8")}catch{continue}let l=c.split(` +`);for(let u=0;u{"use strict";Ue();Ba();kJ="AI_HINTS_FORBIDDEN_PATTERN";EEe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;EJ={name:kJ,run:TEe}});function OEe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:TJ,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var TJ,OJ,RJ=y(()=>{"use strict";Ue();TJ="AC_DUPLICATE_WITHIN_FEATURE";OJ={name:TJ,run:OEe}});import{createRequire as REe}from"module";import{basename as IEe,dirname as RP,normalize as PEe,relative as CEe,resolve as DEe,sep as CJ}from"path";import*as NEe from"fs";function jEe(t){let e=PEe(t);return e.length>1&&e[e.length-1]===CJ&&(e=e.substring(0,e.length-1)),e}function DJ(t,e){return t.replace(MEe,e)}function LEe(t){return t==="/"||FEe.test(t)}function OP(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=DEe(t)),(n||o)&&(t=jEe(t)),t===".")return"";let s=t[t.length-1]!==i;return DJ(s?t+i:t,i)}function NJ(t,e){return e+t}function zEe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:DJ(CEe(t,n),e.pathSeparator)+e.pathSeparator+r}}function UEe(t){return t}function qEe(t,e,r){return e+t+r}function BEe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?zEe(t,e):n?NJ:UEe}function HEe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function GEe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function KEe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?GEe(t):HEe(t):n&&n.length?VEe:ZEe:WEe}function tAe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?eAe:r&&r.length?n?JEe:YEe:n?XEe:QEe}function iAe(t){return t.group?nAe:rAe}function aAe(t){return t.group?oAe:sAe}function uAe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?lAe:cAe}function jJ(t,e,r){if(r.options.useRealPaths)return dAe(e,r);let n=RP(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=RP(n)}return r.symlinks.set(t,e),i>1}function dAe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function jv(t,e,r,n){e(t&&!n?t:null,r)}function vAe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?fAe:gAe:n?e?pAe:bAe:i?e?hAe:_Ae:e?mAe:yAe}function xAe(t){return t?wAe:SAe}function AAe(t,e){return new Promise((r,n)=>{LJ(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function LJ(t,e,r){new FJ(t,e,r).start()}function TAe(t,e){return new FJ(t,e).start()}var IJ,MEe,FEe,ZEe,VEe,WEe,JEe,YEe,XEe,QEe,eAe,rAe,nAe,oAe,sAe,cAe,lAe,fAe,pAe,mAe,hAe,gAe,yAe,_Ae,bAe,MJ,SAe,wAe,$Ae,kAe,EAe,FJ,PJ,zJ,UJ,qJ=y(()=>{IJ=REe(import.meta.url);MEe=/[\\/]/g;FEe=/^[a-z]:[\\/]$/i;ZEe=(t,e)=>{e.push(t||".")},VEe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},WEe=()=>{};JEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},YEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},XEe=(t,e,r,n)=>{r.files++},QEe=(t,e)=>{e.push(t)},eAe=()=>{};rAe=t=>t,nAe=()=>[""].slice(0,0);oAe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},sAe=()=>{};cAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&jJ(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},lAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&jJ(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};fAe=t=>t.counts,pAe=t=>t.groups,mAe=t=>t.paths,hAe=t=>t.paths.slice(0,t.options.maxFiles),gAe=(t,e,r)=>(jv(e,r,t.counts,t.options.suppressErrors),null),yAe=(t,e,r)=>(jv(e,r,t.paths,t.options.suppressErrors),null),_Ae=(t,e,r)=>(jv(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),bAe=(t,e,r)=>(jv(e,r,t.groups,t.options.suppressErrors),null);MJ={withFileTypes:!0},SAe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",MJ,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},wAe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",MJ)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};$Ae=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},kAe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},EAe=class{aborted=!1;abort(){this.aborted=!0}},FJ=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=vAe(e,this.isSynchronous),this.root=OP(t,e),this.state={root:LEe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new kAe,options:e,queue:new $Ae((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new EAe,fs:e.fs||NEe},this.joinPath=BEe(this.root,e),this.pushDirectory=KEe(this.root,e),this.pushFile=tAe(e),this.getArray=iAe(e),this.groupFiles=aAe(e),this.resolveSymlink=uAe(e,this.isSynchronous),this.walkDirectory=xAe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(b.isDirectory()){if(_=OP(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let S=IEe(_),x=OP(RP(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};PJ=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return AAe(this.root,this.options)}withCallback(t){LJ(this.root,this.options,t)}sync(){return TAe(this.root,this.options)}},zJ=null;try{IJ.resolve("picomatch"),zJ=IJ("picomatch")}catch{}UJ=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:CJ,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new PJ(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new PJ(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||zJ;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var hp=v((edt,VJ)=>{"use strict";var BJ="[^\\\\/]",OAe="(?=.)",HJ="[^/]",IP="(?:\\/|$)",GJ="(?:^|\\/)",PP=`\\.{1,2}${IP}`,RAe="(?!\\.)",IAe=`(?!${GJ}${PP})`,PAe=`(?!\\.{0,1}${IP})`,CAe=`(?!${PP})`,DAe="[^.\\/]",NAe=`${HJ}*?`,jAe="/",ZJ={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:OAe,QMARK:HJ,END_ANCHOR:IP,DOTS_SLASH:PP,NO_DOT:RAe,NO_DOTS:IAe,NO_DOT_SLASH:PAe,NO_DOTS_SLASH:CAe,QMARK_NO_DOT:DAe,STAR:NAe,START_ANCHOR:GJ,SEP:jAe},MAe={...ZJ,SLASH_LITERAL:"[\\\\/]",QMARK:BJ,STAR:`${BJ}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},FAe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};VJ.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:FAe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?MAe:ZJ}}});var gp=v(Fr=>{"use strict";var{REGEX_BACKSLASH:LAe,REGEX_REMOVE_BACKSLASH:zAe,REGEX_SPECIAL_CHARS:UAe,REGEX_SPECIAL_CHARS_GLOBAL:qAe}=hp();Fr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Fr.hasRegexChars=t=>UAe.test(t);Fr.isRegexChar=t=>t.length===1&&Fr.hasRegexChars(t);Fr.escapeRegex=t=>t.replace(qAe,"\\$1");Fr.toPosixSlashes=t=>t.replace(LAe,"/");Fr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Fr.removeBackslashes=t=>t.replace(zAe,e=>e==="\\"?"":e);Fr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Fr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Fr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Fr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Fr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var t8=v((rdt,e8)=>{"use strict";var WJ=gp(),{CHAR_ASTERISK:CP,CHAR_AT:BAe,CHAR_BACKWARD_SLASH:yp,CHAR_COMMA:HAe,CHAR_DOT:DP,CHAR_EXCLAMATION_MARK:NP,CHAR_FORWARD_SLASH:QJ,CHAR_LEFT_CURLY_BRACE:jP,CHAR_LEFT_PARENTHESES:MP,CHAR_LEFT_SQUARE_BRACKET:GAe,CHAR_PLUS:ZAe,CHAR_QUESTION_MARK:KJ,CHAR_RIGHT_CURLY_BRACE:VAe,CHAR_RIGHT_PARENTHESES:JJ,CHAR_RIGHT_SQUARE_BRACKET:WAe}=hp(),YJ=t=>t===QJ||t===yp,XJ=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},KAe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,b=!1,_=!1,S=!1,x=!1,w=!1,O=0,T,A,D={value:"",depth:0,isGlob:!1},$=()=>l>=n,ie=()=>c.charCodeAt(l+1),K=()=>(T=A,c.charCodeAt(++l));for(;l0&&(C=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),P=c.slice(d)):m===!0?(xe="",P=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&YJ(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(P&&(P=WJ.removeBackslashes(P)),xe&&_===!0&&(xe=WJ.removeBackslashes(xe)));let Ir={prefix:C,input:t,start:u,base:xe,glob:P,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&(Ir.maxDepth=0,YJ(A)||s.push(D),Ir.tokens=s),r.parts===!0||r.tokens===!0){let se;for(let Ce=0;Ce{"use strict";var _p=hp(),an=gp(),{MAX_LENGTH:Mv,POSIX_REGEX_SOURCE:JAe,REGEX_NON_SPECIAL_CHARS:YAe,REGEX_SPECIAL_CHARS_BACKREF:XAe,REPLACEMENTS:r8}=_p,QAe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>an.escapeRegex(i)).join("..")}return r},Hl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,n8=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},eTe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},i8=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(eTe(e))return e.replace(/\\(.)/g,"$1")},tTe=t=>{let e=t.map(i8).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},rTe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=i8(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?an.escapeRegex(r[0]):`[${r.map(i=>an.escapeRegex(i)).join("")}]`}*`},nTe=t=>{let e=0,r=t.trim(),n=FP(r);for(;n;)e++,r=n.body.trim(),n=FP(r);return e},iTe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:_p.DEFAULT_MAX_EXTGLOB_RECURSION,n=n8(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||tTe(n)))return{risky:!0};for(let i of n){let o=rTe(i);if(o)return{risky:!0,safeOutput:o};if(nTe(i)>r)return{risky:!0}}return{risky:!1}},LP=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=r8[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Mv,r.maxLength):Mv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=_p.globChars(r.windows),l=_p.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:b,QMARK:_,QMARK_NO_DOT:S,STAR:x,START_ANCHOR:w}=c,O=H=>`(${a}(?:(?!${w}${H.dot?m:u}).)*?)`,T=r.dot?"":h,A=r.dot?_:S,D=r.bash===!0?O(r):x;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let $={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=an.removePrefix(t,$),i=t.length;let ie=[],K=[],xe=[],C=o,P,Ir=()=>$.index===i-1,se=$.peek=(H=1)=>t[$.index+H],Ce=$.advance=()=>t[++$.index]||"",Kt=()=>t.slice($.index+1),dr=(H="",ht=0)=>{$.consumed+=H,$.index+=ht},Xt=H=>{$.output+=H.output!=null?H.output:H.value,dr(H.value)},lo=()=>{let H=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)Ce(),$.start++,H++;return H%2===0?!1:($.negated=!0,$.start++,!0)},$i=H=>{$[H]++,xe.push(H)},Xr=H=>{$[H]--,xe.pop()},de=H=>{if(C.type==="globstar"){let ht=$.braces>0&&(H.type==="comma"||H.type==="brace"),q=H.extglob===!0||ie.length&&(H.type==="pipe"||H.type==="paren");H.type!=="slash"&&H.type!=="paren"&&!ht&&!q&&($.output=$.output.slice(0,-C.output.length),C.type="star",C.value="*",C.output=D,$.output+=C.output)}if(ie.length&&H.type!=="paren"&&(ie[ie.length-1].inner+=H.value),(H.value||H.output)&&Xt(H),C&&C.type==="text"&&H.type==="text"){C.output=(C.output||C.value)+H.value,C.value+=H.value;return}H.prev=C,s.push(H),C=H},uo=(H,ht)=>{let q={...l[ht],conditions:1,inner:""};q.prev=C,q.parens=$.parens,q.output=$.output,q.startIndex=$.index,q.tokensIndex=s.length;let Oe=(r.capture?"(":"")+q.open;$i("parens"),de({type:H,value:ht,output:$.output?"":p}),de({type:"paren",extglob:!0,value:Ce(),output:Oe}),ie.push(q)},jde=H=>{let ht=t.slice(H.startIndex,$.index+1),q=t.slice(H.startIndex+2,$.index),Oe=iTe(q,r);if((H.type==="plus"||H.type==="star")&&Oe.risky){let lt=Oe.safeOutput?(H.output?"":p)+(r.capture?`(${Oe.safeOutput})`:Oe.safeOutput):void 0,ki=s[H.tokensIndex];ki.type="text",ki.value=ht,ki.output=lt||an.escapeRegex(ht);for(let Ei=H.tokensIndex+1;Ei1&&H.inner.includes("/")&&(lt=O(r)),(lt!==D||Ir()||/^\)+$/.test(Kt()))&&(ut=H.close=`)$))${lt}`),H.inner.includes("*")&&(zt=Kt())&&/^\.[^\\/.]+$/.test(zt)){let ki=LP(zt,{...e,fastpaths:!1}).output;ut=H.close=`)${ki})${lt})`}H.prev.type==="bos"&&($.negatedExtglob=!0)}de({type:"paren",extglob:!0,value:P,output:ut}),Xr("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let H=!1,ht=t.replace(XAe,(q,Oe,ut,zt,lt,ki)=>zt==="\\"?(H=!0,q):zt==="?"?Oe?Oe+zt+(lt?_.repeat(lt.length):""):ki===0?A+(lt?_.repeat(lt.length):""):_.repeat(ut.length):zt==="."?u.repeat(ut.length):zt==="*"?Oe?Oe+zt+(lt?D:""):D:Oe?q:`\\${q}`);return H===!0&&(r.unescape===!0?ht=ht.replace(/\\/g,""):ht=ht.replace(/\\+/g,q=>q.length%2===0?"\\\\":q?"\\":"")),ht===t&&r.contains===!0?($.output=t,$):($.output=an.wrapOutput(ht,$,e),$)}for(;!Ir();){if(P=Ce(),P==="\0")continue;if(P==="\\"){let q=se();if(q==="/"&&r.bash!==!0||q==="."||q===";")continue;if(!q){P+="\\",de({type:"text",value:P});continue}let Oe=/^\\+/.exec(Kt()),ut=0;if(Oe&&Oe[0].length>2&&(ut=Oe[0].length,$.index+=ut,ut%2!==0&&(P+="\\")),r.unescape===!0?P=Ce():P+=Ce(),$.brackets===0){de({type:"text",value:P});continue}}if($.brackets>0&&(P!=="]"||C.value==="["||C.value==="[^")){if(r.posix!==!1&&P===":"){let q=C.value.slice(1);if(q.includes("[")&&(C.posix=!0,q.includes(":"))){let Oe=C.value.lastIndexOf("["),ut=C.value.slice(0,Oe),zt=C.value.slice(Oe+2),lt=JAe[zt];if(lt){C.value=ut+lt,$.backtrack=!0,Ce(),!o.output&&s.indexOf(C)===1&&(o.output=p);continue}}}(P==="["&&se()!==":"||P==="-"&&se()==="]")&&(P=`\\${P}`),P==="]"&&(C.value==="["||C.value==="[^")&&(P=`\\${P}`),r.posix===!0&&P==="!"&&C.value==="["&&(P="^"),C.value+=P,Xt({value:P});continue}if($.quotes===1&&P!=='"'){P=an.escapeRegex(P),C.value+=P,Xt({value:P});continue}if(P==='"'){$.quotes=$.quotes===1?0:1,r.keepQuotes===!0&&de({type:"text",value:P});continue}if(P==="("){$i("parens"),de({type:"paren",value:P});continue}if(P===")"){if($.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Hl("opening","("));let q=ie[ie.length-1];if(q&&$.parens===q.parens+1){jde(ie.pop());continue}de({type:"paren",value:P,output:$.parens?")":"\\)"}),Xr("parens");continue}if(P==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Hl("closing","]"));P=`\\${P}`}else $i("brackets");de({type:"bracket",value:P});continue}if(P==="]"){if(r.nobracket===!0||C&&C.type==="bracket"&&C.value.length===1){de({type:"text",value:P,output:`\\${P}`});continue}if($.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Hl("opening","["));de({type:"text",value:P,output:`\\${P}`});continue}Xr("brackets");let q=C.value.slice(1);if(C.posix!==!0&&q[0]==="^"&&!q.includes("/")&&(P=`/${P}`),C.value+=P,Xt({value:P}),r.literalBrackets===!1||an.hasRegexChars(q))continue;let Oe=an.escapeRegex(C.value);if($.output=$.output.slice(0,-C.value.length),r.literalBrackets===!0){$.output+=Oe,C.value=Oe;continue}C.value=`(${a}${Oe}|${C.value})`,$.output+=C.value;continue}if(P==="{"&&r.nobrace!==!0){$i("braces");let q={type:"brace",value:P,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};K.push(q),de(q);continue}if(P==="}"){let q=K[K.length-1];if(r.nobrace===!0||!q){de({type:"text",value:P,output:P});continue}let Oe=")";if(q.dots===!0){let ut=s.slice(),zt=[];for(let lt=ut.length-1;lt>=0&&(s.pop(),ut[lt].type!=="brace");lt--)ut[lt].type!=="dots"&&zt.unshift(ut[lt].value);Oe=QAe(zt,r),$.backtrack=!0}if(q.comma!==!0&&q.dots!==!0){let ut=$.output.slice(0,q.outputIndex),zt=$.tokens.slice(q.tokensIndex);q.value=q.output="\\{",P=Oe="\\}",$.output=ut;for(let lt of zt)$.output+=lt.output||lt.value}de({type:"brace",value:P,output:Oe}),Xr("braces"),K.pop();continue}if(P==="|"){ie.length>0&&ie[ie.length-1].conditions++,de({type:"text",value:P});continue}if(P===","){let q=P,Oe=K[K.length-1];Oe&&xe[xe.length-1]==="braces"&&(Oe.comma=!0,q="|"),de({type:"comma",value:P,output:q});continue}if(P==="/"){if(C.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",s.pop(),C=o;continue}de({type:"slash",value:P,output:f});continue}if(P==="."){if($.braces>0&&C.type==="dot"){C.value==="."&&(C.output=u);let q=K[K.length-1];C.type="dots",C.output+=P,C.value+=P,q.dots=!0;continue}if($.braces+$.parens===0&&C.type!=="bos"&&C.type!=="slash"){de({type:"text",value:P,output:u});continue}de({type:"dot",value:P,output:u});continue}if(P==="?"){if(!(C&&C.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("qmark",P);continue}if(C&&C.type==="paren"){let Oe=se(),ut=P;(C.value==="("&&!/[!=<:]/.test(Oe)||Oe==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(ut=`\\${P}`),de({type:"text",value:P,output:ut});continue}if(r.dot!==!0&&(C.type==="slash"||C.type==="bos")){de({type:"qmark",value:P,output:S});continue}de({type:"qmark",value:P,output:_});continue}if(P==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){uo("negate",P);continue}if(r.nonegate!==!0&&$.index===0){lo();continue}}if(P==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("plus",P);continue}if(C&&C.value==="("||r.regex===!1){de({type:"plus",value:P,output:d});continue}if(C&&(C.type==="bracket"||C.type==="paren"||C.type==="brace")||$.parens>0){de({type:"plus",value:P});continue}de({type:"plus",value:d});continue}if(P==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){de({type:"at",extglob:!0,value:P,output:""});continue}de({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let q=YAe.exec(Kt());q&&(P+=q[0],$.index+=q[0].length),de({type:"text",value:P});continue}if(C&&(C.type==="globstar"||C.star===!0)){C.type="star",C.star=!0,C.value+=P,C.output=D,$.backtrack=!0,$.globstar=!0,dr(P);continue}let H=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(H)){uo("star",P);continue}if(C.type==="star"){if(r.noglobstar===!0){dr(P);continue}let q=C.prev,Oe=q.prev,ut=q.type==="slash"||q.type==="bos",zt=Oe&&(Oe.type==="star"||Oe.type==="globstar");if(r.bash===!0&&(!ut||H[0]&&H[0]!=="/")){de({type:"star",value:P,output:""});continue}let lt=$.braces>0&&(q.type==="comma"||q.type==="brace"),ki=ie.length&&(q.type==="pipe"||q.type==="paren");if(!ut&&q.type!=="paren"&&!lt&&!ki){de({type:"star",value:P,output:""});continue}for(;H.slice(0,3)==="/**";){let Ei=t[$.index+4];if(Ei&&Ei!=="/")break;H=H.slice(3),dr("/**",3)}if(q.type==="bos"&&Ir()){C.type="globstar",C.value+=P,C.output=O(r),$.output=C.output,$.globstar=!0,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&!zt&&Ir()){$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=O(r)+(r.strictSlashes?")":"|$)"),C.value+=P,$.globstar=!0,$.output+=q.output+C.output,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&H[0]==="/"){let Ei=H[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=`${O(r)}${f}|${f}${Ei})`,C.value+=P,$.output+=q.output+C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}if(q.type==="bos"&&H[0]==="/"){C.type="globstar",C.value+=P,C.output=`(?:^|${f}|${O(r)}${f})`,$.output=C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-C.output.length),C.type="globstar",C.output=O(r),C.value+=P,$.output+=C.output,$.globstar=!0,dr(P);continue}let ht={type:"star",value:P,output:D};if(r.bash===!0){ht.output=".*?",(C.type==="bos"||C.type==="slash")&&(ht.output=T+ht.output),de(ht);continue}if(C&&(C.type==="bracket"||C.type==="paren")&&r.regex===!0){ht.output=P,de(ht);continue}($.index===$.start||C.type==="slash"||C.type==="dot")&&(C.type==="dot"?($.output+=g,C.output+=g):r.dot===!0?($.output+=b,C.output+=b):($.output+=T,C.output+=T),se()!=="*"&&($.output+=p,C.output+=p)),de(ht)}for(;$.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing","]"));$.output=an.escapeLast($.output,"["),Xr("brackets")}for(;$.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing",")"));$.output=an.escapeLast($.output,"("),Xr("parens")}for(;$.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing","}"));$.output=an.escapeLast($.output,"{"),Xr("braces")}if(r.strictSlashes!==!0&&(C.type==="star"||C.type==="bracket")&&de({type:"maybe_slash",value:"",output:`${f}?`}),$.backtrack===!0){$.output="";for(let H of $.tokens)$.output+=H.output!=null?H.output:H.value,H.suffix&&($.output+=H.suffix)}return $};LP.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Mv,r.maxLength):Mv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=r8[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=_p.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=T=>T.noglobstar===!0?_:`(${g}(?:(?!${p}${T.dot?c:o}).)*?)`,x=T=>{switch(T){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${S(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${S(r)}${s})?${o}${a}${_}`;default:{let A=/^(.*?)\.(\w+)$/.exec(T);if(!A)return;let D=x(A[1]);return D?D+o+A[2]:void 0}}},w=an.removePrefix(t,b),O=x(w);return O&&r.strictSlashes!==!0&&(O+=`${s}?`),O};o8.exports=LP});var l8=v((idt,c8)=>{"use strict";var oTe=t8(),zP=s8(),a8=gp(),sTe=hp(),aTe=t=>t&&typeof t=="object"&&!Array.isArray(t),Rt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Rt(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=aTe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?Rt.compileRe(t,e):Rt.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Rt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Rt.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};Rt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?a8.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Rt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Rt.matchBase=(t,e,r)=>(e instanceof RegExp?e:Rt.makeRe(e,r)).test(a8.basename(t));Rt.isMatch=(t,e,r)=>Rt(e,r)(t);Rt.parse=(t,e)=>Array.isArray(t)?t.map(r=>Rt.parse(r,e)):zP(t,{...e,fastpaths:!1});Rt.scan=(t,e)=>oTe(t,e);Rt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Rt.toRegex(a,e);return n===!0&&(c.state=t),c};Rt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=zP.fastpaths(t,e)),i.output||(i=zP(t,e)),Rt.compileRe(i,e,r,n)};Rt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Rt.constants=sTe;c8.exports=Rt});var p8=v((odt,f8)=>{"use strict";var u8=l8(),cTe=gp();function d8(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:cTe.isWindows()}),u8(t,e,r)}Object.assign(d8,u8);f8.exports=d8});import{readdir as lTe,readdirSync as uTe,realpath as dTe,realpathSync as fTe,stat as pTe,statSync as mTe}from"fs";import{isAbsolute as hTe,posix as Ha,resolve as gTe}from"path";import{fileURLToPath as yTe}from"url";function vTe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&bTe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>Ha.relative(t,n)||".":n=>Ha.relative(t,`${e}/${n}`)||"."}function xTe(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=Ha.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function y8(t){var e;let r=Gl.default.scan(t,$Te);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function RTe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Gl.default.scan(t);return r.isGlob||r.negated}function bp(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function _8(t){return typeof t=="string"?[t]:t??[]}function UP(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=OTe(o);s=hTe(s.replace(PTe,""))?Ha.relative(a,s):Ha.normalize(s);let c=(i=ITe.exec(s))===null||i===void 0?void 0:i[0],l=y8(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?Ha.join(o,...d):o}return s}function CTe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(UP(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(UP(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(UP(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function DTe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=CTe(t,e,n);t.debug&&bp("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(h8,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Gl.default)(i.match,f),m=(0,Gl.default)(i.ignore,f),h=vTe(i.match,f),g=m8(r,d,o),b=o?g:m8(r,d,!0),_=(w,O)=>{let T=b(O,!0);return T!=="."&&!h(T)||m(T)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let x=new UJ({filters:[a?(w,O)=>{let T=g(w,O),A=p(T)&&!m(T);return A&&bp(`matched ${T}`),A}:(w,O)=>{let T=g(w,O);return p(T)&&!m(T)}],exclude:a?(w,O)=>{let T=_(w,O);return bp(`${T?"skipped":"crawling"} ${O}`),T}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:S,signal:t.signal}).crawl(d);return t.debug&&bp("internal properties:",{...n,root:d}),[x,r!==d&&!o&&xTe(r,d)]}function NTe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function MTe(t){let e={...jTe,...t};return e.cwd=(e.cwd instanceof URL?yTe(e.cwd):gTe(e.cwd)).replace(h8,"/"),e.ignore=_8(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||lTe,readdirSync:e.fs.readdirSync||uTe,realpath:e.fs.realpath||dTe,realpathSync:e.fs.realpathSync||fTe,stat:e.fs.stat||pTe,statSync:e.fs.statSync||mTe}),e.debug&&bp("globbing with options:",e),e}function FTe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=_Te(t)||typeof t=="string",i=_8((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=MTe(n?e:t);return i.length>0?DTe(o,i):[]}function ys(t,e){let[r,n]=FTe(t,e);return r?NTe(r.sync(),n):[]}var Gl,_Te,h8,g8,bTe,STe,wTe,$Te,kTe,ETe,ATe,TTe,OTe,ITe,PTe,jTe,vp=y(()=>{qJ();Gl=St(p8(),1),_Te=Array.isArray,h8=/\\/g,g8=process.platform==="win32",bTe=/^(\/?\.\.)+$/;STe=/^[A-Z]:\/$/i,wTe=g8?t=>STe.test(t):t=>t==="/";$Te={parts:!0};kTe=/(?t.replace(kTe,"\\$&"),TTe=t=>t.replace(ETe,"\\$&"),OTe=g8?TTe:ATe;ITe=/^(\/?\.\.)+/,PTe=/\\(?=[()[\]{}!*+?@|])/g;jTe={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as Sp,readFileSync as LTe,readdirSync as zTe,statSync as b8}from"node:fs";import{join as Ga}from"node:path";function UTe(t){let{cwd:e="."}=t,r,n;try{let c=B(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=Fi(e,n),o=[],{layers:s,forbiddenImports:a}=qP(r);return(s.size>0||a.length>0)&&!Sp(Ga(e,i.mainRoot))?[{detector:wp,severity:"info",path:`${i.mainRoot}/`,message:`architecture layers declared but ${i.mainRoot}/ not found \u2014 layer checks skipped (flat layout not yet supported)`}]:(s.size>0&&(qTe(e,i,s,o),BTe(e,i,s,o)),a.length>0&&HTe(e,i,a,o),o)}function qP(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function qTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of zTe(o)){let a=Ga(o,s);b8(a).isDirectory()&&(r.has(s)||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function BTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of r){let a=Ga(o,s);Sp(a)&&b8(a).isDirectory()||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function HTe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Ga(t,i,s.from);if(!Sp(a))continue;let c=ys([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Ga(a,l),d;try{d=LTe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];GTe(p,s.to,e.importStyle)&&n.push({detector:wp,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function GTe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var wp,v8,BP=y(()=>{"use strict";vp();Ue();Ba();wp="ARCHITECTURE_FROM_SPEC";v8={name:wp,run:UTe}});import{existsSync as ZTe,readFileSync as VTe}from"node:fs";import{join as WTe}from"node:path";function JTe(t){let{cwd:e="."}=t,r=WTe(e,"spec/capabilities.yaml");if(!ZTe(r))return[];let n;try{let u=VTe(r,"utf8"),d=S8.default.parse(u);if(!d||typeof d!="object")return[];n=d}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o,s=!1;try{let u=B(e);o=new Set(u.features.map(d=>d.id)),s=u.project.onboarding_seeded===!0}catch{return[]}let a=[],c=new Set,l=s&&o.size{"use strict";S8=St(er(),1);Ue();Fv="CAPABILITIES_FEATURE_MAPPING",KTe=8;w8={name:Fv,run:JTe}});import{existsSync as YTe,readFileSync as XTe}from"node:fs";import{join as QTe}from"node:path";function eOe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("#")||e.startsWith('"""')||e.startsWith("'''")}function tOe(t){let{cwd:e="."}=t;return ge(e,HP,r=>rOe(r,e))}function rOe(t,e){let r=Fi(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=QTe(e,o);if(!YTe(s))continue;let a=XTe(s,"utf8");eOe(a)||n.push({detector:HP,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var HP,$8,k8=y(()=>{"use strict";Ba();wt();HP="CONVENTION_DRIFT";$8={name:HP,run:tOe}});import{existsSync as GP,readFileSync as E8}from"node:fs";import{join as Lv}from"node:path";function nOe(t){return JSON.parse(t).total?.lines?.pct??0}function A8(t){let e=/]*\bline-rate="([0-9]*\.?[0-9]+)"/.exec(t);return e?Number(e[1])*100:null}function sOe(t,e){if(!xv(dt(t).gates.coverage?.cmd))return null;let r;try{r=$v(t,e)}catch(c){return[{detector:$o,severity:"error",message:c.message}]}let n=0,i=0,o=0,s=[];for(let c of r){let l=wP.find(d=>GP(Lv(c.dir,d)));if(!l){s.push(c.path);continue}let u=A8(E8(Lv(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:$o,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=T8(n,i);return a0?[{detector:$o,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function aOe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let a=sOe(e,t.focusModules);if(a)return a}let r;try{r=B(e).project?.language}catch{}let n=Fi(e,r),i=dt(e).language==="kotlin"?wP.find(a=>GP(Lv(e,a)))??lJ(e):n.coverageSummary,o=Lv(e,i);if(!GP(o))return[{detector:$o,severity:"info",message:`${i} not present \u2014 run stage_2.2 first`}];let s;try{let a=E8(o,"utf8");s=n.coverageFormat==="jacoco-xml"?iOe(a):n.coverageFormat==="cobertura-xml"?oOe(a):nOe(a)}catch(a){return[{detector:$o,severity:"warn",message:`${i} unparseable: ${a.message}`}]}return s===null?n.coverageFormat==="cobertura-xml"?[]:[{detector:$o,severity:"warn",message:`${i} contained no line-coverage counter`}]:s>=zv?[]:[{detector:$o,severity:"warn",message:`line coverage ${s.toFixed(1)}% < floor ${zv}%`}]}var $o,zv,O8,R8=y(()=>{"use strict";Ue();Av();Ba();kv();sn();$o="COVERAGE_DROP",zv=70;O8={name:$o,run:aOe}});import{existsSync as cOe}from"node:fs";import{join as lOe}from"node:path";function dOe(t){let{cwd:e="."}=t;return ge(e,Uv,r=>fOe(r,e))}function fOe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);if(!r){if(n.length===0)return[];let i=t.project.onboarding_seeded===!0&&t.features.length{"use strict";wt();Uv="DELIVERABLE_INTEGRITY",uOe=8;I8={name:Uv,run:dOe}});function pOe(t){let e=new Set((t.features??[]).map(n=>n.id)),r=[];for(let n of t.project?.smoke??[]){let i=n.feature;if(i===void 0||e.has(i))continue;let o=(n.run??[]).join(" ")||`kind:${n.kind}`;r.push({detector:qv,severity:"warn",path:"spec.yaml",message:`smoke probe '${o}' binds feature ${i}, which is not in the spec \u2014 a dangling binding is annotation drift (the bound feature was renamed, archived, or never existed). Fix the id or drop the binding.`})}return r}function mOe(t){let e=pOe(t),r=(t.features??[]).filter(o=>o.status==="done");return r.length===0||!!!t.project?.deliverable||(t.project?.smoke??[]).length>0?e:[...e,{detector:qv,severity:"warn",path:"spec.yaml",message:`${r.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function hOe(t){let{cwd:e="."}=t;return ge(e,qv,r=>mOe(r))}var qv,C8,D8=y(()=>{"use strict";wt();qv="SMOKE_PROBE_DEMAND";C8={name:qv,run:hOe}});function gOe(t){let{cwd:e="."}=t;return ge(e,Bv,r=>yOe(r,e))}function yOe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=as(e);if(n===null)return[{detector:Bv,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=B_(n,e,o);s.state!=="fresh"&&i.push({detector:Bv,severity:"warn",path:"spec/attestation.yaml",message:s.state==="unattested"?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:s.module?`${o.id}'s module ${s.module} changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var Bv,Hv,ZP=y(()=>{"use strict";vl();wt();Bv="STALE_ATTESTATION";Hv={name:Bv,run:gOe}});function _Oe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}return bOe(r)}function bOe(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:N8,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var N8,Gv,VP=y(()=>{"use strict";Ue();N8="DEPENDENCY_CYCLE";Gv={name:N8,run:_Oe}});import{appendFileSync as vOe,existsSync as j8,mkdirSync as SOe,readFileSync as wOe}from"node:fs";import{dirname as xOe,join as $Oe}from"node:path";function M8(t){return $Oe(t,kOe,EOe)}function F8(t){return WP.add(t),()=>WP.delete(t)}function Za(t,e){let r=M8(t),n=xOe(r);j8(n)||SOe(n,{recursive:!0}),vOe(r,`${JSON.stringify(e)} `,"utf8");for(let i of WP)try{i(t,e)}catch{}}function In(t){let e=M8(t);if(!j8(e))return[];let r=wOe(e,"utf8").trim();return r.length===0?[]:r.split(` -`).filter(n=>n.length>0).map(n=>JSON.parse(n))}var kOe,EOe,WP,ni=y(()=>{"use strict";kOe=".cladding",EOe="audit.log.jsonl";WP=new Set});import{existsSync as AOe}from"node:fs";import{join as TOe}from"node:path";function OOe(t){let{cwd:e="."}=t,r=In(e);if(r.length===0)return[{detector:KP,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=[];for(let i of r)i.artifact&&(AOe(TOe(e,i.artifact))||n.push({detector:KP,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var KP,L8,z8=y(()=>{"use strict";ni();KP="EVIDENCE_MISMATCH";L8={name:KP,run:OOe}});import{existsSync as ROe,readFileSync as IOe}from"node:fs";import{join as POe}from"node:path";function COe(t){let e=POe(t,H8);if(!ROe(e))return null;try{let n=((0,B8.parse)(IOe(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*q8(t,e){for(let r of t??[])r.startsWith(U8)&&(yield{ref:r,name:r.slice(U8.length),field:e})}function DOe(t){let{cwd:e="."}=t,r=COe(e);if(r===null)return[];let n;try{n=B(e)}catch(o){return[{detector:JP,severity:"info",message:`spec.yaml not loaded: ${o.message}`}]}let i=[];for(let o of n.features)for(let s of o.acceptance_criteria??[]){let a=[...q8(s.evidence_refs,"evidence_refs"),...q8(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:JP,severity:"warn",path:H8,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var B8,JP,U8,H8,G8,Z8=y(()=>{"use strict";B8=St(er(),1);Ue();JP="FIXTURE_REFERENCE_INVALID",U8="fixture:",H8="conformance/fixtures.yaml";G8={name:JP,run:DOe}});import{existsSync as Gl,readFileSync as YP}from"node:fs";import{join as Va}from"node:path";function NOe(t){return ys(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec|spec-first-window)\.ts$/.test(r)).length}function xp(t){if(!Gl(t))return null;try{return JSON.parse(YP(t,"utf8"))}catch{return null}}function jOe(t,e){let r=Va(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(YP(r,"utf8"))}catch(c){e.push({detector:ko,severity:"info",message:`plugin.json not loaded: ${c.message}`});return}let i=n.ironclad?.current?.detectors;if(!i)return;let o=i.match(/^(\d+)\/(\d+)$/);if(!o){e.push({detector:ko,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=NOe(t);s!==a&&e.push({detector:ko,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function MOe(t,e){for(let r of V8){let n=Va(t,r.path);if(!Gl(n))continue;let i=xp(n);if(!i){e.push({detector:ko,severity:"warn",message:`${r.host}: ${r.path} could not be parsed as JSON`});continue}for(let o of r.required)(i[o]===void 0||i[o]===null||i[o]==="")&&e.push({detector:ko,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function FOe(t,e){let r=xp(Va(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of V8){let s=Va(t,o.path);if(!Gl(s))continue;let a=xp(s);a?.version&&a.version!==n&&e.push({detector:ko,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=Va(t,".claude-plugin","marketplace.json");if(Gl(i)){let o=xp(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:ko,severity:"error",message:`marketplace: .claude-plugin/marketplace.json plugin '${s.name??"?"}' version='${s.version}' but package.json version='${n}' \u2014 the catalog advertises a stale version; bump it in lockstep`})}}function LOe(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function zOe(t,e){let r=Va(t,"src","cli","clad.ts"),n=Va(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!Gl(r)||!Gl(n))return;let i=LOe(YP(r,"utf8"));if(i.length===0)return;let s=xp(n)?.ironclad?.current?.["stages-implemented"];if(!Array.isArray(s))return;let a=new Set(i),c=new Set(s),l=i.filter(f=>!c.has(f)),u=s.filter(f=>!a.has(f));if(l.length===0&&u.length===0)return;let d=[l.length?`missing [${l.join(", ")}]`:"",u.length?`unexpected [${u.join(", ")}]`:""].filter(Boolean).join("; ");e.push({detector:ko,severity:"error",message:`plugins/claude-code/.claude-plugin/plugin.json stages-implemented disagrees with TIER_STAGES.all (src/cli/clad.ts): ${d} \u2014 run \`npm run build:plugin\` to re-derive`})}function UOe(t){let{cwd:e="."}=t,r=[];return jOe(e,r),zOe(e,r),MOe(e,r),FOe(e,r),r}var ko,V8,W8,K8=y(()=>{"use strict";vp();ko="HARNESS_INTEGRITY",V8=[{host:"claude-code",path:"plugins/claude-code/.claude-plugin/plugin.json",required:["name","version"]},{host:"codex",path:"plugins/codex/.codex-plugin/plugin.json",required:["name","version","description"]},{host:"gemini-cli",path:"plugins/gemini-cli/gemini-extension.json",required:["name","version"]}];W8={name:ko,run:UOe}});import{existsSync as qOe,readFileSync as BOe}from"node:fs";import{join as HOe}from"node:path";function ZOe(t){let{cwd:e="."}=t;return ge(e,Zv,r=>WOe(r,e))}function VOe(t){let e=HOe(t,"spec/capabilities.yaml");if(!qOe(e))return!1;try{let r=J8.default.parse(BOe(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function WOe(t,e){let r=t.features.length;if(r{"use strict";J8=St(er(),1);wt();Zv="HOLLOW_GOVERNANCE",GOe=8;Y8={name:Zv,run:ZOe}});import{existsSync as Q8,readFileSync as e5}from"node:fs";import{join as t5}from"node:path";function r5(t,e){let r=t.match(e);if(!r)return null;try{let n=JSON.parse(r[1]),i={};for(let[o,s]of Object.entries(n))typeof s=="string"&&(i[o]=s);return i}catch{return null}}function YOe(t){switch(t){case"fail":case"wiring-fail":return 0;case"wiring-ok":case"wiring-only":return 1;case"verified":return 2;default:return null}}function XOe(t){switch(t){case"wiring-only":return 1;case"verified":return 2;default:return null}}function QOe(t){let e=t5(t,"README.md"),r=t5(t,"docs","dogfood","matrix.md");if(!Q8(e)||!Q8(r))return[];let n=r5(e5(e,"utf8"),KOe),i=r5(e5(r,"utf8"),JOe);if(!n||!i)return[];let o=[];for(let[s,a]of Object.entries(n)){let c=XOe(a);if(c===null)continue;let l=i[s]??"not-run",u=YOe(l);u!==null&&c>u&&o.push({detector:n5,severity:"warn",path:"README.md",message:`README host-claims: '${s}' claims '${a}' but the newest matrix evidence is '${l}' \u2014 the claim exceeds the evidence. Re-run \`clad doctor --hosts\` (with consent) or lower the README claim for '${s}'.`})}return o}function eRe(t){let{cwd:e="."}=t;return QOe(e)}var n5,KOe,JOe,i5,o5=y(()=>{"use strict";n5="HOST_CLAIM_DRIFT",KOe=//,JOe=//;i5={name:n5,run:eRe}});function tRe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=[];return s5(r.features.map(i=>i.id),"feature","spec/features/",n),s5((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function s5(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:a5,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var a5,c5,l5=y(()=>{"use strict";Ue();a5="ID_COLLISION";c5={name:a5,run:tRe}});import{existsSync as $p,readFileSync as XP,readdirSync as QP,statSync as rRe,writeFileSync as d5}from"node:fs";import{join as Eo}from"node:path";function u5(t){if(!$p(t))return 0;try{return QP(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function nRe(t){if(!$p(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=QP(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=Eo(n,o),a;try{a=rRe(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function iRe(t){let e=Eo(t,"spec","capabilities.yaml");if(!$p(e))return 0;try{let r=Vv.default.parse(XP(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function _s(t="."){let e=u5(Eo(t,"spec","features")),r=u5(Eo(t,"spec","scenarios")),n=iRe(t),i=nRe(Eo(t,"tests"));return{features:e,scenarios:r,capabilities:n,test_files:i}}function Zl(t,e){let r=Eo(t,"spec.yaml");if(!$p(r))return;let n=XP(r,"utf8"),i=oRe(n,e);i!==n&&d5(r,i)}function oRe(t,e){let r=t.includes(`\r +`).filter(n=>n.length>0).map(n=>JSON.parse(n))}var kOe,EOe,WP,ni=y(()=>{"use strict";kOe=".cladding",EOe="audit.log.jsonl";WP=new Set});import{existsSync as AOe}from"node:fs";import{join as TOe}from"node:path";function OOe(t){let{cwd:e="."}=t,r=In(e);if(r.length===0)return[{detector:KP,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=[];for(let i of r)i.artifact&&(AOe(TOe(e,i.artifact))||n.push({detector:KP,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var KP,L8,z8=y(()=>{"use strict";ni();KP="EVIDENCE_MISMATCH";L8={name:KP,run:OOe}});import{existsSync as ROe,readFileSync as IOe}from"node:fs";import{join as POe}from"node:path";function COe(t){let e=POe(t,H8);if(!ROe(e))return null;try{let n=((0,B8.parse)(IOe(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*q8(t,e){for(let r of t??[])r.startsWith(U8)&&(yield{ref:r,name:r.slice(U8.length),field:e})}function DOe(t){let{cwd:e="."}=t,r=COe(e);if(r===null)return[];let n;try{n=B(e)}catch(o){return[{detector:JP,severity:"info",message:`spec.yaml not loaded: ${o.message}`}]}let i=[];for(let o of n.features)for(let s of o.acceptance_criteria??[]){let a=[...q8(s.evidence_refs,"evidence_refs"),...q8(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:JP,severity:"warn",path:H8,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var B8,JP,U8,H8,G8,Z8=y(()=>{"use strict";B8=St(er(),1);Ue();JP="FIXTURE_REFERENCE_INVALID",U8="fixture:",H8="conformance/fixtures.yaml";G8={name:JP,run:DOe}});import{existsSync as Zl,readFileSync as YP}from"node:fs";import{join as Va}from"node:path";function NOe(t){return ys(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec|spec-first-window)\.ts$/.test(r)).length}function xp(t){if(!Zl(t))return null;try{return JSON.parse(YP(t,"utf8"))}catch{return null}}function jOe(t,e){let r=Va(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(YP(r,"utf8"))}catch(c){e.push({detector:ko,severity:"info",message:`plugin.json not loaded: ${c.message}`});return}let i=n.ironclad?.current?.detectors;if(!i)return;let o=i.match(/^(\d+)\/(\d+)$/);if(!o){e.push({detector:ko,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=NOe(t);s!==a&&e.push({detector:ko,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function MOe(t,e){for(let r of V8){let n=Va(t,r.path);if(!Zl(n))continue;let i=xp(n);if(!i){e.push({detector:ko,severity:"warn",message:`${r.host}: ${r.path} could not be parsed as JSON`});continue}for(let o of r.required)(i[o]===void 0||i[o]===null||i[o]==="")&&e.push({detector:ko,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function FOe(t,e){let r=xp(Va(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of V8){let s=Va(t,o.path);if(!Zl(s))continue;let a=xp(s);a?.version&&a.version!==n&&e.push({detector:ko,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=Va(t,".claude-plugin","marketplace.json");if(Zl(i)){let o=xp(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:ko,severity:"error",message:`marketplace: .claude-plugin/marketplace.json plugin '${s.name??"?"}' version='${s.version}' but package.json version='${n}' \u2014 the catalog advertises a stale version; bump it in lockstep`})}}function LOe(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function zOe(t,e){let r=Va(t,"src","cli","clad.ts"),n=Va(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!Zl(r)||!Zl(n))return;let i=LOe(YP(r,"utf8"));if(i.length===0)return;let s=xp(n)?.ironclad?.current?.["stages-implemented"];if(!Array.isArray(s))return;let a=new Set(i),c=new Set(s),l=i.filter(f=>!c.has(f)),u=s.filter(f=>!a.has(f));if(l.length===0&&u.length===0)return;let d=[l.length?`missing [${l.join(", ")}]`:"",u.length?`unexpected [${u.join(", ")}]`:""].filter(Boolean).join("; ");e.push({detector:ko,severity:"error",message:`plugins/claude-code/.claude-plugin/plugin.json stages-implemented disagrees with TIER_STAGES.all (src/cli/clad.ts): ${d} \u2014 run \`npm run build:plugin\` to re-derive`})}function UOe(t){let{cwd:e="."}=t,r=[];return jOe(e,r),zOe(e,r),MOe(e,r),FOe(e,r),r}var ko,V8,W8,K8=y(()=>{"use strict";vp();ko="HARNESS_INTEGRITY",V8=[{host:"claude-code",path:"plugins/claude-code/.claude-plugin/plugin.json",required:["name","version"]},{host:"codex",path:"plugins/codex/.codex-plugin/plugin.json",required:["name","version","description"]},{host:"gemini-cli",path:"plugins/gemini-cli/gemini-extension.json",required:["name","version"]}];W8={name:ko,run:UOe}});import{existsSync as qOe,readFileSync as BOe}from"node:fs";import{join as HOe}from"node:path";function ZOe(t){let{cwd:e="."}=t;return ge(e,Zv,r=>WOe(r,e))}function VOe(t){let e=HOe(t,"spec/capabilities.yaml");if(!qOe(e))return!1;try{let r=J8.default.parse(BOe(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function WOe(t,e){let r=t.features.length;if(r{"use strict";J8=St(er(),1);wt();Zv="HOLLOW_GOVERNANCE",GOe=8;Y8={name:Zv,run:ZOe}});import{existsSync as Q8,readFileSync as e5}from"node:fs";import{join as t5}from"node:path";function r5(t,e){let r=t.match(e);if(!r)return null;try{let n=JSON.parse(r[1]),i={};for(let[o,s]of Object.entries(n))typeof s=="string"&&(i[o]=s);return i}catch{return null}}function YOe(t){switch(t){case"fail":case"wiring-fail":return 0;case"wiring-ok":case"wiring-only":return 1;case"verified":return 2;default:return null}}function XOe(t){switch(t){case"wiring-only":return 1;case"verified":return 2;default:return null}}function QOe(t){let e=t5(t,"README.md"),r=t5(t,"docs","dogfood","matrix.md");if(!Q8(e)||!Q8(r))return[];let n=r5(e5(e,"utf8"),KOe),i=r5(e5(r,"utf8"),JOe);if(!n||!i)return[];let o=[];for(let[s,a]of Object.entries(n)){let c=XOe(a);if(c===null)continue;let l=i[s]??"not-run",u=YOe(l);u!==null&&c>u&&o.push({detector:n5,severity:"warn",path:"README.md",message:`README host-claims: '${s}' claims '${a}' but the newest matrix evidence is '${l}' \u2014 the claim exceeds the evidence. Re-run \`clad doctor --hosts\` (with consent) or lower the README claim for '${s}'.`})}return o}function eRe(t){let{cwd:e="."}=t;return QOe(e)}var n5,KOe,JOe,i5,o5=y(()=>{"use strict";n5="HOST_CLAIM_DRIFT",KOe=//,JOe=//;i5={name:n5,run:eRe}});function tRe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=[];return s5(r.features.map(i=>i.id),"feature","spec/features/",n),s5((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function s5(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:a5,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var a5,c5,l5=y(()=>{"use strict";Ue();a5="ID_COLLISION";c5={name:a5,run:tRe}});import{existsSync as $p,readFileSync as XP,readdirSync as QP,statSync as rRe,writeFileSync as d5}from"node:fs";import{join as Eo}from"node:path";function u5(t){if(!$p(t))return 0;try{return QP(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function nRe(t){if(!$p(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=QP(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=Eo(n,o),a;try{a=rRe(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function iRe(t){let e=Eo(t,"spec","capabilities.yaml");if(!$p(e))return 0;try{let r=Vv.default.parse(XP(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function _s(t="."){let e=u5(Eo(t,"spec","features")),r=u5(Eo(t,"spec","scenarios")),n=iRe(t),i=nRe(Eo(t,"tests"));return{features:e,scenarios:r,capabilities:n,test_files:i}}function Vl(t,e){let r=Eo(t,"spec.yaml");if(!$p(r))return;let n=XP(r,"utf8"),i=oRe(n,e);i!==n&&d5(r,i)}function oRe(t,e){let r=t.includes(`\r `)?`\r `:` `,n=t.split(/\r?\n/),i=n.findIndex(d=>/^inventory:\s*$/.test(d)),o=["# Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand.","inventory:",` features: ${e.features??0}`,` scenarios: ${e.scenarios??0}`,` capabilities: ${e.capabilities??0}`,` test_files: ${e.test_files??0}`],s=d=>r===`\r @@ -273,18 +273,18 @@ ${o.join(` `))}function Wa(t="."){let e=Eo(t,"spec","features");if(!$p(e))return!1;let r=[];for(let i of QP(e).sort())if(!(!i.endsWith(".yaml")&&!i.endsWith(".yml")))try{let o=(0,Vv.parse)(XP(Eo(e,i),"utf8"));if(!o?.id)continue;let s=o.slug??i.replace(/\.(ya?ml)$/,"");r.push(` ${o.id}: {slug: ${s}, status: ${o.status??"planned"}, modules: ${(o.modules??[]).length}}`)}catch{continue}r.sort();let n="# Cladding \xB7 Tier C \u2014 generated feature index (`clad sync`). Do not edit by hand.\n# One line per feature \u2192 1-file lookup + line-independent merges\n# (suggested .gitattributes: `spec/index.yaml merge=union`).\nfeatures:\n"+r.join(` `)+` `;return d5(Eo(t,"spec","index.yaml"),n,"utf8"),!0}var Vv,kp=y(()=>{"use strict";Vv=St(er(),1)});import{existsSync as f5,readFileSync as p5,readdirSync as sRe}from"node:fs";import{join as eC}from"node:path";function aRe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=_s(e),i=r.inventory;if(!i){let s=m5.filter(([c])=>(n[c]??0)>0);if(s.length===0)return tC(e);let a=s.map(([c,l])=>`${n[c]??0} ${l}`).join(", ");return[...tC(e),{detector:Ep,severity:"warn",path:"spec.yaml",message:`spec.yaml has no inventory: block, but the project has ${a} on disk \u2014 run \`clad sync\` to record the inventory so anyone reading spec.yaml sees its real scale.`}]}let o=[];for(let[s,a]of m5){let c=i[s]??0,l=n[s]??0;c!==l&&o.push({detector:Ep,severity:"error",path:"spec.yaml",message:`spec.yaml inventory.${s} declares ${c} but the project has ${l} ${a} on disk \u2014 run \`clad sync\` (a stale inventory hides created/deleted shards from anyone reading spec.yaml).`})}return o.push(...tC(e)),o}function tC(t){let e=eC(t,"spec","index.yaml"),r=eC(t,"spec","features");if(!f5(e)||!f5(r))return[];let n=new Map;try{for(let l of p5(e,"utf8").split(` -`)){let u=l.match(/^ (F-[\w-]+):.*\bstatus:\s*['"]?([\w-]+)['"]?/);if(u){n.set(u[1],u[2]);continue}let d=l.match(/^ (F-[\w-]+):/);d&&n.set(d[1],"planned")}}catch{return[]}let i=new Map;try{for(let l of sRe(r)){if(!l.endsWith(".yaml")&&!l.endsWith(".yml"))continue;let u=p5(eC(r,l),"utf8"),d=u.match(/^id:\s*['"]?(F-[\w-]+)['"]?/m);if(!d)continue;let f=u.match(/^status:\s*['"]?([\w-]+)['"]?/m);i.set(d[1],f?f[1]:"planned")}}catch{return[]}let o=[],s=[...i.keys()].filter(l=>!n.has(l)).sort(),a=[...n.keys()].filter(l=>!i.has(l)).sort();if(s.length>0||a.length>0){let l=[];s.length>0&&l.push(`missing from index: ${s.join(", ")}`),a.length>0&&l.push(`in index but not on disk: ${a.join(", ")}`),o.push({detector:Ep,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml disagrees with spec/features/ (${l.join("; ")}) \u2014 run \`clad sync\` to regenerate (a stale index silently misleads agents that trust it for lookup).`})}let c=[...i.keys()].filter(l=>n.has(l)&&n.get(l)!==i.get(l)).sort().map(l=>`${l} (index: ${n.get(l)}, shard: ${i.get(l)})`);return c.length>0&&o.push({detector:Ep,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml status disagrees with spec/features/ for ${c.join("; ")} \u2014 run \`clad sync\` to regenerate (a stale status silently misleads agents that trust the index).`}),o}var Ep,m5,h5,g5=y(()=>{"use strict";kp();Ue();Ep="INVENTORY_DRIFT",m5=[["features","feature shard(s)"],["scenarios","scenario shard(s)"],["capabilities","capabilit(ies)"],["test_files","test file(s)"]];h5={name:Ep,run:aRe}});import{existsSync as cRe,readFileSync as lRe}from"node:fs";import{join as uRe}from"node:path";function fRe(t){let{cwd:e="."}=t,r=uRe(e,"src","spec","schema.json"),n=[];if(cRe(r)){let i;try{i=JSON.parse(lRe(r,"utf8"))}catch(o){n.push({detector:Ap,severity:"error",message:`spec/schema.json unreadable or invalid JSON: ${o.message}`})}if(i)for(let o of dRe)i.required?.includes(o)||n.push({detector:Ap,severity:"error",message:`spec/schema.json does not require root key '${o}'`}),i.properties?.[o]||n.push({detector:Ap,severity:"error",message:`spec/schema.json does not declare property '${o}'`})}try{let i=B(e);i.schema!==y5&&n.push({detector:Ap,severity:"error",message:`spec.yaml schema='${i.schema}' but supported version is '${y5}'`})}catch{}return n}var Ap,dRe,y5,_5,b5=y(()=>{"use strict";Ue();Ap="META_INTEGRITY",dRe=["schema","project","features"],y5="0.1";_5={name:Ap,run:fRe}});function pRe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=[];return v5(r.features.map(i=>({id:i.id,slug:i.slug})),"features",n),v5((r.scenarios??[]).map(i=>({id:i.id,slug:i.slug})),"scenarios",n),n}function v5(t,e,r){let n=new Map;for(let i of t){if(!i.slug)continue;let o=n.get(i.slug);o?r.push({detector:S5,severity:"error",message:`slug '${i.slug}' is used by both ${o} and ${i.id} in ${e}/ \u2014 two items in the same namespace cannot share a slug; pick a different slug for one`}):n.set(i.slug,i.id)}}var S5,w5,x5=y(()=>{"use strict";Ue();S5="SLUG_CONFLICT";w5={name:S5,run:pRe}});function Vl(t){return t==="planned"||t==="in_progress"}var Wv=y(()=>{"use strict"});import{existsSync as mRe}from"node:fs";import{join as hRe}from"node:path";function gRe(t){let{cwd:e="."}=t;return ge(e,Kv,r=>yRe(r,e))}function yRe(t,e){let r=[];for(let n of t.features)for(let i of n.modules??[]){let o=hRe(e,i);mRe(o)||r.push(_Re(n.id,i,n.status))}return r}function _Re(t,e,r){return Vl(r)?{detector:Kv,severity:"info",path:e,message:`feature ${t}'s module '${e}' is not built yet \u2014 the normal state between authoring the spec entry and implementing it`}:{detector:Kv,severity:"error",path:e,message:`feature ${t} declares module '${e}' but the file does not exist`}}var Kv,Jv,rC=y(()=>{"use strict";Wv();wt();Kv="MISSING_IMPLEMENTATION";Jv={name:Kv,run:gRe}});function bRe(t){let{cwd:e="."}=t;return ge(e,nC,vRe)}function vRe(t){let e=[];for(let r of t.features)if(r.status==="done")for(let n of r.acceptance_criteria??[]){let o=(n.test_refs??[]).filter(c=>!c.startsWith("derived:")).length>0,s=(n.evidence_refs?.length??0)>0,a=!o&&!s&&(n.test_refs?.length??0)>0;!o&&!s&&e.push({detector:nC,severity:"error",message:`${r.id}.${n.id} declares no test_refs or evidence_refs \u2014 AC is unverified`+(a?" (a 'derived:' candidate exists \u2014 confirm it by removing the prefix, or author a real ref)":"")})}return e}var nC,Yv,iC=y(()=>{"use strict";wt();nC="MISSING_TESTS";Yv={name:nC,run:bRe}});import{existsSync as SRe,readFileSync as wRe}from"node:fs";import{join as $5}from"node:path";function k5(t){if(SRe(t))try{return JSON.parse(wRe(t,"utf8"))}catch{return}}function ERe(t){let{cwd:e="."}=t,r=k5($5(e,xRe)),n=k5($5(e,$Re));if(!r||!n)return[{detector:oC,severity:"info",message:"perf baseline or current missing \u2014 run stage_3.2 with --record first"}];let i=[];for(let[o,s]of Object.entries(r.metrics??{})){let a=n.metrics?.[o];if(!a||typeof s.value!="number"||typeof a.value!="number"||s.value===0)continue;let c=(a.value-s.value)/s.value*100;c>kRe&&i.push({detector:oC,severity:"warn",message:`${o} regressed ${c.toFixed(1)}% (baseline ${s.value}${s.unit??""} \u2192 current ${a.value}${a.unit??""})`})}return i}var oC,xRe,$Re,kRe,E5,A5=y(()=>{"use strict";oC="PERFORMANCE_DRIFT",xRe="perf/baseline.json",$Re="perf/current.json",kRe=10;E5={name:oC,run:ERe}});import{existsSync as ARe}from"node:fs";import{join as TRe}from"node:path";function RRe(t){let{cwd:e="."}=t;return ge(e,sC,r=>PRe(r,e))}function IRe(t,e){return(t.modules??[]).some(r=>ARe(TRe(e,r)))}function PRe(t,e){let r=[];for(let s of t.features)s.status!=="planned"&&s.status!=="in_progress"||IRe(s,e)||r.push(s.id);let n=ORe;if(r.length<=n)return[];let i=r.slice(0,T5).join(", "),o=r.length>T5?", \u2026":"";return[{detector:sC,severity:"warn",message:`${r.length} planned/in_progress features have NO code on disk (> ${n} tolerated) \u2014 the spec has raced ahead of the code. Work one feature end-to-end before authoring the next (docs/feature-cycle.md). Stalled: ${i}${o}`}]}var sC,ORe,T5,O5,R5=y(()=>{"use strict";wt();sC="PLANNED_BACKLOG",ORe=5,T5=8;O5={name:sC,run:RRe}});import{existsSync as CRe,readFileSync as DRe}from"node:fs";import{join as NRe}from"node:path";function FRe(t){let{cwd:e="."}=t;return ge(e,aC,r=>LRe(r,e))}function LRe(t,e){if(t.features.lengthn.includes(i))?[{detector:aC,severity:"warn",path:"docs/project-context.md",message:`${t.features.length} features but docs/project-context.md is still the unrefined init template (it still carries the placeholder prompts) \u2014 the Why/What/Purpose narrative was never filled in. Fill it in with \`clad clarify\` or by hand.`}]:[]}var aC,jRe,MRe,I5,P5=y(()=>{"use strict";wt();aC="PROJECT_CONTEXT_DRIFT",jRe=8,MRe=["Refine by hand or re-run with LLM available","What gap or pain led to this project","What does success look like"];I5={name:aC,run:FRe}});function C5(t,e,r){return e?e.filter(n=>!t.has(n)).map(n=>({detector:Xv,severity:"error",message:`${r} references unknown id '${n}'`})):[]}function zRe(t){let{cwd:e="."}=t;return ge(e,Xv,URe)}function URe(t){let e=new Set(t.features.map(n=>n.id)),r=[];for(let n of t.features)r.push(...C5(e,n.depends_on,`feature ${n.id}.depends_on`)),n.superseded_by&&!e.has(n.superseded_by)&&r.push({detector:Xv,severity:"error",message:`feature ${n.id}.superseded_by references unknown id '${n.superseded_by}'`});for(let n of t.scenarios??[])r.push(...C5(e,n.features,`scenario ${n.id}.features`));return r}var Xv,Qv,cC=y(()=>{"use strict";wt();Xv="REFERENCE_INTEGRITY";Qv={name:Xv,run:zRe}});function Tp(t=""){return new RegExp(qRe,t)}var qRe,lC=y(()=>{"use strict";qRe=String.raw`\bF-(?:\d{3,}|[0-9a-f]{6,8})\b`});import{existsSync as BRe,readdirSync as HRe,readFileSync as GRe,statSync as ZRe,writeFileSync as VRe}from"node:fs";import{dirname as WRe,join as Op,normalize as KRe,relative as JRe}from"node:path";function tIe(t){let e=[];for(let r of t.matchAll(eIe))if(!r[1].trim().startsWith("ignore"))for(let n of r[1].match(Tp("g"))??[])e.push(n);return[...new Set(e)].sort()}function rIe(t){return t.replace(/```[\s\S]*?```/g," ").replace(/~~~[\s\S]*?~~~/g," ").replace(/`[^`\n]*`/g," ")}function D5(t){return t.split("\\").join("/")}function nIe(t){return YRe.some(e=>t===e||t.startsWith(`${e}/`))}function iIe(t){let e=Op(t,"docs");if(!BRe(e))return[];let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=HRe(i)}catch{continue}for(let s of o){if(s.startsWith("."))continue;let a=Op(i,s),c;try{c=ZRe(a)}catch{continue}let l=D5(JRe(t,a));c.isDirectory()?n.push(a):s.endsWith(".md")&&r.push(l)}}return r.sort()}function oIe(t,e){if(/^[a-z]+:/i.test(e))return null;let r=KRe(Op(WRe(t),e));return D5(r)}function Rp(t="."){let e=[];for(let r of iIe(t)){let n;try{n=GRe(Op(t,r),"utf8")}catch{continue}let i=rIe(n),o=tIe(i);if(nIe(r)){if(o.length===0)continue;e.push({doc:r,features:o,doc_links:[]});continue}let a=n.includes(XRe)?[]:i.match(Tp("g"))??[],c=[...new Set([...a,...o])].sort(),l=new Set;for(let u of i.matchAll(QRe)){let d=oIe(r,u[1]);d&&l.add(d)}e.push({doc:r,features:c,doc_links:[...l].sort()})}return{docs:e}}function N5(t="."){let e=Rp(t);if(e.docs.length===0)return!1;let r=["# Cladding \xB7 Tier C \u2014 generated doc\u2192spec / doc\u2192doc link index (`clad sync`). Do not edit by hand.","# Source of truth is the docs themselves; DOC_LINK_INTEGRITY validates resolution.",'schema: "0.1"',"docs:"];for(let n of e.docs)n.features.length===0&&n.doc_links.length===0||(r.push(` ${JSON.stringify(n.doc)}:`),n.features.length>0&&r.push(` features: [${n.features.join(", ")}]`),n.doc_links.length>0&&r.push(` doc_links: [${n.doc_links.map(i=>JSON.stringify(i)).join(", ")}]`));return VRe(Op(t,"spec","_doc-links.yaml"),`${r.join(` +`)){let u=l.match(/^ (F-[\w-]+):.*\bstatus:\s*['"]?([\w-]+)['"]?/);if(u){n.set(u[1],u[2]);continue}let d=l.match(/^ (F-[\w-]+):/);d&&n.set(d[1],"planned")}}catch{return[]}let i=new Map;try{for(let l of sRe(r)){if(!l.endsWith(".yaml")&&!l.endsWith(".yml"))continue;let u=p5(eC(r,l),"utf8"),d=u.match(/^id:\s*['"]?(F-[\w-]+)['"]?/m);if(!d)continue;let f=u.match(/^status:\s*['"]?([\w-]+)['"]?/m);i.set(d[1],f?f[1]:"planned")}}catch{return[]}let o=[],s=[...i.keys()].filter(l=>!n.has(l)).sort(),a=[...n.keys()].filter(l=>!i.has(l)).sort();if(s.length>0||a.length>0){let l=[];s.length>0&&l.push(`missing from index: ${s.join(", ")}`),a.length>0&&l.push(`in index but not on disk: ${a.join(", ")}`),o.push({detector:Ep,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml disagrees with spec/features/ (${l.join("; ")}) \u2014 run \`clad sync\` to regenerate (a stale index silently misleads agents that trust it for lookup).`})}let c=[...i.keys()].filter(l=>n.has(l)&&n.get(l)!==i.get(l)).sort().map(l=>`${l} (index: ${n.get(l)}, shard: ${i.get(l)})`);return c.length>0&&o.push({detector:Ep,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml status disagrees with spec/features/ for ${c.join("; ")} \u2014 run \`clad sync\` to regenerate (a stale status silently misleads agents that trust the index).`}),o}var Ep,m5,h5,g5=y(()=>{"use strict";kp();Ue();Ep="INVENTORY_DRIFT",m5=[["features","feature shard(s)"],["scenarios","scenario shard(s)"],["capabilities","capabilit(ies)"],["test_files","test file(s)"]];h5={name:Ep,run:aRe}});import{existsSync as cRe,readFileSync as lRe}from"node:fs";import{join as uRe}from"node:path";function fRe(t){let{cwd:e="."}=t,r=uRe(e,"src","spec","schema.json"),n=[];if(cRe(r)){let i;try{i=JSON.parse(lRe(r,"utf8"))}catch(o){n.push({detector:Ap,severity:"error",message:`spec/schema.json unreadable or invalid JSON: ${o.message}`})}if(i)for(let o of dRe)i.required?.includes(o)||n.push({detector:Ap,severity:"error",message:`spec/schema.json does not require root key '${o}'`}),i.properties?.[o]||n.push({detector:Ap,severity:"error",message:`spec/schema.json does not declare property '${o}'`})}try{let i=B(e);i.schema!==y5&&n.push({detector:Ap,severity:"error",message:`spec.yaml schema='${i.schema}' but supported version is '${y5}'`})}catch{}return n}var Ap,dRe,y5,_5,b5=y(()=>{"use strict";Ue();Ap="META_INTEGRITY",dRe=["schema","project","features"],y5="0.1";_5={name:Ap,run:fRe}});function pRe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=[];return v5(r.features.map(i=>({id:i.id,slug:i.slug})),"features",n),v5((r.scenarios??[]).map(i=>({id:i.id,slug:i.slug})),"scenarios",n),n}function v5(t,e,r){let n=new Map;for(let i of t){if(!i.slug)continue;let o=n.get(i.slug);o?r.push({detector:S5,severity:"error",message:`slug '${i.slug}' is used by both ${o} and ${i.id} in ${e}/ \u2014 two items in the same namespace cannot share a slug; pick a different slug for one`}):n.set(i.slug,i.id)}}var S5,w5,x5=y(()=>{"use strict";Ue();S5="SLUG_CONFLICT";w5={name:S5,run:pRe}});function Wl(t){return t==="planned"||t==="in_progress"}var Wv=y(()=>{"use strict"});import{existsSync as mRe}from"node:fs";import{join as hRe}from"node:path";function gRe(t){let{cwd:e="."}=t;return ge(e,Kv,r=>yRe(r,e))}function yRe(t,e){let r=[];for(let n of t.features)for(let i of n.modules??[]){let o=hRe(e,i);mRe(o)||r.push(_Re(n.id,i,n.status))}return r}function _Re(t,e,r){return Wl(r)?{detector:Kv,severity:"info",path:e,message:`feature ${t}'s module '${e}' is not built yet \u2014 the normal state between authoring the spec entry and implementing it`}:{detector:Kv,severity:"error",path:e,message:`feature ${t} declares module '${e}' but the file does not exist`}}var Kv,Jv,rC=y(()=>{"use strict";Wv();wt();Kv="MISSING_IMPLEMENTATION";Jv={name:Kv,run:gRe}});function bRe(t){let{cwd:e="."}=t;return ge(e,nC,vRe)}function vRe(t){let e=[];for(let r of t.features)if(r.status==="done")for(let n of r.acceptance_criteria??[]){let o=(n.test_refs??[]).filter(c=>!c.startsWith("derived:")).length>0,s=(n.evidence_refs?.length??0)>0,a=!o&&!s&&(n.test_refs?.length??0)>0;!o&&!s&&e.push({detector:nC,severity:"error",message:`${r.id}.${n.id} declares no test_refs or evidence_refs \u2014 AC is unverified`+(a?" (a 'derived:' candidate exists \u2014 confirm it by removing the prefix, or author a real ref)":"")})}return e}var nC,Yv,iC=y(()=>{"use strict";wt();nC="MISSING_TESTS";Yv={name:nC,run:bRe}});import{existsSync as SRe,readFileSync as wRe}from"node:fs";import{join as $5}from"node:path";function k5(t){if(SRe(t))try{return JSON.parse(wRe(t,"utf8"))}catch{return}}function ERe(t){let{cwd:e="."}=t,r=k5($5(e,xRe)),n=k5($5(e,$Re));if(!r||!n)return[{detector:oC,severity:"info",message:"perf baseline or current missing \u2014 run stage_3.2 with --record first"}];let i=[];for(let[o,s]of Object.entries(r.metrics??{})){let a=n.metrics?.[o];if(!a||typeof s.value!="number"||typeof a.value!="number"||s.value===0)continue;let c=(a.value-s.value)/s.value*100;c>kRe&&i.push({detector:oC,severity:"warn",message:`${o} regressed ${c.toFixed(1)}% (baseline ${s.value}${s.unit??""} \u2192 current ${a.value}${a.unit??""})`})}return i}var oC,xRe,$Re,kRe,E5,A5=y(()=>{"use strict";oC="PERFORMANCE_DRIFT",xRe="perf/baseline.json",$Re="perf/current.json",kRe=10;E5={name:oC,run:ERe}});import{existsSync as ARe}from"node:fs";import{join as TRe}from"node:path";function RRe(t){let{cwd:e="."}=t;return ge(e,sC,r=>PRe(r,e))}function IRe(t,e){return(t.modules??[]).some(r=>ARe(TRe(e,r)))}function PRe(t,e){let r=[];for(let s of t.features)s.status!=="planned"&&s.status!=="in_progress"||IRe(s,e)||r.push(s.id);let n=ORe;if(r.length<=n)return[];let i=r.slice(0,T5).join(", "),o=r.length>T5?", \u2026":"";return[{detector:sC,severity:"warn",message:`${r.length} planned/in_progress features have NO code on disk (> ${n} tolerated) \u2014 the spec has raced ahead of the code. Work one feature end-to-end before authoring the next (docs/feature-cycle.md). Stalled: ${i}${o}`}]}var sC,ORe,T5,O5,R5=y(()=>{"use strict";wt();sC="PLANNED_BACKLOG",ORe=5,T5=8;O5={name:sC,run:RRe}});import{existsSync as CRe,readFileSync as DRe}from"node:fs";import{join as NRe}from"node:path";function FRe(t){let{cwd:e="."}=t;return ge(e,aC,r=>LRe(r,e))}function LRe(t,e){if(t.features.lengthn.includes(i))?[{detector:aC,severity:"warn",path:"docs/project-context.md",message:`${t.features.length} features but docs/project-context.md is still the unrefined init template (it still carries the placeholder prompts) \u2014 the Why/What/Purpose narrative was never filled in. Fill it in with \`clad clarify\` or by hand.`}]:[]}var aC,jRe,MRe,I5,P5=y(()=>{"use strict";wt();aC="PROJECT_CONTEXT_DRIFT",jRe=8,MRe=["Refine by hand or re-run with LLM available","What gap or pain led to this project","What does success look like"];I5={name:aC,run:FRe}});function C5(t,e,r){return e?e.filter(n=>!t.has(n)).map(n=>({detector:Xv,severity:"error",message:`${r} references unknown id '${n}'`})):[]}function zRe(t){let{cwd:e="."}=t;return ge(e,Xv,URe)}function URe(t){let e=new Set(t.features.map(n=>n.id)),r=[];for(let n of t.features)r.push(...C5(e,n.depends_on,`feature ${n.id}.depends_on`)),n.superseded_by&&!e.has(n.superseded_by)&&r.push({detector:Xv,severity:"error",message:`feature ${n.id}.superseded_by references unknown id '${n.superseded_by}'`});for(let n of t.scenarios??[])r.push(...C5(e,n.features,`scenario ${n.id}.features`));return r}var Xv,Qv,cC=y(()=>{"use strict";wt();Xv="REFERENCE_INTEGRITY";Qv={name:Xv,run:zRe}});function Tp(t=""){return new RegExp(qRe,t)}var qRe,lC=y(()=>{"use strict";qRe=String.raw`\bF-(?:\d{3,}|[0-9a-f]{6,8})\b`});import{existsSync as BRe,readdirSync as HRe,readFileSync as GRe,statSync as ZRe,writeFileSync as VRe}from"node:fs";import{dirname as WRe,join as Op,normalize as KRe,relative as JRe}from"node:path";function tIe(t){let e=[];for(let r of t.matchAll(eIe))if(!r[1].trim().startsWith("ignore"))for(let n of r[1].match(Tp("g"))??[])e.push(n);return[...new Set(e)].sort()}function rIe(t){return t.replace(/```[\s\S]*?```/g," ").replace(/~~~[\s\S]*?~~~/g," ").replace(/`[^`\n]*`/g," ")}function D5(t){return t.split("\\").join("/")}function nIe(t){return YRe.some(e=>t===e||t.startsWith(`${e}/`))}function iIe(t){let e=Op(t,"docs");if(!BRe(e))return[];let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=HRe(i)}catch{continue}for(let s of o){if(s.startsWith("."))continue;let a=Op(i,s),c;try{c=ZRe(a)}catch{continue}let l=D5(JRe(t,a));c.isDirectory()?n.push(a):s.endsWith(".md")&&r.push(l)}}return r.sort()}function oIe(t,e){if(/^[a-z]+:/i.test(e))return null;let r=KRe(Op(WRe(t),e));return D5(r)}function Rp(t="."){let e=[];for(let r of iIe(t)){let n;try{n=GRe(Op(t,r),"utf8")}catch{continue}let i=rIe(n),o=tIe(i);if(nIe(r)){if(o.length===0)continue;e.push({doc:r,features:o,doc_links:[]});continue}let a=n.includes(XRe)?[]:i.match(Tp("g"))??[],c=[...new Set([...a,...o])].sort(),l=new Set;for(let u of i.matchAll(QRe)){let d=oIe(r,u[1]);d&&l.add(d)}e.push({doc:r,features:c,doc_links:[...l].sort()})}return{docs:e}}function N5(t="."){let e=Rp(t);if(e.docs.length===0)return!1;let r=["# Cladding \xB7 Tier C \u2014 generated doc\u2192spec / doc\u2192doc link index (`clad sync`). Do not edit by hand.","# Source of truth is the docs themselves; DOC_LINK_INTEGRITY validates resolution.",'schema: "0.1"',"docs:"];for(let n of e.docs)n.features.length===0&&n.doc_links.length===0||(r.push(` ${JSON.stringify(n.doc)}:`),n.features.length>0&&r.push(` features: [${n.features.join(", ")}]`),n.doc_links.length>0&&r.push(` doc_links: [${n.doc_links.map(i=>JSON.stringify(i)).join(", ")}]`));return VRe(Op(t,"spec","_doc-links.yaml"),`${r.join(` `)} -`,"utf8"),!0}var YRe,XRe,QRe,eIe,eS=y(()=>{"use strict";lC();YRe=["docs/ab-evaluation","docs/ab-evaluation-extended","docs/dogfood","docs/benchmarks"],XRe="clad-doc-links: ignore",QRe=/\]\(\s*([^)\s]+?\.md)(?:#[^)]*)?\s*\)/g,eIe=/clad-doc-links:[ \t]*([^\n>]*)/g});import{existsSync as sIe}from"node:fs";import{join as aIe}from"node:path";function cIe(t){let{cwd:e="."}=t;return ge(e,tS,r=>lIe(r,e))}function lIe(t,e){let r=new Set((t.features??[]).map(i=>i.id)),n=[];for(let i of Rp(e).docs){for(let o of i.doc_links)sIe(aIe(e,o))||n.push({detector:tS,severity:"error",path:i.doc,message:`doc '${i.doc}' links to missing file '${o}'`});for(let o of i.features)r.has(o)||n.push({detector:tS,severity:"warn",path:i.doc,message:`doc '${i.doc}' references unknown feature '${o}' \u2014 archived/renamed? If it is an illustrative example, add a \`clad-doc-links: ignore\` marker to the doc.`})}return n}var tS,rS,uC=y(()=>{"use strict";eS();wt();tS="DOC_LINK_INTEGRITY";rS={name:tS,run:cIe}});function uIe(t){let{cwd:e="."}=t;return ge(e,Ip,r=>dIe(r))}function dIe(t){let e=[],r=t.features.length,n=t.scenarios??[],i=r>=j5,o=t.project.onboarding_seeded===!0&&!i;r>=j5&&n.length===0&&e.push({detector:Ip,severity:"warn",path:"spec/scenarios/",message:`${r} features but no scenarios declared \u2014 cross-feature user-journey flows are not captured. Author at least one with \`clad_create_scenario\`.`});for(let a of n)(a.features??[]).length===0&&e.push({detector:Ip,severity:o?"info":"warn",path:"spec/scenarios/",message:o?`scenario ${a.id} binds no features yet \u2014 retained as future onboarding intent; bind it when a matching feature lands.`:`scenario ${a.id} binds no features (features: []) \u2014 a scenario must cover at least one feature's flow, or it should be removed.`});let s=new Map(t.features.filter(a=>typeof a.slug=="string"&&a.slug.length>0).map(a=>[a.slug,a.id]));for(let a of n){if(!a.flow)continue;let c=new Set(a.features??[]),l=new Map;for(let u of a.flow.matchAll(/\(([^)]+)\)/g))for(let d of u[1].split(/[,/·]/)){let f=d.trim(),p=s.get(f);p&&!c.has(p)&&l.set(f,p)}if(l.size>0){let u=[...l].map(([d,f])=>`${d} (${f})`).join(", ");e.push({detector:Ip,severity:"warn",path:"spec/scenarios/",message:`scenario ${a.id} flow references ${u} but features[] does not bind ${l.size===1?"it":"them"} \u2014 bind every feature the flow walks, or trim the flow so coverage is not under-stated.`})}}return e}var Ip,j5,M5,F5=y(()=>{"use strict";wt();Ip="SCENARIO_COVERAGE",j5=8;M5={name:Ip,run:uIe}});import{createHash as fIe}from"node:crypto";function pIe(t){return!Number.isFinite(t)||t<=0?0:t>=1?1:t}function Pp(t,e=0){if(t.oracle_policy){let r=t.oracle_policy;return{mandateActive:!0,reportOnly:!1,exhaustive:!1,alwaysEars:new Set(r.always_ears??L5),sample:pIe(r.sample??0)}}return t.require_oracles===!0?{mandateActive:!0,reportOnly:!1,exhaustive:!0,alwaysEars:new Set,sample:1}:t.require_oracles===void 0&&e>=8?{mandateActive:!0,reportOnly:!0,exhaustive:!1,alwaysEars:new Set(L5),sample:0}:{mandateActive:!1,reportOnly:!1,exhaustive:!1,alwaysEars:new Set,sample:0}}function Cp(t){return(t.features??[]).filter(e=>e.status==="done").length}function mIe(t,e){return e<=0?!1:e>=1?!0:parseInt(fIe("sha256").update(t).digest("hex").slice(0,8),16)%1e40})}return r}var L5,nS=y(()=>{"use strict";L5=["unwanted"]});import{chmodSync as hIe,existsSync as U5,readFileSync as gIe,readdirSync as yIe,statSync as q5,unlinkSync as _Ie,utimesSync as bIe,writeFileSync as vIe}from"node:fs";import{join as B5}from"node:path";import H5 from"node:process";function SIe(t){return eJ(t).map(e=>{try{let r=q5(e);return r.isFile()?{path:e,body:gIe(e),mode:r.mode,atime:r.atime,mtime:r.mtime}:{path:e,nonFile:!0}}catch(r){if(r.code==="ENOENT")return{path:e};throw r}})}function wIe(t){let e=[];for(let r of t)if(!r.nonFile)try{if(r.body===void 0){if(!U5(r.path))continue;if(!q5(r.path).isFile()){e.push(`${r.path}: scoped oracle run created a non-file report candidate`);continue}_Ie(r.path);continue}vIe(r.path,r.body),r.mode!==void 0&&hIe(r.path,r.mode),r.atime&&r.mtime&&bIe(r.path,r.atime,r.mtime)}catch(n){e.push(`${r.path}: ${n.message}`)}return e}function xIe(t){let e=!1,r=n=>{for(let i of yIe(n,{withFileTypes:!0})){if(e)return;let o=B5(n,i.name);i.isDirectory()?r(o):(/\.(test|spec)\.[cm]?[jt]sx?$/.test(i.name)||/_test\.py$/.test(i.name))&&(e=!0)}};try{r(t)}catch{}return e}function dC(t={}){let{cwd:e="."}=t,r=B5(e,bs);if(!U5(r)||!xIe(r))return{stage:Ka,pass:!1,exitCode:2,stderr:`no spec-conformance oracles under ${bs}/ \u2014 skipped`};let n=dt(e),i=n.gates.test;if(!i?.cmd||!i.args)return{stage:Ka,pass:!1,exitCode:2,stderr:`no test runner registered for language '${n.language}'`};let o;try{o=SIe(e)}catch(d){return{stage:Ka,pass:!1,exitCode:1,stderr:`could not preserve the full test report before the scoped oracle run: ${d.message}`}}let s,a,c=[...i.args,bs];try{s=We(i.cmd,c,{cwd:e,reject:!1})}catch(d){a=d}let l=wIe(o);if(l.length>0)return{stage:Ka,pass:!1,exitCode:1,stderr:`could not restore the full test report after the scoped oracle run: ${l.join("; ")}`};if(a||!s)return{stage:Ka,pass:!1,exitCode:1,stderr:`oracle runner failed to start: ${a?.message??"unknown error"}`};let u=Nt(Ka,i.cmd,s,c);return u||Yt(Ka,s)}var Ka,bs,$Ie,fC=y(()=>{"use strict";Mr();sn();dp();Rn();Ka="stage_2.3",bs="tests/oracle";$Ie=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${H5.argv[1]}`;if($Ie){let t=dC();console.log(JSON.stringify(t)),H5.exit(t.exitCode)}});import{existsSync as kIe}from"node:fs";import{join as EIe}from"node:path";function AIe(t){let{cwd:e="."}=t;return ge(e,ii,r=>TIe(r,e))}function TIe(t,e){let r=[],n=Pp(t.project,Cp(t)),i=n.reportOnly?"info":"error",o=n.mandateActive?In(e):[],s=o.filter(l=>l.kind==="oracle"),a=new Set(["agent:developer","agent:specialists"]),c=l=>o.find(u=>u.featureId===l&&a.has(u.stage))?.identity.name;for(let l of t.features)if(l.status==="done")for(let u of l.acceptance_criteria??[]){let d=u.oracle_refs??[];if(Dp(n,l.id,u)&&d.length===0){let f=n.exhaustive?"project.require_oracles is set":u.ears&&n.alwaysEars.has(u.ears)?`oracle_policy.always_ears includes '${u.ears}'`:"selected by oracle_policy.sample";r.push({detector:ii,severity:i,message:`${l.id}.${u.id} done AC lacks a spec-conformance oracle (${f}; declare oracle_refs under ${bs}/)`+(n.reportOnly?" [report-only \u2014 the graduated default enforces in 0.7]":"")})}for(let f of d){if(!kIe(EIe(e,f))){r.push({detector:ii,severity:"error",path:f,message:`${l.id}.${u.id} oracle_ref '${f}' resolves to nothing on disk`});continue}if(f.startsWith(`${bs}/`)||r.push({detector:ii,severity:"warn",path:f,message:`${l.id}.${u.id} oracle_ref '${f}' lives outside ${bs}/ \u2014 stage_2.3 only runs ${bs}/, so this oracle will not execute`}),!n.mandateActive)continue;let p=s.find(g=>g.featureId===l.id&&g.acId===u.id&&g.artifact===f);if(!p){r.push({detector:ii,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' has no authoring-provenance record \u2014 author it via 'clad oracle' (or clad_author_oracle) so impl-blindness can be verified`});continue}let m=c(l.id);m&&p.identity.name===m?r.push({detector:ii,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' is NOT impl-blind: authored by the implementer ('${m}')`}):m||r.push({detector:ii,severity:"info",message:`${l.id}.${u.id} oracle author\u2260implementer not verified \u2014 no implementer identity recorded (no clad run history to compare)`});let h=(p.readManifest??[]).filter(g=>(l.modules??[]).includes(g));h.length>0&&r.push({detector:ii,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' is NOT impl-blind: author read implementation file(s) the feature owns (${h.join(", ")})`}),p.blind===!1&&r.push({detector:ii,severity:"info",message:`${l.id}.${u.id} oracle '${f}' provenance is self-reported (host-protocol), not cladding-controlled \u2014 manifest checked, blindness unproven`})}}if(n.mandateActive&&!n.exhaustive){let l=t.features.filter(u=>u.status==="done").flatMap(u=>u.acceptance_criteria??[]).filter(u=>!u.ears).length;l>0&&r.push({detector:ii,severity:"info",message:`${l} done AC(s) carry no EARS tag and are invisible to the risk-weighted oracle mandate \u2014 tag them (ubiquitous/event/state/optional/unwanted/complex) for the mandate to mean anything.`})}return r}var ii,G5,Z5=y(()=>{"use strict";ni();nS();fC();wt();ii="SPEC_CONFORMANCE";G5={name:ii,run:AIe}});function OIe(t){let{cwd:e="."}=t,r=In(e);if(r.length===0)return[{detector:pC,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=Date.now(),i=[];for(let o of r){let s=Date.parse(o.identity.timestamp);if(Number.isNaN(s))continue;let a=(n-s)/(1e3*60*60*24);a>V5&&i.push({detector:pC,severity:"warn",message:`evidence ${o.id} is ${Math.round(a)} days old (floor ${V5})`})}return i}var pC,V5,W5,K5=y(()=>{"use strict";ni();pC="STALE_EVIDENCE",V5=90;W5={name:pC,run:OIe}});import{existsSync as J5}from"node:fs";import{join as Y5}from"node:path";function RIe(t){let{cwd:e="."}=t;return ge(e,Wl,r=>IIe(r,e))}function IIe(t,e){let r=[];for(let n of t.features){if(n.archived_at&&n.status!=="archived"&&r.push({detector:Wl,severity:"warn",message:`feature ${n.id} has archived_at but status='${n.status}' (expected 'archived')`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:`archived_at already set but status is '${n.status}'`}}}),n.superseded_by&&!n.archived_at&&r.push({detector:Wl,severity:"warn",message:`feature ${n.id} has superseded_by but no archived_at`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:`superseded by ${n.superseded_by} but missing archived_at`}}}),n.status==="archived"){let i=(n.modules??[]).filter(o=>J5(Y5(e,o)));i.length>0&&r.push({detector:Wl,severity:"warn",message:`feature ${n.id} is archived but ${i.length} module(s) still exist: ${i.join(", ")}`})}Vl(n.status)&&(n.modules?.length??0)>0&&!(n.modules??[]).some(i=>J5(Y5(e,i)))&&r.push({detector:Wl,severity:"info",message:`feature ${n.id} (status='${n.status}') declares ${n.modules?.length??0} module(s) that aren't built yet \u2014 the normal state while implementing (not stale)`})}return r}var Wl,iS,mC=y(()=>{"use strict";Wv();wt();Wl="STALE_SPECIFICATION";iS={name:Wl,run:RIe}});import{existsSync as X5,statSync as Q5}from"node:fs";import{join as eY}from"node:path";function CIe(t,e){let r=0;for(let n of e){let i=eY(t,n);if(!X5(i))continue;let o=Q5(i).mtimeMs;o>r&&(r=o)}return r}function DIe(t){let{cwd:e="."}=t;return ge(e,hC,r=>NIe(r,e))}function NIe(t,e){let r=Fi(e,t.project?.language),n=t.features.flatMap(a=>a.modules??[]),i=CIe(e,n);if(i===0)return[];let o=ys([...r.testGlobs],{cwd:e,dot:!1});if(o.length===0)return[];let s=[];for(let a of o){let c=eY(e,a);if(!X5(c))continue;let l=Q5(c).mtimeMs,u=(i-l)/(1e3*60*60*24);u>PIe&&s.push({detector:hC,severity:"warn",path:a,message:`${a} is ${Math.round(u)} days older than newest source module`})}return s}var hC,PIe,oS,gC=y(()=>{"use strict";vp();Ba();wt();hC="STALE_TESTS",PIe=30;oS={name:hC,run:DIe}});import{existsSync as jIe}from"node:fs";import{join as MIe}from"node:path";function FIe(t){let{cwd:e="."}=t;return ge(e,Np,r=>LIe(r,e))}function LIe(t,e){let r=[];for(let n of t.features){let i=n.modules??[],o=n.acceptance_criteria??[];if(n.status==="done"&&i.length===0&&o.length===0){r.push({detector:Np,severity:"error",message:`feature ${n.id} status='done' but declares no modules and no acceptance_criteria \u2014 nothing to verify (hollow completion)`});continue}if(i.length===0)continue;let s=i.filter(a=>!jIe(MIe(e,a)));s.length!==0&&(n.status==="done"?r.push({detector:Np,severity:"error",message:`feature ${n.id} status='done' but ${s.length}/${i.length} module(s) missing: ${s.join(", ")}`}):n.status==="in_progress"&&s.length===i.length&&r.push({detector:Np,severity:Vl(n.status)?"info":"warn",message:`feature ${n.id} is in progress and none of its declared modules are built yet \u2014 the normal state while implementing`}))}return r}var Np,sS,yC=y(()=>{"use strict";Wv();wt();Np="STATUS_DRIFT";sS={name:Np,run:FIe}});function zIe(t){let{cwd:e="."}=t;return ge(e,aS,r=>UIe(r,e))}function UIe(t,e){let r=dt(e).language;return r==="unknown"?[{detector:aS,severity:"info",message:"no manifest matched \u2014 language cannot be cross-checked"}]:t.project.language===r?[]:[{detector:aS,severity:"warn",message:`spec.project.language='${t.project.language}' but the manifest chain detects '${r}'`}]}var aS,tY,rY=y(()=>{"use strict";sn();wt();aS="TECH_STACK_MISMATCH";tY={name:aS,run:zIe}});function GIe(t){if((t.features??[]).length`${i}/${o}/**/*.${n}`)}function ZIe(t){let{cwd:e="."}=t;return ge(e,_C,r=>VIe(r,e))}function VIe(t,e){let r=new Set;for(let o of t.features)for(let s of o.modules??[])r.add(s);let n=ys([...GIe(t)],{cwd:e,dot:!1}),i=[];for(let o of n)r.has(o)||i.push({detector:_C,severity:"error",path:o,message:`file '${o}' is not claimed by any feature in spec.yaml`});return i}var _C,nY,qIe,BIe,HIe,cS,bC=y(()=>{"use strict";vp();BP();wt();_C="UNMAPPED_ARTIFACT",nY=["src/stages/**/*.ts","src/spec/**/*.ts"],qIe={typescript:"ts",javascript:"js",python:"py",rust:"rs",go:"go",kotlin:"kt"},BIe={kotlin:"src/main/kotlin"},HIe=8;cS={name:_C,run:ZIe}});import{existsSync as iY}from"node:fs";import{join as oY}from"node:path";function KIe(t){return WIe.some(e=>t.startsWith(e))}function JIe(t){let{cwd:e="."}=t;return ge(e,vC,r=>YIe(r,e))}function YIe(t,e){let r=[];for(let n of t.features)if(n.status==="done")for(let i of n.acceptance_criteria??[])for(let o of i.test_refs??[]){if(KIe(o))continue;let s=o.split("#",1)[0];iY(oY(e,o))||s&&iY(oY(e,s))||r.push({detector:vC,severity:"error",path:o,message:`${n.id}.${i.id} test_ref '${o}' resolves to nothing on disk \u2014 a test_ref must be a real file path (e.g. 'tests/x.test.ts', optionally with a '#' anchor) or a 'self-dogfood: `),r.add(d),u.on("close",()=>r.delete(d));return}if(f==="/"||f==="/index.html"){let m=jx(n());d.writeHead(200,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),d.end(m);return}d.writeHead(404,{"Content-Type":"text/plain"}),d.end("not found")}catch(m){if(d.headersSent)try{d.end()}catch{}else{d.writeHead(503,{"Content-Type":"application/json","Cache-Control":"no-store"});try{d.end(JSON.stringify({error:m.message}))}catch{}}}}),s=null,a=()=>{s&&clearTimeout(s),s=setTimeout(i,400)},c=[];for(let u of["spec","docs"]){let d=XUe(e,u);if(JUe(d))try{let f=YUe(d,{recursive:!0},a);f.on("error",()=>{try{f.close()}catch{}}),c.push(f)}catch{}}let l=setInterval(()=>{for(let u of r)try{u.write(`: keep-alive -`)}catch{r.delete(u)}},3e4);return typeof l.unref=="function"&&l.unref(),new Promise((u,d)=>{o.on("error",d),o.listen(t.port??0,"127.0.0.1",()=>{let f=o.address(),p=typeof f=="object"&&f?f.port:t.port??0;u({port:p,broadcast:i,close:()=>new Promise(m=>{s&&clearTimeout(s),clearInterval(l);for(let h of c)try{h.close()}catch{}for(let h of r)try{h.end()}catch{}r.clear(),o.close(()=>m()),typeof o.closeAllConnections=="function"&&o.closeAllConnections()})})})})}async function lte(t={}){let e=t.port!==void 0?Number(t.port):3e3;try{let r=await QUe({port:e,cwd:t.cwd??"."});L("pass","graph",`live graph at http://localhost:${r.port} \u2014 edit spec/ or docs/ and the view auto-reloads (Ctrl-C to stop)`)}catch(r){L("fail","graph",r.message),process.exit(1)}}var eqe=["stage_1.1","stage_2.1","stage_2.3"];function tqe(t){return(t.features??[]).filter(e=>e.status==="done")}function rqe(t,e){let r=tqe(t);switch(e){case"stage_1.1":return!t.project?.language||r.length===0?null:`project.language is '${t.project.language}' and ${r.length} feature(s) are done, but the type checker did not run (skipped) \u2014 type safety of shipped code was never verified. Install the language toolchain; under --strict, an unverifiable 'done' is not GREEN.`;case"stage_2.1":{let n=r.filter(i=>(i.acceptance_criteria??[]).some(o=>(o.test_refs??[]).length>0)).length;return n===0?null:`${n} done feature(s) declare tests but the test runner did not run (skipped) \u2014 the implementation was never verified. Install the test framework; under --strict, an unverifiable 'done' is not GREEN.`}case"stage_2.3":{let n=r.flatMap(i=>i.acceptance_criteria??[]).filter(i=>(i.oracle_refs??[]).length>0).length;return n===0?null:`${n} done AC(s) declare oracle_refs but the conformance runner did not run (skipped) \u2014 the declared oracles never executed. Under --strict, declared-but-unrun verification is not GREEN.`}}}function ute(t,e){let r=[];for(let n of eqe){if(!e.some(s=>s.stage===n&&s.status==="skip"))continue;let o=rqe(t,n);o&&r.push({stage:n,label:"Verification",message:o})}return r}SS();import dte from"node:process";function nqe(t,e){let r=e.filter(i=>i.acId===t),n=r.filter(i=>i.identity.author==="human");return n.length===0?{acId:t,pass:!1,totalEvidence:r.length,humanEvidence:0,reason:r.length===0?"no evidence at all":`${r.length} tool/LLM evidence but 0 human \u2014 anti-self-cert guard blocks`}:{acId:t,pass:!0,totalEvidence:r.length,humanEvidence:n.length}}function Lx(t){let e=new Set;for(let n of t)n.acId&&e.add(n.acId);let r=[];for(let n of e){let i=nqe(n,t);i.pass||r.push(i)}return r}ni();var Rj="stage_4.1";function Ij(t={}){let{cwd:e="."}=t,r=In(e);if(r.length===0)return{stage:Rj,pass:!1,exitCode:2,stderr:"no audit log present \u2014 record evidence before running stage_4.1"};let n=Lx(r);if(n.length===0)return{stage:Rj,pass:!0,exitCode:0};let i=n.map(o=>`${o.acId}: ${o.reason}`).join("; ");return{stage:Rj,pass:!1,exitCode:1,stderr:`anti-self-cert guard: ${i}`}}var iqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${dte.argv[1]}`;if(iqe){let t=Ij();console.log(JSON.stringify(t)),dte.exit(t.exitCode)}vl();import{randomBytes as oqe}from"node:crypto";import{unlinkSync as sqe}from"node:fs";import{tmpdir as aqe}from"node:os";import{join as cqe,resolve as Pj}from"node:path";import lqe from"node:process";var qr=null;function fte(t){qr={cwd:Pj(t),run:null,jsonFile:null}}function Cj(){return qr!==null}function Dj(t,e){if(!qr||qr.cwd!==Pj(t))return null;if(qr.run)return qr.run;let r=cqe(aqe(),`clad-shared-vitest-${lqe.pid}-${oqe(6).toString("hex")}.json`);qr.jsonFile=r;let n=e(r);return qr.run={proc:n,jsonFile:r},qr.run}function pte(t){return!qr||qr.cwd!==Pj(t)?null:qr.run}function Nj(t){return t.pass&&t.exitCode===0?"reuse-pass":"fallback"}function mte(){let t=qr?.jsonFile;if(qr=null,t)try{sqe(t)}catch{}}Mr();import hte from"node:process";var zx="stage_1.4";function jj(t={}){let{cwd:e="."}=t,r;try{r=We("git",["status","--porcelain"],{cwd:e,reject:!1})}catch(i){if(i.code==="ENOENT")return{stage:zx,pass:!1,exitCode:2,stderr:"git binary not found"};throw i}if(r.exitCode!==0){let i=(r.stderr??"").toString().trim()||"not a git repository";return{stage:zx,pass:!1,exitCode:2,stderr:i}}let n=(r.stdout??"").toString().trim();return n.length===0?{stage:zx,pass:!0,exitCode:0}:{stage:zx,pass:!1,exitCode:1,stderr:`working tree dirty: -${n}`}}var uqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${hte.argv[1]}`;if(uqe){let t=jj();console.log(JSON.stringify(t)),hte.exit(t.exitCode)}Mr();import gte from"node:process";Jm();Rn();var Ux="stage_2.2";function Mj(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=Yi("coverage",t))}catch(c){return{stage:Ux,pass:!1,exitCode:1,stderr:c.message}}if(!r||!n)return{stage:Ux,pass:!1,exitCode:2,stderr:`no coverage runner registered for language '${i}'`};let o=pte(e),s=o?o.proc:We(r,[...n],{cwd:e,reject:!1}),a=Nt(Ux,r,s,n);return a||Yt(Ux,s)}var pqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${gte.argv[1]}`;if(pqe){let t=Mj();console.log(JSON.stringify(t)),gte.exit(t.exitCode)}Mp();Fj();Mr();sn();Rn();import _te from"node:process";var Hx="stage_3.2";function Lj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.perf,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Hx,pass:!1,exitCode:2,stderr:`no perf runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!ql(e,o[o.length-1]))return{stage:Hx,pass:!1,exitCode:2,stderr:"perf npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Hx,i,s,o);return a||Yt(Hx,s)}var Cqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${_te.argv[1]}`;if(Cqe){let t=Lj();console.log(JSON.stringify(t)),_te.exit(t.exitCode)}Mr();Ue();Rn();import{existsSync as Dqe}from"node:fs";import{resolve as vte}from"node:path";import Ste from"node:process";var di="stage_2.4",zj=5e3,Nqe=3e4;function Uj(t={}){let{cwd:e="."}=t,r,n=[],i=!1,o=new Map;try{let p=B(e);r=p.project.deliverable,n=p.project.smoke??[],i=p.features.some(m=>m.status==="done"),o=new Map(p.features.map(m=>[m.id,m.status]))}catch{return{stage:di,pass:!1,exitCode:2,stderr:"spec.yaml not loaded \u2014 deliverable smoke skipped"}}if(n.length>0)return Mqe(e,n,{anyDone:i,featureStatus:o});if(!r)return{stage:di,pass:!1,exitCode:2,stderr:"no project.deliverable declared \u2014 skipped"};if(r.is_safe_to_smoke!==!0)return{stage:di,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not marked is_safe_to_smoke \u2014 skipped`};if(!i)return{stage:di,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 deliverable smoke skipped"};let s=vte(e,r.path);if(!Dqe(s))return{stage:di,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not found \u2014 see DELIVERABLE_INTEGRITY`};let a=r.timeout_ms??zj,c;try{c=We(s,[...r.smoke_args??[]],{cwd:e,reject:!1,timeout:a})}catch(p){c=p}let l=Nt(di,r.path,c);if(l)return l;if(c.timedOut)return{stage:di,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' timed out after ${a}ms (hung or too slow)`};let u=r.expect_exit??0,d=c.exitCode??1;if(d===u)return{stage:di,pass:!0,exitCode:0,disposition:"liveness"};let f=String(c.stderr??"").trim()||String(c.stdout??"").trim();return{stage:di,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' exited ${d}, expected ${u}${f?` \u2014 ${f.slice(0,200)}`:""}`}}var bte={fail:5,advisory:4,pending_env:4,liveness:3,pass:2,na:1,skip:0},jqe={pass:"\u2713",fail:"\u2717",liveness:"liveness",na:"na",pending_env:"pending_env",advisory:"advisory",skip:"skip"};function Mqe(t,e,r){let n=Math.min(e.length*zj,Nqe),i=Date.now(),o=[];for(let s of e){if(Date.now()-i>=n){o.push({argv:(s.run??[]).join(" ")||"(none)",kind:s.kind,disposition:"pending_env",detail:"stage time ceiling \u2014 not started",feature:s.feature,why:s.why});continue}o.push(Fqe(t,s,r))}return Lqe(o)}function Fqe(t,e,r){let n=(e.run??[]).join(" ")||"(none)",i=e.why;if(e.kind==="none")return{argv:"(kind:none)",kind:"none",disposition:"na",detail:"nothing to run (library/static)",why:i};let o=e.feature;if(o!==void 0){let h=r.featureStatus.get(o);if(h!=="done"){let g=h===void 0?`bound feature ${o} not found in spec \u2014 not executed`:`bound feature ${o} is ${h}, not done \u2014 not executed`;return{argv:n,kind:"cli",disposition:"na",detail:g,feature:o,why:i}}}else if(!r.anyDone)return{argv:n,kind:"cli",disposition:"skip",detail:"no done feature yet \u2014 smoke probe skipped",why:i};let s=e.run??[];if(s.length===0)return{argv:"(none)",kind:"cli",disposition:"skip",detail:"cli smoke probe has no run argv \u2014 skipped",feature:o,why:i};let[a,...c]=s,l=a.startsWith(".")||a.startsWith("/")?vte(t,a):a,u=zj,d;try{d=We(l,[...c],{cwd:t,reject:!1,timeout:u})}catch(h){d=h}if(za(d))return{argv:n,kind:"cli",disposition:"skip",detail:`'${a}' not installed`,feature:o,why:i};if(d.timedOut)return{argv:n,kind:"cli",disposition:"fail",detail:`timed out after ${u}ms`,feature:o,why:i};let f=e.expect?.exit??0,p=d.exitCode??1;if(p!==f){let h=String(d.stderr??"").trim()||String(d.stdout??"").trim();return{argv:n,kind:"cli",disposition:"fail",detail:`exited ${p}, expected ${f}${h?` \u2014 ${h.slice(0,200)}`:""}`,feature:o,why:i}}let m=e.expect?.token;return m?String(d.stdout??"").includes(m)?{argv:n,kind:"cli",disposition:"pass",detail:`ran clean (exit ${p}), stdout contains ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"fail",detail:`ran (exit ${p}) but stdout did not contain the AC token ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"liveness",detail:`ran clean (exit ${p}), no token declared \u2014 exit-only`,feature:o,why:i}}function Lqe(t){let e="skip";for(let o of t)bte[o.disposition]>bte[e]&&(e=o.disposition);let r=t.map(o=>{let s=o.why?` \xB7 ${o.why}`:"";return`${jqe[o.disposition]} ${o.argv} \xB7 ${o.detail}${s}`}).join(` -`),n=t.map((o,s)=>({id:`probe_${s+1}`,kind:o.kind,disposition:o.disposition==="skip"?"na":o.disposition,bindsFeature:o.feature,why:o.why,detail:o.detail}));if(e==="skip")return{stage:di,pass:!1,exitCode:2,stderr:r,probes:n};let i=e==="fail"||e==="pending_env"||e==="advisory";return{stage:di,pass:!i,exitCode:i?1:0,disposition:e,stderr:r,probes:n}}var zqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Ste.argv[1]}`;if(zqe){let t=Uj();console.log(JSON.stringify(t)),Ste.exit(t.exitCode)}Mr();sn();Rn();import wte from"node:process";var Gx="stage_3.1";function qj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.smoke,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Gx,pass:!1,exitCode:2,stderr:`no smoke runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!ql(e,o[o.length-1]))return{stage:Gx,pass:!1,exitCode:2,stderr:"smoke npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Gx,i,s,o);return a||Yt(Gx,s)}var Uqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${wte.argv[1]}`;if(Uqe){let t=qj();console.log(JSON.stringify(t)),wte.exit(t.exitCode)}fC();Bj();Hj();Mr();qx();import{randomBytes as Wqe}from"node:crypto";import{unlinkSync as Kqe}from"node:fs";import{tmpdir as Jqe}from"node:os";import{join as Yqe}from"node:path";import Zj from"node:process";Jm();Rn();Ue();import{readFileSync as Hqe}from"node:fs";import{resolve as kte}from"node:path";function Gqe(t){let e=t.trim();if(!e.startsWith("{"))return null;let r;try{r=JSON.parse(e)}catch{return null}let n=r.testResults;if(!Array.isArray(n))return null;let i=new Map;for(let o of n){if(typeof o.name!="string"||!o.name)continue;let s=kte(o.name),a=i.get(s)??0;for(let c of o.assertionResults??[])c.status==="passed"&&(a+=1);i.set(s,a)}return i}function Zqe(t){let e=t.indexOf("#");return(e===-1?t:t.slice(0,e)).trim()}function Vqe(t,e,r){let n=[];for(let i of t.features??[]){if(i.status!=="done")continue;let o=[],s=new Set;for(let u of i.acceptance_criteria??[])for(let d of u.test_refs??[]){let f=Zqe(d);f&&!s.has(f)&&(s.add(f),o.push(f))}if(o.length===0)continue;let a=!0,c=!1;for(let u of o){let d=e.get(kte(r,u));if(d===void 0){a=!1;break}if(d>0){c=!0;break}}if(c||!a)continue;let l=i.title||i.id;n.push({detector:"VACUOUS_TESTS",severity:"warn",path:o[0],message:`Done feature "${l}" declares tests, but none of its test files executed a passing test (all skipped / todo / empty) \u2014 its behavioral proof never actually ran`})}return n}function Gj(t,e){try{let r=Gqe(Hqe(t,"utf8"));return r?Vqe(B(e),r,e):[]}catch{return[]}}var Br="stage_2.1";function Ete(t,e){return t==="vitest"||t.endsWith("/vitest")||e.includes("vitest")}function Ate(t,e){return[t,...e].some(r=>r==="pytest"||r.endsWith("/pytest"))}function Tte(t){let e=`${String(t.stdout??"")} -${String(t.stderr??"")}`,r=[],n=[/^\s*#\s*tests\s+(\d+)\s*$/gim,/^\s*ℹ\s+tests\s+(\d+)\s*$/gim,/^\s*Tests:\s+.*?\b(\d+)\s+total\b.*$/gim,/^\s*collected\s+(\d+)\s+items?\b.*$/gim];for(let i of n)for(let o of e.matchAll(i))r.push(Number(o[1]));return r.length>0&&r.every(i=>i===0)}function Xqe(t,e,r){let n,i;try{({cmd:n,args:i}=Yi("coverage",t))}catch{return null}if(!n||!i||!Ete(n,i))return null;let o=n,s=i,a=Dj(e,d=>We(o,[...s,"--reporter=default","--reporter=json",`--outputFile=${d}`],{cwd:e,reject:!1}));if(!a)return null;let{proc:c,jsonFile:l}=a;if(Nt(Br,n,c,s))return null;let u=Yt(Br,c);if(Nj(u)==="fallback")return null;if(r){let d=Gj(l,e);if(d.length>0)return{stage:Br,pass:!1,exitCode:1,findings:d,stderr:d[0].message}}return{stage:Br,pass:!0,exitCode:0}}function Qqe(t,e){let{strict:r=!1}=t,n,i;try{({cmd:n,args:i}=Yi("coverage",t))}catch{return null}if(!n||!i||!Ate(n,i))return null;let o=n,s=i,a=Dj(e,()=>We(o,[...s],{cwd:e,reject:!1}));if(!a||Nt(Br,o,a.proc,s))return null;let c=Yt(Br,a.proc);if(Nj(c)==="fallback")return null;if(r&&Tte(a.proc)){let l={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Br,pass:!1,exitCode:1,findings:[l],stderr:l.message}}return{stage:Br,pass:!0,exitCode:0}}function Vj(t={}){let{cwd:e=".",strict:r=!1}=t,n,i,o;try{({cmd:n,args:i,language:o}=Yi("test",t))}catch(d){return{stage:Br,pass:!1,exitCode:1,stderr:d.message}}if(!n||!i)return{stage:Br,pass:!1,exitCode:2,stderr:`no unit test runner registered for language '${o}'`};let s=Ete(n,i),a=Ate(n,i),c=r&&s;if(Cj()&&s){let d=Xqe(t,e,c);if(d)return d}if(Cj()&&a){let d=Qqe(t,e);if(d)return d}let l,u=i;c&&(l=Yqe(Jqe(),`clad-vitest-${Zj.pid}-${Wqe(6).toString("hex")}.json`),u=[...i,"--reporter=default","--reporter=json",`--outputFile=${l}`]);try{let d=We(n,[...u],{cwd:e,reject:!1}),f=Nt(Br,n,d,u);if(f)return f;let p=Ru("unit",Yt(Br,d),d);if(r&&p.pass&&Tte(d)){let m={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Br,pass:!1,exitCode:1,findings:[m],stderr:m.message}}if(c&&p.pass&&l){let m=Gj(l,e);if(m.length>0)return{stage:Br,pass:!1,exitCode:1,findings:m,stderr:m[0].message}}return p}finally{if(l)try{Kqe(l)}catch{}}}var e4e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Zj.argv[1]}`;if(e4e){let t=Vj();console.log(JSON.stringify(t)),Zj.exit(t.exitCode)}Mr();sn();Rn();import Ote from"node:process";var Wx="stage_3.3";function Wj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.visual,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Wx,pass:!1,exitCode:2,stderr:`no visual runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!ql(e,o[o.length-1]))return{stage:Wx,pass:!1,exitCode:2,stderr:"visual npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Wx,i,s,o);return a||Yt(Wx,s)}var t4e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Ote.argv[1]}`;if(t4e){let t=Wj();console.log(JSON.stringify(t)),Ote.exit(t.exitCode)}mC();jf();_a();Jj();kp();eS();var jte=St(er(),1);import{existsSync as Yj,readFileSync as f4e,readdirSync as Nte,statSync as p4e,writeFileSync as m4e}from"node:fs";import{basename as th,join as rh,relative as Dte}from"node:path";var h4e=["self-dogfood:","fixture:","derived:"],Mte=/\.(test|spec)\.[jt]sx?$/;function Fte(t,e=t,r=[]){let n;try{n=Nte(e)}catch{return r}for(let i of n){if(i.startsWith("."))continue;let o=rh(e,i);try{p4e(o).isDirectory()?Fte(t,o,r):Mte.test(i)&&r.push(o)}catch{continue}}return r}function Lte(t="."){let e=rh(t,"spec","features"),r=rh(t,"tests"),n=[],i=[];if(!Yj(e)||!Yj(r))return{repaired:n,suggested:i};let o=Fte(r),s=new Map;for(let a of o){let c=Dte(t,a).split("\\").join("/"),l=s.get(th(a))??[];l.push(c),s.set(th(a),l)}for(let a of Nte(e)){if(!a.endsWith(".yaml")&&!a.endsWith(".yml"))continue;let c=rh(e,a),l,u;try{l=f4e(c,"utf8"),u=(0,jte.parse)(l)}catch{continue}if(!u||u.status!=="done")continue;let d=!1;for(let h of u.acceptance_criteria??[])for(let g of h.test_refs??[]){if(h4e.some(x=>g.startsWith(x)))continue;let b=g.split("#",1)[0];if(Yj(rh(t,b)))continue;let _=s.get(th(b))??[];if(_.length!==1)continue;let S=g.replace(b,_[0]);S!==g&&l.includes(g)&&(l=l.split(g).join(S),n.push({shard:a,from:g,to:S}),d=!0)}let f=u.slug??"",p=(u.modules??[]).map(h=>th(h).replace(/\.[jt]sx?$/,"")),m=o.map(h=>Dte(t,h).split("\\").join("/")).find(h=>{let g=th(h).replace(Mte,"");return f!==""&&g===f||p.includes(g)});if(m)for(let h of u.acceptance_criteria??[]){if((h.test_refs?.length??0)>0||(h.evidence_refs?.length??0)>0||!h.id)continue;let g=new RegExp(`^(([ ]+)- id: ${h.id}\\b.*)$`,"m"),b=l.match(g);if(!b)continue;let _=b[2]+" ";l=l.replace(g,`$1 +`)}catch{r.delete(u)}},3e4);return typeof l.unref=="function"&&l.unref(),new Promise((u,d)=>{o.on("error",d),o.listen(t.port??0,"127.0.0.1",()=>{let f=o.address(),p=typeof f=="object"&&f?f.port:t.port??0;u({port:p,broadcast:i,close:()=>new Promise(m=>{s&&clearTimeout(s),clearInterval(l);for(let h of c)try{h.close()}catch{}for(let h of r)try{h.end()}catch{}r.clear(),o.close(()=>m()),typeof o.closeAllConnections=="function"&&o.closeAllConnections()})})})})}async function lte(t={}){let e=t.port!==void 0?Number(t.port):3e3;try{let r=await QUe({port:e,cwd:t.cwd??"."});L("pass","graph",`live graph at http://localhost:${r.port} \u2014 edit spec/ or docs/ and the view auto-reloads (Ctrl-C to stop)`)}catch(r){L("fail","graph",r.message),process.exit(1)}}var eqe=["stage_1.1","stage_2.1","stage_2.3"];function tqe(t){return(t.features??[]).filter(e=>e.status==="done")}function rqe(t,e){let r=tqe(t);switch(e){case"stage_1.1":return!t.project?.language||r.length===0?null:`project.language is '${t.project.language}' and ${r.length} feature(s) are done, but the type checker did not run (skipped) \u2014 type safety of shipped code was never verified. Install the language toolchain; under --strict, an unverifiable 'done' is not GREEN.`;case"stage_2.1":{let n=r.filter(i=>(i.acceptance_criteria??[]).some(o=>(o.test_refs??[]).length>0)).length;return n===0?null:`${n} done feature(s) declare tests but the test runner did not run (skipped) \u2014 the implementation was never verified. Install the test framework; under --strict, an unverifiable 'done' is not GREEN.`}case"stage_2.3":{let n=r.flatMap(i=>i.acceptance_criteria??[]).filter(i=>(i.oracle_refs??[]).length>0).length;return n===0?null:`${n} done AC(s) declare oracle_refs but the conformance runner did not run (skipped) \u2014 the declared oracles never executed. Under --strict, declared-but-unrun verification is not GREEN.`}}}function ute(t,e){let r=[];for(let n of eqe){if(!e.some(s=>s.stage===n&&s.status==="skip"))continue;let o=rqe(t,n);o&&r.push({stage:n,label:"Verification",message:o})}return r}SS();import dte from"node:process";function nqe(t,e){let r=e.filter(i=>i.acId===t),n=r.filter(i=>i.identity.author==="human");return n.length===0?{acId:t,pass:!1,totalEvidence:r.length,humanEvidence:0,reason:r.length===0?"no evidence at all":`${r.length} tool/LLM evidence but 0 human \u2014 anti-self-cert guard blocks`}:{acId:t,pass:!0,totalEvidence:r.length,humanEvidence:n.length}}function Lx(t){let e=new Set;for(let n of t)n.acId&&e.add(n.acId);let r=[];for(let n of e){let i=nqe(n,t);i.pass||r.push(i)}return r}ni();var Rj="stage_4.1";function Ij(t={}){let{cwd:e="."}=t,r=In(e);if(r.length===0)return{stage:Rj,pass:!1,exitCode:2,stderr:"no audit log present \u2014 record evidence before running stage_4.1"};let n=Lx(r);if(n.length===0)return{stage:Rj,pass:!0,exitCode:0};let i=n.map(o=>`${o.acId}: ${o.reason}`).join("; ");return{stage:Rj,pass:!1,exitCode:1,stderr:`anti-self-cert guard: ${i}`}}var iqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${dte.argv[1]}`;if(iqe){let t=Ij();console.log(JSON.stringify(t)),dte.exit(t.exitCode)}Sl();import{randomBytes as oqe}from"node:crypto";import{unlinkSync as sqe}from"node:fs";import{tmpdir as aqe}from"node:os";import{join as cqe,resolve as Pj}from"node:path";import lqe from"node:process";var qr=null;function fte(t){qr={cwd:Pj(t),run:null,jsonFile:null}}function Cj(){return qr!==null}function Dj(t,e){if(!qr||qr.cwd!==Pj(t))return null;if(qr.run)return qr.run;let r=cqe(aqe(),`clad-shared-vitest-${lqe.pid}-${oqe(6).toString("hex")}.json`);qr.jsonFile=r;let n=e(r);return qr.run={proc:n,jsonFile:r},qr.run}function pte(t){return!qr||qr.cwd!==Pj(t)?null:qr.run}function Nj(t){return t.pass&&t.exitCode===0?"reuse-pass":"fallback"}function mte(){let t=qr?.jsonFile;if(qr=null,t)try{sqe(t)}catch{}}Mr();import hte from"node:process";var zx="stage_1.4";function jj(t={}){let{cwd:e="."}=t,r;try{r=We("git",["status","--porcelain"],{cwd:e,reject:!1})}catch(i){if(i.code==="ENOENT")return{stage:zx,pass:!1,exitCode:2,stderr:"git binary not found"};throw i}if(r.exitCode!==0){let i=(r.stderr??"").toString().trim()||"not a git repository";return{stage:zx,pass:!1,exitCode:2,stderr:i}}let n=(r.stdout??"").toString().trim();return n.length===0?{stage:zx,pass:!0,exitCode:0}:{stage:zx,pass:!1,exitCode:1,stderr:`working tree dirty: +${n}`}}var uqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${hte.argv[1]}`;if(uqe){let t=jj();console.log(JSON.stringify(t)),hte.exit(t.exitCode)}Mr();import gte from"node:process";Jm();Rn();var Ux="stage_2.2";function Mj(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=Yi("coverage",t))}catch(c){return{stage:Ux,pass:!1,exitCode:1,stderr:c.message}}if(!r||!n)return{stage:Ux,pass:!1,exitCode:2,stderr:`no coverage runner registered for language '${i}'`};let o=pte(e),s=o?o.proc:We(r,[...n],{cwd:e,reject:!1}),a=Nt(Ux,r,s,n);return a||Yt(Ux,s)}var pqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${gte.argv[1]}`;if(pqe){let t=Mj();console.log(JSON.stringify(t)),gte.exit(t.exitCode)}Mp();Fj();Mr();sn();Rn();import _te from"node:process";var Hx="stage_3.2";function Lj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.perf,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Hx,pass:!1,exitCode:2,stderr:`no perf runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bl(e,o[o.length-1]))return{stage:Hx,pass:!1,exitCode:2,stderr:"perf npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Hx,i,s,o);return a||Yt(Hx,s)}var Cqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${_te.argv[1]}`;if(Cqe){let t=Lj();console.log(JSON.stringify(t)),_te.exit(t.exitCode)}Mr();Ue();Rn();import{existsSync as Dqe}from"node:fs";import{resolve as vte}from"node:path";import Ste from"node:process";var di="stage_2.4",zj=5e3,Nqe=3e4;function Uj(t={}){let{cwd:e="."}=t,r,n=[],i=!1,o=new Map;try{let p=B(e);r=p.project.deliverable,n=p.project.smoke??[],i=p.features.some(m=>m.status==="done"),o=new Map(p.features.map(m=>[m.id,m.status]))}catch{return{stage:di,pass:!1,exitCode:2,stderr:"spec.yaml not loaded \u2014 deliverable smoke skipped"}}if(n.length>0)return Mqe(e,n,{anyDone:i,featureStatus:o});if(!r)return{stage:di,pass:!1,exitCode:2,stderr:"no project.deliverable declared \u2014 skipped"};if(r.is_safe_to_smoke!==!0)return{stage:di,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not marked is_safe_to_smoke \u2014 skipped`};if(!i)return{stage:di,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 deliverable smoke skipped"};let s=vte(e,r.path);if(!Dqe(s))return{stage:di,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not found \u2014 see DELIVERABLE_INTEGRITY`};let a=r.timeout_ms??zj,c;try{c=We(s,[...r.smoke_args??[]],{cwd:e,reject:!1,timeout:a})}catch(p){c=p}let l=Nt(di,r.path,c);if(l)return l;if(c.timedOut)return{stage:di,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' timed out after ${a}ms (hung or too slow)`};let u=r.expect_exit??0,d=c.exitCode??1;if(d===u)return{stage:di,pass:!0,exitCode:0,disposition:"liveness"};let f=String(c.stderr??"").trim()||String(c.stdout??"").trim();return{stage:di,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' exited ${d}, expected ${u}${f?` \u2014 ${f.slice(0,200)}`:""}`}}var bte={fail:5,advisory:4,pending_env:4,liveness:3,pass:2,na:1,skip:0},jqe={pass:"\u2713",fail:"\u2717",liveness:"liveness",na:"na",pending_env:"pending_env",advisory:"advisory",skip:"skip"};function Mqe(t,e,r){let n=Math.min(e.length*zj,Nqe),i=Date.now(),o=[];for(let s of e){if(Date.now()-i>=n){o.push({argv:(s.run??[]).join(" ")||"(none)",kind:s.kind,disposition:"pending_env",detail:"stage time ceiling \u2014 not started",feature:s.feature,why:s.why});continue}o.push(Fqe(t,s,r))}return Lqe(o)}function Fqe(t,e,r){let n=(e.run??[]).join(" ")||"(none)",i=e.why;if(e.kind==="none")return{argv:"(kind:none)",kind:"none",disposition:"na",detail:"nothing to run (library/static)",why:i};let o=e.feature;if(o!==void 0){let h=r.featureStatus.get(o);if(h!=="done"){let g=h===void 0?`bound feature ${o} not found in spec \u2014 not executed`:`bound feature ${o} is ${h}, not done \u2014 not executed`;return{argv:n,kind:"cli",disposition:"na",detail:g,feature:o,why:i}}}else if(!r.anyDone)return{argv:n,kind:"cli",disposition:"skip",detail:"no done feature yet \u2014 smoke probe skipped",why:i};let s=e.run??[];if(s.length===0)return{argv:"(none)",kind:"cli",disposition:"skip",detail:"cli smoke probe has no run argv \u2014 skipped",feature:o,why:i};let[a,...c]=s,l=a.startsWith(".")||a.startsWith("/")?vte(t,a):a,u=zj,d;try{d=We(l,[...c],{cwd:t,reject:!1,timeout:u})}catch(h){d=h}if(za(d))return{argv:n,kind:"cli",disposition:"skip",detail:`'${a}' not installed`,feature:o,why:i};if(d.timedOut)return{argv:n,kind:"cli",disposition:"fail",detail:`timed out after ${u}ms`,feature:o,why:i};let f=e.expect?.exit??0,p=d.exitCode??1;if(p!==f){let h=String(d.stderr??"").trim()||String(d.stdout??"").trim();return{argv:n,kind:"cli",disposition:"fail",detail:`exited ${p}, expected ${f}${h?` \u2014 ${h.slice(0,200)}`:""}`,feature:o,why:i}}let m=e.expect?.token;return m?String(d.stdout??"").includes(m)?{argv:n,kind:"cli",disposition:"pass",detail:`ran clean (exit ${p}), stdout contains ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"fail",detail:`ran (exit ${p}) but stdout did not contain the AC token ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"liveness",detail:`ran clean (exit ${p}), no token declared \u2014 exit-only`,feature:o,why:i}}function Lqe(t){let e="skip";for(let o of t)bte[o.disposition]>bte[e]&&(e=o.disposition);let r=t.map(o=>{let s=o.why?` \xB7 ${o.why}`:"";return`${jqe[o.disposition]} ${o.argv} \xB7 ${o.detail}${s}`}).join(` +`),n=t.map((o,s)=>({id:`probe_${s+1}`,kind:o.kind,disposition:o.disposition==="skip"?"na":o.disposition,bindsFeature:o.feature,why:o.why,detail:o.detail}));if(e==="skip")return{stage:di,pass:!1,exitCode:2,stderr:r,probes:n};let i=e==="fail"||e==="pending_env"||e==="advisory";return{stage:di,pass:!i,exitCode:i?1:0,disposition:e,stderr:r,probes:n}}var zqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Ste.argv[1]}`;if(zqe){let t=Uj();console.log(JSON.stringify(t)),Ste.exit(t.exitCode)}Mr();sn();Rn();import wte from"node:process";var Gx="stage_3.1";function qj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.smoke,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Gx,pass:!1,exitCode:2,stderr:`no smoke runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bl(e,o[o.length-1]))return{stage:Gx,pass:!1,exitCode:2,stderr:"smoke npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Gx,i,s,o);return a||Yt(Gx,s)}var Uqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${wte.argv[1]}`;if(Uqe){let t=qj();console.log(JSON.stringify(t)),wte.exit(t.exitCode)}fC();Bj();Hj();Mr();qx();import{randomBytes as Wqe}from"node:crypto";import{unlinkSync as Kqe}from"node:fs";import{tmpdir as Jqe}from"node:os";import{join as Yqe}from"node:path";import Zj from"node:process";Jm();Rn();Ue();import{readFileSync as Hqe}from"node:fs";import{resolve as kte}from"node:path";function Gqe(t){let e=t.trim();if(!e.startsWith("{"))return null;let r;try{r=JSON.parse(e)}catch{return null}let n=r.testResults;if(!Array.isArray(n))return null;let i=new Map;for(let o of n){if(typeof o.name!="string"||!o.name)continue;let s=kte(o.name),a=i.get(s)??0;for(let c of o.assertionResults??[])c.status==="passed"&&(a+=1);i.set(s,a)}return i}function Zqe(t){let e=t.indexOf("#");return(e===-1?t:t.slice(0,e)).trim()}function Vqe(t,e,r){let n=[];for(let i of t.features??[]){if(i.status!=="done")continue;let o=[],s=new Set;for(let u of i.acceptance_criteria??[])for(let d of u.test_refs??[]){let f=Zqe(d);f&&!s.has(f)&&(s.add(f),o.push(f))}if(o.length===0)continue;let a=!0,c=!1;for(let u of o){let d=e.get(kte(r,u));if(d===void 0){a=!1;break}if(d>0){c=!0;break}}if(c||!a)continue;let l=i.title||i.id;n.push({detector:"VACUOUS_TESTS",severity:"warn",path:o[0],message:`Done feature "${l}" declares tests, but none of its test files executed a passing test (all skipped / todo / empty) \u2014 its behavioral proof never actually ran`})}return n}function Gj(t,e){try{let r=Gqe(Hqe(t,"utf8"));return r?Vqe(B(e),r,e):[]}catch{return[]}}var Br="stage_2.1";function Ete(t,e){return t==="vitest"||t.endsWith("/vitest")||e.includes("vitest")}function Ate(t,e){return[t,...e].some(r=>r==="pytest"||r.endsWith("/pytest"))}function Tte(t){let e=`${String(t.stdout??"")} +${String(t.stderr??"")}`,r=[],n=[/^\s*#\s*tests\s+(\d+)\s*$/gim,/^\s*ℹ\s+tests\s+(\d+)\s*$/gim,/^\s*Tests:\s+.*?\b(\d+)\s+total\b.*$/gim,/^\s*collected\s+(\d+)\s+items?\b.*$/gim];for(let i of n)for(let o of e.matchAll(i))r.push(Number(o[1]));return r.length>0&&r.every(i=>i===0)}function Xqe(t,e,r){let n,i;try{({cmd:n,args:i}=Yi("coverage",t))}catch{return null}if(!n||!i||!Ete(n,i))return null;let o=n,s=i,a=Dj(e,d=>We(o,[...s,"--reporter=default","--reporter=json",`--outputFile=${d}`],{cwd:e,reject:!1}));if(!a)return null;let{proc:c,jsonFile:l}=a;if(Nt(Br,n,c,s))return null;let u=Yt(Br,c);if(Nj(u)==="fallback")return null;if(r){let d=Gj(l,e);if(d.length>0)return{stage:Br,pass:!1,exitCode:1,findings:d,stderr:d[0].message}}return{stage:Br,pass:!0,exitCode:0}}function Qqe(t,e){let{strict:r=!1}=t,n,i;try{({cmd:n,args:i}=Yi("coverage",t))}catch{return null}if(!n||!i||!Ate(n,i))return null;let o=n,s=i,a=Dj(e,()=>We(o,[...s],{cwd:e,reject:!1}));if(!a||Nt(Br,o,a.proc,s))return null;let c=Yt(Br,a.proc);if(Nj(c)==="fallback")return null;if(r&&Tte(a.proc)){let l={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Br,pass:!1,exitCode:1,findings:[l],stderr:l.message}}return{stage:Br,pass:!0,exitCode:0}}function Vj(t={}){let{cwd:e=".",strict:r=!1}=t,n,i,o;try{({cmd:n,args:i,language:o}=Yi("test",t))}catch(d){return{stage:Br,pass:!1,exitCode:1,stderr:d.message}}if(!n||!i)return{stage:Br,pass:!1,exitCode:2,stderr:`no unit test runner registered for language '${o}'`};let s=Ete(n,i),a=Ate(n,i),c=r&&s;if(Cj()&&s){let d=Xqe(t,e,c);if(d)return d}if(Cj()&&a){let d=Qqe(t,e);if(d)return d}let l,u=i;c&&(l=Yqe(Jqe(),`clad-vitest-${Zj.pid}-${Wqe(6).toString("hex")}.json`),u=[...i,"--reporter=default","--reporter=json",`--outputFile=${l}`]);try{let d=We(n,[...u],{cwd:e,reject:!1}),f=Nt(Br,n,d,u);if(f)return f;let p=Iu("unit",Yt(Br,d),d);if(r&&p.pass&&Tte(d)){let m={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Br,pass:!1,exitCode:1,findings:[m],stderr:m.message}}if(c&&p.pass&&l){let m=Gj(l,e);if(m.length>0)return{stage:Br,pass:!1,exitCode:1,findings:m,stderr:m[0].message}}return p}finally{if(l)try{Kqe(l)}catch{}}}var e4e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Zj.argv[1]}`;if(e4e){let t=Vj();console.log(JSON.stringify(t)),Zj.exit(t.exitCode)}Mr();sn();Rn();import Ote from"node:process";var Wx="stage_3.3";function Wj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.visual,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Wx,pass:!1,exitCode:2,stderr:`no visual runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bl(e,o[o.length-1]))return{stage:Wx,pass:!1,exitCode:2,stderr:"visual npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Wx,i,s,o);return a||Yt(Wx,s)}var t4e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Ote.argv[1]}`;if(t4e){let t=Wj();console.log(JSON.stringify(t)),Ote.exit(t.exitCode)}mC();Mf();_a();Jj();kp();eS();var jte=St(er(),1);import{existsSync as Yj,readFileSync as f4e,readdirSync as Nte,statSync as p4e,writeFileSync as m4e}from"node:fs";import{basename as th,join as rh,relative as Dte}from"node:path";var h4e=["self-dogfood:","fixture:","derived:"],Mte=/\.(test|spec)\.[jt]sx?$/;function Fte(t,e=t,r=[]){let n;try{n=Nte(e)}catch{return r}for(let i of n){if(i.startsWith("."))continue;let o=rh(e,i);try{p4e(o).isDirectory()?Fte(t,o,r):Mte.test(i)&&r.push(o)}catch{continue}}return r}function Lte(t="."){let e=rh(t,"spec","features"),r=rh(t,"tests"),n=[],i=[];if(!Yj(e)||!Yj(r))return{repaired:n,suggested:i};let o=Fte(r),s=new Map;for(let a of o){let c=Dte(t,a).split("\\").join("/"),l=s.get(th(a))??[];l.push(c),s.set(th(a),l)}for(let a of Nte(e)){if(!a.endsWith(".yaml")&&!a.endsWith(".yml"))continue;let c=rh(e,a),l,u;try{l=f4e(c,"utf8"),u=(0,jte.parse)(l)}catch{continue}if(!u||u.status!=="done")continue;let d=!1;for(let h of u.acceptance_criteria??[])for(let g of h.test_refs??[]){if(h4e.some(x=>g.startsWith(x)))continue;let b=g.split("#",1)[0];if(Yj(rh(t,b)))continue;let _=s.get(th(b))??[];if(_.length!==1)continue;let S=g.replace(b,_[0]);S!==g&&l.includes(g)&&(l=l.split(g).join(S),n.push({shard:a,from:g,to:S}),d=!0)}let f=u.slug??"",p=(u.modules??[]).map(h=>th(h).replace(/\.[jt]sx?$/,"")),m=o.map(h=>Dte(t,h).split("\\").join("/")).find(h=>{let g=th(h).replace(Mte,"");return f!==""&&g===f||p.includes(g)});if(m)for(let h of u.acceptance_criteria??[]){if((h.test_refs?.length??0)>0||(h.evidence_refs?.length??0)>0||!h.id)continue;let g=new RegExp(`^(([ ]+)- id: ${h.id}\\b.*)$`,"m"),b=l.match(g);if(!b)continue;let _=b[2]+" ";l=l.replace(g,`$1 ${_}test_refs: -${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&m4e(c,l,"utf8")}return{repaired:n,suggested:i}}bl();import{existsSync as g4e,readFileSync as y4e}from"node:fs";import{join as _4e}from"node:path";function b4e(t,e){let r=_4e(t,e);if(!g4e(r))return[];let n=[];for(let i of y4e(r,"utf8").split(/\r?\n/)){let o=i.trim();if(!/^export\s+(?:async\s+)?(?:abstract\s+)?(?:function|const|let|class|interface|type|enum)\b/.test(o))continue;let s=o.replace(/\s*[{=].*$/s,"").trim();s&&n.push(s)}return n}function zte(t,e,r,n){let i=t.features.find(c=>c.id===e);if(!i)return null;let o=(i.acceptance_criteria??[]).filter(c=>!r||c.id===r),s=i.modules??[],a=s.flatMap(c=>b4e(n,c).map(l=>`${c}: ${l}`));return{featureId:e,featureTitle:i.title,acs:o.map(c=>({id:c.id,ears:c.ears,condition:c.condition,action:c.action,response:c.response,text:c.text})),modules:s,signatures:a,readManifest:[...s.map(c=>`signatures-of:${c}`),"spec:acceptance_criteria"]}}function Ute(t){let e=[];e.push(`# Impl-blind oracle brief \u2014 ${t.featureId}: ${t.featureTitle}`),e.push("#"),e.push("# Author a conformance TEST SUITE from THIS SPECIFICATION ONLY. You have NOT been"),e.push("# shown the implementation and MUST NOT read it. Assert ONLY what the acceptance"),e.push("# criteria literally require; when the spec is silent on an edge, write a WEAKER"),e.push("# assertion, not a stronger guess (an over-strict oracle falsely fails correct code)."),e.push(""),e.push("## Acceptance criteria (the spec)");for(let r of t.acs)e.push(`- ${r.id}${r.ears?` [${r.ears}]`:""}: ${r.text??""}`.trimEnd()),r.condition&&e.push(` when: ${r.condition}`),r.action&&e.push(` system shall: ${r.action}`),r.response&&e.push(` so that: ${r.response}`);e.push(""),e.push("## Public surface to call (signatures only \u2014 NO implementation shown)"),t.signatures.length===0&&e.push(" (no export signatures extracted \u2014 call the API exactly as the criteria describe)");for(let r of t.signatures)e.push(` ${r}`);return e.push(""),e.push("## Write the suite under tests/oracle/ (the dir stage_2.3 runs), then record it with"),e.push("## the clad_author_oracle MCP tool so its impl-blind provenance is gate-verified."),e.join(` -`)}nS();Ue();Ii();ni();bl();var Xj=["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"],v4e=[...Xj,"att"];function S4e(t,e,r){if(e.startsWith("stage_4")){let n=In(r);if(n.length===0)return"\xB7";let i=(t.acceptance_criteria??[]).map(s=>s.id);return Lx(n).filter(s=>i.includes(s.acId)).length>0?"\u2717":"\u2713"}return"-"}function w4e(t,e,r){let n=t.modules??[];return t.status!=="done"||n.length===0?"\xB7":e===null?"-":B_(e,r,t).state==="fresh"?"\u2713":"!"}function Xx(t,e="."){let r=as(e),n=t.features.map(i=>({featureId:i.id,title:i.title||i.id,status:i.status,cells:[...Xj.map(o=>S4e(i,o,e)),w4e(i,r,e)]}));return{columns:v4e,rows:n}}function qte(t,e=".",r={}){let n=r.internal??!1,i=Xx(t,e),o=[...Xj.map(c=>n?c.replace("stage_",""):x4e(c)),"att"],s=n?`feature ${o.join(" ")}`:`feature${" ".repeat(28)}${o.join(" ")}`,a=i.rows.map(c=>{let l=c.cells.join(" ");return n?`${c.featureId.padEnd(12)} ${l} ${c.title}`:`${c.title.padEnd(35).slice(0,35)} ${l}`});return[s,...a].join(` +${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&m4e(c,l,"utf8")}return{repaired:n,suggested:i}}vl();import{existsSync as g4e,readFileSync as y4e}from"node:fs";import{join as _4e}from"node:path";function b4e(t,e){let r=_4e(t,e);if(!g4e(r))return[];let n=[];for(let i of y4e(r,"utf8").split(/\r?\n/)){let o=i.trim();if(!/^export\s+(?:async\s+)?(?:abstract\s+)?(?:function|const|let|class|interface|type|enum)\b/.test(o))continue;let s=o.replace(/\s*[{=].*$/s,"").trim();s&&n.push(s)}return n}function zte(t,e,r,n){let i=t.features.find(c=>c.id===e);if(!i)return null;let o=(i.acceptance_criteria??[]).filter(c=>!r||c.id===r),s=i.modules??[],a=s.flatMap(c=>b4e(n,c).map(l=>`${c}: ${l}`));return{featureId:e,featureTitle:i.title,acs:o.map(c=>({id:c.id,ears:c.ears,condition:c.condition,action:c.action,response:c.response,text:c.text})),modules:s,signatures:a,readManifest:[...s.map(c=>`signatures-of:${c}`),"spec:acceptance_criteria"]}}function Ute(t){let e=[];e.push(`# Impl-blind oracle brief \u2014 ${t.featureId}: ${t.featureTitle}`),e.push("#"),e.push("# Author a conformance TEST SUITE from THIS SPECIFICATION ONLY. You have NOT been"),e.push("# shown the implementation and MUST NOT read it. Assert ONLY what the acceptance"),e.push("# criteria literally require; when the spec is silent on an edge, write a WEAKER"),e.push("# assertion, not a stronger guess (an over-strict oracle falsely fails correct code)."),e.push(""),e.push("## Acceptance criteria (the spec)");for(let r of t.acs)e.push(`- ${r.id}${r.ears?` [${r.ears}]`:""}: ${r.text??""}`.trimEnd()),r.condition&&e.push(` when: ${r.condition}`),r.action&&e.push(` system shall: ${r.action}`),r.response&&e.push(` so that: ${r.response}`);e.push(""),e.push("## Public surface to call (signatures only \u2014 NO implementation shown)"),t.signatures.length===0&&e.push(" (no export signatures extracted \u2014 call the API exactly as the criteria describe)");for(let r of t.signatures)e.push(` ${r}`);return e.push(""),e.push("## Write the suite under tests/oracle/ (the dir stage_2.3 runs), then record it with"),e.push("## the clad_author_oracle MCP tool so its impl-blind provenance is gate-verified."),e.join(` +`)}nS();Ue();Ii();ni();vl();var Xj=["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"],v4e=[...Xj,"att"];function S4e(t,e,r){if(e.startsWith("stage_4")){let n=In(r);if(n.length===0)return"\xB7";let i=(t.acceptance_criteria??[]).map(s=>s.id);return Lx(n).filter(s=>i.includes(s.acId)).length>0?"\u2717":"\u2713"}return"-"}function w4e(t,e,r){let n=t.modules??[];return t.status!=="done"||n.length===0?"\xB7":e===null?"-":B_(e,r,t).state==="fresh"?"\u2713":"!"}function Xx(t,e="."){let r=as(e),n=t.features.map(i=>({featureId:i.id,title:i.title||i.id,status:i.status,cells:[...Xj.map(o=>S4e(i,o,e)),w4e(i,r,e)]}));return{columns:v4e,rows:n}}function qte(t,e=".",r={}){let n=r.internal??!1,i=Xx(t,e),o=[...Xj.map(c=>n?c.replace("stage_",""):x4e(c)),"att"],s=n?`feature ${o.join(" ")}`:`feature${" ".repeat(28)}${o.join(" ")}`,a=i.rows.map(c=>{let l=c.cells.join(" ");return n?`${c.featureId.padEnd(12)} ${l} ${c.title}`:`${c.title.padEnd(35).slice(0,35)} ${l}`});return[s,...a].join(` `)}function x4e(t){return Ta(t).slice(0,3)}async function J8e(t){let[{buildServer:e},{StdioServerTransport:r},{setHostMcpServer:n}]=await Promise.all([Promise.resolve().then(()=>(nde(),rde)),Promise.resolve().then(()=>(cde(),ade)),Promise.resolve().then(()=>(Xp(),_7))]),i=e({cwd:t.cwd,onboarding:{renderDraft:s=>Vee(s),prepareInit:({cwd:s,mode:a,intent:c})=>Gee(s,a,c),initialize:pj,prepareClarify:(s,{cwd:a})=>Zee(a,s),clarify:yj,resolveReview:(s,{cwd:a})=>Uee(s,{cwd:a})}});n(i.server);let o=new r;G.stderr.write(`\xB7 serve stdio transport \xB7 cwd=${t.cwd??"."} `),await i.connect(o)}async function Y8e(t,e){let r=t&&t.length>0?t.join(" ").trim():void 0,n=await pj({projectName:e.name,force:e.force,scan:e.scan,noLlm:e.noLlm,roots:e.roots?e.roots.split(",").map(o=>o.trim()).filter(Boolean):void 0,intent:r,withHook:e.withHook,withCi:e.withCi});if(e.json){G.stdout.write(`${JSON.stringify(n,null,2)} `),G.exit(0);return}for(let o of n.created)L("pass",`created ${o}`);for(let o of n.skipped)L("skip",o);for(let o of n.proposals??[])L("note","proposal",o);let i=n.onboardingMode?`language: ${n.language} \xB7 mode: ${n.onboardingMode}`:`language: ${n.language}`;if(L("note","init done",i),n.clarifyingQuestions&&n.clarifyingQuestions.length>0){G.stdout.write(` @@ -922,13 +922,13 @@ ${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&m4e(c,l,"u `));G.exit(0)}async function X8e(t,e){L("note","run","EXPERIMENTAL \u2014 prefer the host-delegated path (clad serve + your AI host). See docs/feature-cycle.md \xA7 Execution surface.");let{runDriveLoop:r}=await Promise.resolve().then(()=>(Cde(),Pde)),n=await r({cwd:e.cwd,goal:t,budget:{maxIterations:Number(e.maxIterations),maxWallClockMs:Number(e.maxWallClockMs),maxRetriesPerFeature:Number(e.maxRetries)}}),i=n.halt.class==="ALL_FEATURES_DONE"?"pass":"note";if(e.json)L(i,"run",`halt=${n.halt.class} iter=${n.iterations} features=${n.featuresTouched.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`),G.stdout.write(`${JSON.stringify(n,null,2)} `);else{let s=B(e.cwd??"."),a=n.featuresTouched.map(l=>iR(l,s)),c=`${fG(n.halt,s)} iter=${n.iterations} features=${a.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`;L(i,"run",c),a.length>0&&G.stdout.write(`Touched: ${a.join(", ")} -`)}let o=n.stubsCreated.length>0;o&&L("fail","run",`produced ${n.stubsCreated.length} empty auto-stub(s) and implemented nothing \u2014 the headless code-author needs a real LLM transport (set ANTHROPIC_API_KEY) or use the host-delegated path (clad serve + your AI host). This run did NOT do the work.`),G.exit(n.halt.class==="ALL_FEATURES_DONE"&&!o?0:1)}function Q8e(t={}){try{let e=B();if(ya("."))L("note","sync","derived-file writes deferred \u2014 git operation in progress; re-run after the merge/rebase completes.");else{let r=_s(".");Zl(".",r),Wa("."),N5(".");let n=eu(".");n==="created"?L("note","agents.md","wrote a spec-driven AGENTS.md so non-Claude agents share the same guidance."):n==="updated"&&L("note","agents.md","refreshed the AGENTS.md managed block from the current spec.");let i=Lte(".");for(let s of i.repaired)L("note","test_refs",`repaired ${s.from} \u2192 ${s.to} (${s.shard})`);for(let s of i.suggested)L("note","test_refs",`suggested ${s.ref} (${s.shard}) \u2014 confirm by removing the 'derived:' prefix`);let o=Yx(".");o&&L("note","deliverable",`auto-detected entry '${o.path}' \u2014 the gate now smoke-tests it (stage_2.4). Opt out with is_safe_to_smoke: false.`)}if(t.proposeArchive){let n=iS.run({cwd:"."}).filter(i=>i.suggestion?.action==="propose-archive");if(n.length===0){L("pass","sync",`${e.features.length} features \xB7 0 archive candidates`),G.exit(0);return}for(let i of n){let o=i.suggestion?.args??{},s=String(o.featureId??"?"),a=String(o.reason??i.message);L("note",`propose-archive \xB7 ${s}`,a)}L("pass","sync",`${e.features.length} features \xB7 ${n.length} archive candidate(s)`),G.exit(0);return}L("pass","sync",`${e.features.length} features valid`),G.exit(0)}catch(e){L("fail","sync",e.message),G.exit(1)}}function e5e(t){if(!t){L("fail","checkpoint","feature id required (e.g. clad checkpoint F-001)"),G.exit(2);return}let e=E_(".",t),r=e.gitHead?e.gitHead.slice(0,12):"(no git)";L("pass",`checkpoint \xB7 ${t}`,`head=${r} digest=${e.specDigest.slice(0,12)}`),G.exit(0)}function t5e(t,e={}){if(!t){L("fail","rollback","feature id required (e.g. clad rollback F-001)"),G.exit(2);return}let r=A_(".",t);if(!r){L("fail",`rollback \xB7 ${t}`,"no prior checkpoint recorded"),G.exit(1);return}T_(".",t,r,e.reason);let n=r.gitHead?r.gitHead.slice(0,12):"(no git)";L("note",`rollback \xB7 ${t}`,`recorded \u2014 run the printed command to apply (cladding does not execute git) \xB7 target head=${n} ts=${r.timestamp}`),r.gitHead?G.stdout.write(`Run: git checkout ${r.gitHead} +`)}let o=n.stubsCreated.length>0;o&&L("fail","run",`produced ${n.stubsCreated.length} empty auto-stub(s) and implemented nothing \u2014 the headless code-author needs a real LLM transport (set ANTHROPIC_API_KEY) or use the host-delegated path (clad serve + your AI host). This run did NOT do the work.`),G.exit(n.halt.class==="ALL_FEATURES_DONE"&&!o?0:1)}function Q8e(t={}){try{let e=B();if(ya("."))L("note","sync","derived-file writes deferred \u2014 git operation in progress; re-run after the merge/rebase completes.");else{let r=_s(".");Vl(".",r),Wa("."),N5(".");let n=tu(".");n==="created"?L("note","agents.md","wrote a spec-driven AGENTS.md so non-Claude agents share the same guidance."):n==="updated"&&L("note","agents.md","refreshed the AGENTS.md managed block from the current spec.");let i=Lte(".");for(let s of i.repaired)L("note","test_refs",`repaired ${s.from} \u2192 ${s.to} (${s.shard})`);for(let s of i.suggested)L("note","test_refs",`suggested ${s.ref} (${s.shard}) \u2014 confirm by removing the 'derived:' prefix`);let o=Yx(".");o&&L("note","deliverable",`auto-detected entry '${o.path}' \u2014 the gate now smoke-tests it. Opt out with is_safe_to_smoke: false.`)}if(t.proposeArchive){let n=iS.run({cwd:"."}).filter(i=>i.suggestion?.action==="propose-archive");if(n.length===0){L("pass","sync",`${e.features.length} features \xB7 0 archive candidates`),G.exit(0);return}for(let i of n){let o=i.suggestion?.args??{},s=String(o.featureId??"?"),a=String(o.reason??i.message);L("note",`propose-archive \xB7 ${s}`,a)}L("pass","sync",`${e.features.length} features \xB7 ${n.length} archive candidate(s)`),G.exit(0);return}L("pass","sync",`${e.features.length} features valid`),G.exit(0)}catch(e){L("fail","sync",e.message),G.exit(1)}}function e5e(t){if(!t){L("fail","checkpoint","feature id required (e.g. clad checkpoint F-001)"),G.exit(2);return}let e=E_(".",t),r=e.gitHead?e.gitHead.slice(0,12):"(no git)";L("pass",`checkpoint \xB7 ${t}`,`head=${r} digest=${e.specDigest.slice(0,12)}`),G.exit(0)}function t5e(t,e={}){if(!t){L("fail","rollback","feature id required (e.g. clad rollback F-001)"),G.exit(2);return}let r=A_(".",t);if(!r){L("fail",`rollback \xB7 ${t}`,"no prior checkpoint recorded"),G.exit(1);return}T_(".",t,r,e.reason);let n=r.gitHead?r.gitHead.slice(0,12):"(no git)";L("note",`rollback \xB7 ${t}`,`recorded \u2014 run the printed command to apply (cladding does not execute git) \xB7 target head=${n} ts=${r.timestamp}`),r.gitHead?G.stdout.write(`Run: git checkout ${r.gitHead} `):G.stdout.write(`No git head pinned \u2014 restore spec.yaml manually from VCS history. `),G.exit(0)}async function r5e(t){let e=t.host?t.host==="all"?["claude","codex","gemini","antigravity","cursor"].slice():[t.host]:void 0,r=await VC({force:t.force,quiet:t.quiet,projectRoot:t.project,hosts:e});G.exit(r.errors.length>0?1:0)}async function n5e(){L("note","update","reconciling the current project after the engine upgrade");let t=await FX(".",{wireHosts:async()=>(await VC({quiet:!0,projectRoot:"."})).errors.length});if(!t.isProject){L("skip","update","no spec.yaml here \u2014 nothing re-wired. Run `clad update` inside a cladding project, or `clad init` to start one."),G.exit(t.code);return}L(t.wiringErrors>0?"fail":"pass","hosts",t.wiringErrors>0?`${t.wiringErrors} wiring error(s)`:"re-wired"),t.inventoryDeferred?L("note","spec",`inventory + index writes deferred \u2014 git operation in progress; re-run \`clad update\` after it completes (${t.features} features seen).`):L("pass","spec",`inventory synced \xB7 ${t.features} features`),L(t.claudeMd==="refreshed-stale"?"note":"pass","CLAUDE.md",t.claudeMd),L(t.agentsMd==="refreshed-stale"?"note":"pass","AGENTS.md",t.agentsMd);for(let r of t.deprecations)L("note","deprecated",r);G.stdout.write(` \u2192 drift check (report-only \xB7 does not block, does not edit your spec): `),$A({tier:"pre-commit",strict:!0}).anyFailed?G.stdout.write("\n\u2139 The findings above are the bar this upgrade raised \u2014 not a failed update. Reconcile them in YOUR spec when ready (`clad check --strict` for the full gate).\n"):L("pass","drift","clean against the stricter detectors"),G.exit(t.code)}var i5e={"pre-commit":["stage_1.3","stage_1.5","stage_1.6"],"pre-push":["stage_1.1","stage_1.2","stage_1.3","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4"],all:["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"]};function $A(t){let e=t.tier??"all",r=t.silent===!0,n=i5e[e];if(!n)return t.json&&!r?G.stdout.write(`${JSON.stringify({tier:e,error:`unknown tier '${e}'`,worst:2,anyFailed:!0,stages:[]},null,2)} `):r||L("fail","check",`unknown --tier '${e}' (expected: pre-commit | pre-push | all)`),{worst:2,anyFailed:!0,stages:[]};let i={focusModules:t.focusModules},s=[["stage_1.1",()=>Qm(i)],["stage_1.2",()=>Xm(i)],["stage_1.3",()=>oi({...i,strict:t.strict})],["stage_1.4",jj],["stage_1.5",rc],["stage_1.6",Gp],["stage_2.1",()=>Vj({...i,strict:t.strict})],["stage_2.2",()=>Mj(i)],["stage_2.3",dC],["stage_2.4",Uj],["stage_3.1",qj],["stage_3.2",Lj],["stage_3.3",Wj],["stage_4.1",Ij],["stage_4.2",eh]].filter(([d])=>n.includes(d)),a=0,c=!1,l=d=>d==="pass"?"pass":d==="liveness"?"note":d==="na"?"skip":ci(d)?"fail":"skip",u=[];H_("."),fte(".");try{for(let[d,f]of s){let p=f({}),m=t.internal?d:Ta(d),h=kX(p);ci(h)&&(c=!0,a=Math.max(a,EX(p,h))),u.push({stage:d,label:m,status:h,exitCode:p.exitCode,stderr:p.stderr,findings:p.findings}),!t.json&&!r&&(L(l(h),m),ci(h)&&f5e(p))}}finally{Z_(),mte()}if(t.strict)try{let d=B();for(let f of ute(d,u))a=Math.max(a,1),c=!0,u.push({stage:f.stage,label:f.label,status:"fail",exitCode:1,stderr:f.message}),!t.json&&!r&&L("fail",f.label,f.message)}catch{}if(t.strict&&(e==="pre-push"||e==="all")){let d=u.find(h=>h.stage==="stage_1.3"),f=(d?.findings??[]).filter(h=>h.severity==="error"||h.severity==="warn"),p=d?.status==="fail"&&f.length>0&&f.every(h=>h.detector==="STALE_ATTESTATION"),m=u.every(h=>h.stage==="stage_1.3"||!ci(h.status));if(p&&m&&d&&(d.status="pass",d.exitCode=0,d.stderr="stale attestation exempted \u2014 this run re-verified and re-attests",c=u.some(h=>ci(h.status)),a=c?Math.max(1,a):0,!t.json&&!r&&L("note","attestation","stale entries re-verified by this run \u2014 re-attesting")),!c&&!r)if(ya("."))t.json||L("note","attestation","deferred \u2014 git operation in progress; run the gate again after the merge/rebase completes.");else try{PG(".",B())&&(t.json||L("note","attestation","spec/attestation.yaml refreshed (verified tree stamped)"))}catch{}}return t.json&&!r?G.stdout.write(`${JSON.stringify({tier:e,worst:a,anyFailed:c,stages:u},null,2)} -`):c&&!r&&G.stdout.write("\n\u2139 Run `clad doctor` for the event log, or `clad sync` to validate spec shards. Drift findings above name the offending detector.\n"),tr(".","gate_run",{tier:e,strict:t.strict===!0,worst:a,anyFailed:c}),{worst:a,anyFailed:c,stages:u}}function o5e(t){try{let e=B(),r=fl(e,t);G.stdout.write(`${JSON.stringify(r,null,2)} +`):c&&!r&&G.stdout.write("\n\u2139 Run `clad doctor` for the event log, or `clad sync` to check the spec. The findings above say what drifted and why.\n"),tr(".","gate_run",{tier:e,strict:t.strict===!0,worst:a,anyFailed:c}),{worst:a,anyFailed:c,stages:u}}function o5e(t){try{let e=B(),r=fl(e,t);G.stdout.write(`${JSON.stringify(r,null,2)} `),G.exit("not_found"in r?1:0)}catch(e){L("fail","context",e.message),G.exit(1)}}function s5e(t,e={}){try{let r=B(),n=e.depth!==void 0?Number(e.depth):void 0,i=vr(r,t,{depth:n});G.stdout.write(`${JSON.stringify(i,null,2)} `),G.exit("not_found"in i?1:0)}catch(r){L("fail","impact",r.message),G.exit(1)}}function a5e(t={}){try{let e=B(),r=t.ambiguity!==void 0?Number(t.ambiguity):void 0,i=uS(e,o=>{try{return Nde(o,"utf8")}catch{return null}},r!==void 0?{maxOwnerAmbiguity:r}:{});G.stdout.write(`${JSON.stringify({suggestions:i.suggestions,new_edges:i.edges.length,already_declared:i.alreadyDeclared.length,dynamic_import_files:i.dynamicImportFiles},null,2)} `),G.exit(0)}catch(e){L("fail","infer-deps",e.message),G.exit(1)}}function c5e(t={}){try{if(t.sessions){Jee(t);return}if(t.trend!==void 0&&t.trend!==!1){Yee(t);return}let e=B(),n=IH(e,o=>{try{return Nde(o,"utf8")}catch{return null}},"."),i=CH(".",n);if(t.json)G.stdout.write(`${JSON.stringify(n,null,2)} @@ -941,11 +941,11 @@ ${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&m4e(c,l,"u `)}G.stdout.write(` ${o.length} AC(s) required, ${s.length} missing an oracle. `),G.exit(s.length>0?1:0);return}if(!t){L("fail","oracle","provide a to print its blind brief, or --required to list the ACs the policy needs an oracle for"),G.exit(1);return}let i=zte(n,t,e.ac,r);if(!i||i.acs.length===0){L("fail","oracle",`no acceptance criteria for ${t}${e.ac?`.${e.ac}`:""} \u2014 nothing to author a blind oracle from`),G.exit(1);return}G.stdout.write(`${Ute(i)} -`),G.exit(0)}function f5e(t){if(t.findings&&t.findings.length>0){let e=t.findings.filter(i=>i.severity==="error"),r=t.findings.filter(i=>i.severity==="warn"),n=e.length>0?e:r;for(let i of n.slice(0,3)){let o=Dde(Uf(i.detector,i.message),140),s=i.path?` \u2014 ${i.path}`:"";G.stdout.write(` ${o}${s} [${i.detector}] +`),G.exit(0)}function f5e(t){if(t.findings&&t.findings.length>0){let e=t.findings.filter(i=>i.severity==="error"),r=t.findings.filter(i=>i.severity==="warn"),n=e.length>0?e:r;for(let i of n.slice(0,3)){let o=Dde(_l(i.detector,i.message),140),s=i.path?` \u2014 ${i.path}`:"";G.stdout.write(` ${o}${s} [${i.detector}] `)}n.length>3&&G.stdout.write(` \u2026 and ${n.length-3} more finding(s) `),t.hint&&G.stdout.write(` fix: run \`${t.hint}\` `);return}if(t.stderr&&t.stderr.trim().length>0){let e=t.stderr.split(` `).find(r=>r.trim().length>0);e&&G.stdout.write(` ${Dde(e.trim(),160)} `)}}function Dde(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function p5e(t){let e=B();if(t.json){G.stdout.write(`${JSON.stringify(Xx(e,"."),null,2)} `),G.exitCode=0;return}G.stdout.write(`${qte(e,".",{internal:t.internal})} -`),G.exit(0)}function m5e(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function h5e(t){let e=t.cwd??".",r=(t.out??"").trim();if(r.length===0){L("fail","bundle","missing --out \u2014 the bundle needs a destination path"),G.exit(1);return}let n;try{let i=B(e),o=Xx(i,e),s={gitHead:va(e),version:Yl(),generatedAt:t.now??new Date().toISOString()},a=gl(i),c;try{let l=t.since??rs(e),u=ns(e,l);c={kind:"present",sinceRef:l,changelogMarkdown:ml(u),auditMarkdown:hl(u,i,e)}}catch(l){c={kind:"omitted",reason:l.message}}n=$G({spec:i,panel:o,provenance:s,catalogMarkdown:a,changes:c})}catch(i){L("fail","bundle",i.message),G.exit(1);return}try{K8e(r,n,"utf8")}catch(i){L("fail","bundle",`could not write ${r}: ${i.message}`),G.exit(1);return}L("pass","bundle",`${r} \xB7 ${m5e(Buffer.byteLength(n,"utf8"))}`),G.exit(0)}function g5e(t){let e=BA(t);L("note",`route \u2192 ${e}`,t),G.exit(e==="unknown"?1:0)}function y5e(){let t=new w4;t.name("clad").description("Reference Ironclad CLI").version("0.9.0"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init payment SaaS for B2B` \u2014 free text in any language) to drive intent-aware onboarding \u2014 the LLM dispatcher then produces domain-aware capabilities/architecture/project-context plus product-level follow-up questions. Bare `clad init` keeps the v0.3.42 behaviour (greenfield seeds, or observed scan when \u22653 source files exist).").option("-n, --name ","Project name (default: cwd basename)").option("-f, --force","Overwrite existing spec.yaml").option("--scan","Force-walk the existing codebase. Default auto-detects (\u22653 source files trigger scan). Use --no-scan to skip even when source is present.").option("--no-llm","Force the deterministic interpreter (skip the LLM dispatcher chain). Intent text falls back to a deterministic quote in project-context.md.").option("--roots ","Override scanner source roots, comma-separated (e.g. packages/a/src,packages/b/src). Otherwise inferred from manifests + directory heuristics.").option("--with-hook","Install git pre-commit (cheap tier) AND pre-push (strict tier) hooks. Opt-in; cladding never touches .git without it.").option("--with-ci","Scaffold .github/workflows/cladding.yml running the strict pre-push gate \u2014 the authoritative enforcement layer.").option("--json","emit the raw InitResult for tooling; default is the human-readable surface").action(Y8e),t.command("run [goal]").description("(experimental) Headless autonomous loop \u2014 iterate ready features, dispatch developer + reviewer personas, run L1 gates, record evidence. The supported, exercised path is host-delegated (clad serve + your AI host loops the cadence); this loop needs a real LLM transport and is not auto-invoked").option("--cwd ","target project directory (default cwd)").option("--max-iterations ","cap iterations (default 50)","50").option("--max-wall-clock-ms ","cap wall clock (default 600000)","600000").option("--max-retries ","cap retries per feature (default 3)","3").option("--json","emit the raw internal result (Iron Core view); default is a plain Soft Shell summary").action(X8e),t.command("sync").description("Validate spec.yaml against schema and report").option("--propose-archive","list STALE_SPECIFICATION findings whose suggestion.action is propose-archive (Phased Decommissioning Tier 2)").action(Q8e),t.command("setup").description("Activate Cladding only for the current project (Claude Code / Codex / Gemini / Antigravity / Cursor)").option("--project ","activate a project other than the current directory").option("--host ","activate detected hosts (default), all, or one of: claude, codex, gemini, antigravity, cursor").option("--force","replace an existing conflicting cladding-owned project entry").option("--quiet","suppress stdout output").action(r5e),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: refresh project host wiring + sync inventory + refresh managed CLAUDE.md/AGENTS.md, then report stricter detector findings").action(n5e),t.command("check").description("Run every Iron Law stage and the drift detector suite").option("--internal","show stage codes (`stage_1.1`) instead of names (`Type`)").option("--strict","promote warn-severity drift findings to errors (CI / pre-publish gate)").option("--tier ","run only the stages for a trigger: pre-commit (drift/arch/secret) | pre-push (+ type/lint/unit/cov/spec-conformance/deliverable-smoke) | all (default; full 15-stage gate, used by CI)").option("--json","emit structured per-stage results (machine-readable: findings with file/line/suggestion, untruncated) \u2014 for agents/CI; cuts RED\u2192fix round-trips").option("--feature ","scope the gate to this feature's modules[] (Gradle monorepos): runs only :project: tasks instead of the root aggregate. No-op for non-Gradle repos or modules-less features").action(l5e),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(e5e),t.command("done ").description("Mark a feature done ONLY if `clad check --tier=pre-push --strict` is GREEN (flip \u2192 gate \u2192 revert-on-red). Keeps `done` honest.").action(u5e),t.command("oracle [featureId]").description("Print the impl-blind oracle authoring brief (acceptance criteria + signatures, never the implementation). Hand it to a fresh blind sub-agent; record the result with clad_author_oracle. cladding calls no LLM. Use --required to list which done ACs the project policy needs an oracle for.").option("--ac ","restrict the brief to a single acceptance criterion").option("--required","list the done ACs the oracle_policy / require_oracles requires an oracle for (worklist), instead of a brief").option("--cwd ","project root (defaults to .)").action((r,n)=>d5e(r,n)),t.command("rollback ").description("Record a rollback event and print the maintainer-runnable git command for the latest checkpoint").option("-r, --reason ","optional free-text reason recorded on the event payload").action(t5e),t.command("status").description("Render the feature \xD7 stage integrity matrix (business titles; use --internal for raw F-NNN ids)").option("--internal","show internal F-NNN ids and stage codes").option("--json","emit the row model as JSON \u2014 the same feature \xD7 stage integrity matrix rendered to the terminal (columns + per-feature glyph cells), one SSoT for terminal, JSON, and the audit bundle").action(p5e),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(o5e),t.command("impact ").description("Print the blast radius for a change \u2014 what depends on a feature/file + the tests to re-run (F-7794a6bc)").option("--depth ","bound the dependent walk to N hops (default: the full transitive radius)").action((r,n)=>s5e(r,n)),t.command("verdict").description("One-poll loop decision: DONE|ITERATE|ESCALATE|BLOCKED|BOOTSTRAP over the pre-push strict gate + feature statuses (F-2e28cc72). Single gate touch; DONE requires \u22651 non-liveness proof.").option("--json","emit the verdict object as JSON").option("--tier ","gate tier (default pre-push)").action(r=>CX(r,{checkStages:$A})),t.command("infer-deps").description("Suggest feature depends_on edges from the code import graph \u2014 the dependency edges cladding never auto-produced (F-2be3e3bb). Prints reviewable suggestions; does not write the spec.").option("--ambiguity ","emit edges for imports owned by \u2264 N features (default 1 = unambiguous single-owner only)").action(r=>a5e(r)),t.command("measure").description("Report the search + context efficiency the graph provides per feature \u2014 working-set tokens vs the naive baseline, dependency depth/edges resolved, regression-set coverage (F-16138071). Deterministic; no agent.").option("--json","emit the full report as JSON").option("--sessions","summarize recorded value-delivery telemetry instead \u2014 impact-card fire rate over eligible edits, the per-reason skip histogram, and MCP read-serve counts. Measures DELIVERY (did the surfaces fire), NOT adoption (F-6ba22c5c).").option("--trend [n]","render the last N (default 5) recorded measure snapshots with signed deltas \u2014 spot efficiency drift over time from the deduped .cladding/measure.jsonl ledger (F-39609db4)").action(r=>c5e(r));let e=t.command("graph").description("Render the spec\u2194code\u2194doc knowledge graph for a viewer, or report its shape (F-569f4b37)");return e.command("export").description("Export the graph: mermaid/dot/json to stdout, or an Obsidian vault to --out").option("--format ","mermaid | dot | json | obsidian | html (default: mermaid). html = a single self-contained offline viewer (requires --out)").option("--focus ","restrict to a feature/file node\u2019s neighborhood (id, slug, or module path)").option("--depth ","neighborhood radius around --focus (default: unbounded)").option("--out ","write to a file (or, for obsidian, a vault dir \u2014 default .cladding/graph)").action(r=>ate(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>cte()),e.command("serve").description("Serve a LIVE graph at localhost \u2014 recomputes on each load + auto-reloads on spec/doc changes (F-64a5c159)").option("--port ","port to listen on (default 3000)").action(r=>{lte(r)}),t.command("changelog").description("Render shipped changes since a git ref into human-facing documents (F-904495a5). Default: capability-grouped markdown from feature titles + acceptance sentences (no internal ids). --json emits the deterministic manifest hosts render release notes from; --audit the id-keeping verification table; --catalog the full capability \u2192 feature \u2192 acceptance catalog.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--json","print the deterministic ChangelogManifest as JSON (byte-identical across runs on the same state)").option("--audit","print the audit table \u2014 feature | AC | EARS | verification refs, each marked resolved \u2713/\u2717").option("--catalog","print the full capability \u2192 feature \u2192 acceptance listing of the living spec (no git range)").option("--measure","embed the release's own re-derivable measurement \u2014 but ONLY a snapshot taken at the current HEAD; no match renders a not-measured notice, never an older snapshot (F-ede6fa75)").action(r=>dG(r)),t.command("report").description("Render one deterministic review packet for a git range (F-f6cc5e5a) \u2014 spec-shard movement (from the changelog), changed source files resolved to their owning features via the reverse index, the deduped regression set, and gate + attestation state. For PR reviewers, team-leads, and auditors: it RENDERS, it gates nothing. Byte-identical across two runs on the same repository state.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--format ","md (default, the four-section markdown packet) | sarif (SARIF 2.1.0 \u2014 one result per error/warn drift finding, for code-scanning UIs) | json (the raw deterministic model)").action(r=>SY(r)),t.command("bundle").description("Write ONE self-contained HTML audit bundle (F-e940fffe) a non-coder can double-click \u2014 offline, zero network, no CDN, no scripts. Contains the project header + inventory, the feature \xD7 stage matrix, the capability catalog, shipped changes for the range, the audit table with resolved refs, and the attestation summary, under a provenance banner (git HEAD, date, version). Deterministic modulo the date stamp. If no anchor ref resolves, the changelog + audit sections show an omitted notice while the rest still renders.").requiredOption("--out ","destination path for the HTML bundle").option("--since ","git ref to diff shipped changes from (default: the latest tag via `git describe --tags --abbrev=0`)").action(r=>h5e(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(g5e),t.command("hook ").description("Host hook protocol adapter \u2014 consume one host lifecycle event (SessionStart | UserPromptSubmit | PreToolUse | PostToolUse | Stop) as stdin JSON and print the protocol response on stdout. Always exits 0 so a hook failure never bricks the host session.").action($X),t.command("serve").description("Run cladding as an MCP server over stdio \u2014 tools/resources/prompts for any MCP client").option("--cwd ","project directory exposed to the client (default cwd)").action(J8e),t.command("doctor").description("Summarise .cladding/events.log.jsonl \u2014 sentinel-miss frequency by phase/cause/fallback plus the top missed sentinels (LLM dispatcher health check)").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").option("--hosts","smoke-test host CLIs (Claude Code / Gemini / Antigravity / Codex / Cursor) and project wiring \u2192 dated artifact + docs/dogfood/matrix.md. Live LLM prompts run only with consent (CLAD_HOST_SMOKE=1 or --yes); otherwise not-run").option("--yes","grant live-run consent for --hosts (equivalent to CLAD_HOST_SMOKE=1)").option("--matrix-only","regenerate docs/dogfood/matrix.md from the newest host-smoke artifact without any probing").action(r=>{if(r.hosts||r.matrixOnly){JY({cwd:r.cwd,yes:r.yes,matrixOnly:r.matrixOnly});return}$Y(r)}),t.command("clarify [answer...]").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, free text in any language, e.g. `clad clarify B2B only`); the LLM refines spec/docs based on the full Q-A history and may emit new follow-up questions. Reads/writes `.cladding/onboarding/state.yaml`. Requires `clad init ` to have started a session first.").option("--cwd ","project directory containing .cladding/onboarding/state.yaml (default cwd)").option("--no-llm","force the deterministic interpreter (preserves current artifacts, logs the answer)").option("--json","emit the raw RefineReport for tooling; default is the human-readable surface").action(Hee),t}var _5e=!!globalThis.__CLADDING_BUNDLED,b5e=_5e||import.meta.url===`file://${G.argv[1]}`;b5e&&y5e().parse();export{i5e as TIER_STAGES,y5e as createProgram,h5e as runBundleCommand,l5e as runCheckCommand,$A as runCheckStages,e5e as runCheckpointCommand,o5e as runContextCommand,u5e as runDoneCommand,s5e as runImpactCommand,a5e as runInferDepsCommand,Y8e as runInitCommand,c5e as runMeasureCommand,d5e as runOracleCommand,t5e as runRollbackCommand,g5e as runRouteCommand,X8e as runRunCommand,J8e as runServeCommand,r5e as runSetupCommand,p5e as runStatusCommand,Q8e as runSyncCommand,n5e as runUpdateCommand}; +`),G.exit(0)}function m5e(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function h5e(t){let e=t.cwd??".",r=(t.out??"").trim();if(r.length===0){L("fail","bundle","missing --out \u2014 the bundle needs a destination path"),G.exit(1);return}let n;try{let i=B(e),o=Xx(i,e),s={gitHead:va(e),version:Xl(),generatedAt:t.now??new Date().toISOString()},a=gl(i),c;try{let l=t.since??rs(e),u=ns(e,l);c={kind:"present",sinceRef:l,changelogMarkdown:ml(u),auditMarkdown:hl(u,i,e)}}catch(l){c={kind:"omitted",reason:l.message}}n=$G({spec:i,panel:o,provenance:s,catalogMarkdown:a,changes:c})}catch(i){L("fail","bundle",i.message),G.exit(1);return}try{K8e(r,n,"utf8")}catch(i){L("fail","bundle",`could not write ${r}: ${i.message}`),G.exit(1);return}L("pass","bundle",`${r} \xB7 ${m5e(Buffer.byteLength(n,"utf8"))}`),G.exit(0)}function g5e(t){let e=BA(t);L("note",`route \u2192 ${e}`,t),G.exit(e==="unknown"?1:0)}function y5e(){let t=new w4;t.name("clad").description("Reference Ironclad CLI").version("0.9.0"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init payment SaaS for B2B` \u2014 free text in any language) to drive intent-aware onboarding \u2014 the LLM dispatcher then produces domain-aware capabilities/architecture/project-context plus product-level follow-up questions. Bare `clad init` keeps the v0.3.42 behaviour (greenfield seeds, or observed scan when \u22653 source files exist).").option("-n, --name ","Project name (default: cwd basename)").option("-f, --force","Overwrite existing spec.yaml").option("--scan","Force-walk the existing codebase. Default auto-detects (\u22653 source files trigger scan). Use --no-scan to skip even when source is present.").option("--no-llm","Force the deterministic interpreter (skip the LLM dispatcher chain). Intent text falls back to a deterministic quote in project-context.md.").option("--roots ","Override scanner source roots, comma-separated (e.g. packages/a/src,packages/b/src). Otherwise inferred from manifests + directory heuristics.").option("--with-hook","Install git pre-commit (cheap tier) AND pre-push (strict tier) hooks. Opt-in; cladding never touches .git without it.").option("--with-ci","Scaffold .github/workflows/cladding.yml running the strict pre-push gate \u2014 the authoritative enforcement layer.").option("--json","emit the raw InitResult for tooling; default is the human-readable surface").action(Y8e),t.command("run [goal]").description("(experimental) Headless autonomous loop \u2014 iterate ready features, dispatch developer + reviewer personas, run L1 gates, record evidence. The supported, exercised path is host-delegated (clad serve + your AI host loops the cadence); this loop needs a real LLM transport and is not auto-invoked").option("--cwd ","target project directory (default cwd)").option("--max-iterations ","cap iterations (default 50)","50").option("--max-wall-clock-ms ","cap wall clock (default 600000)","600000").option("--max-retries ","cap retries per feature (default 3)","3").option("--json","emit the raw internal result (Iron Core view); default is a plain Soft Shell summary").action(X8e),t.command("sync").description("Validate spec.yaml against schema and report").option("--propose-archive","list STALE_SPECIFICATION findings whose suggestion.action is propose-archive (Phased Decommissioning Tier 2)").action(Q8e),t.command("setup").description("Activate Cladding only for the current project (Claude Code / Codex / Gemini / Antigravity / Cursor)").option("--project ","activate a project other than the current directory").option("--host ","activate detected hosts (default), all, or one of: claude, codex, gemini, antigravity, cursor").option("--force","replace an existing conflicting cladding-owned project entry").option("--quiet","suppress stdout output").action(r5e),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: refresh project host wiring + sync inventory + refresh managed CLAUDE.md/AGENTS.md, then report stricter detector findings").action(n5e),t.command("check").description("Run every Iron Law stage and the drift detector suite").option("--internal","show stage codes (`stage_1.1`) instead of names (`Type`)").option("--strict","promote warn-severity drift findings to errors (CI / pre-publish gate)").option("--tier ","run only the stages for a trigger: pre-commit (drift/arch/secret) | pre-push (+ type/lint/unit/cov/spec-conformance/deliverable-smoke) | all (default; full 15-stage gate, used by CI)").option("--json","emit structured per-stage results (machine-readable: findings with file/line/suggestion, untruncated) \u2014 for agents/CI; cuts RED\u2192fix round-trips").option("--feature ","scope the gate to this feature's modules[] (Gradle monorepos): runs only :project: tasks instead of the root aggregate. No-op for non-Gradle repos or modules-less features").action(l5e),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(e5e),t.command("done ").description("Mark a feature done ONLY if `clad check --tier=pre-push --strict` is GREEN (flip \u2192 gate \u2192 revert-on-red). Keeps `done` honest.").action(u5e),t.command("oracle [featureId]").description("Print the impl-blind oracle authoring brief (acceptance criteria + signatures, never the implementation). Hand it to a fresh blind sub-agent; record the result with clad_author_oracle. cladding calls no LLM. Use --required to list which done ACs the project policy needs an oracle for.").option("--ac ","restrict the brief to a single acceptance criterion").option("--required","list the done ACs the oracle_policy / require_oracles requires an oracle for (worklist), instead of a brief").option("--cwd ","project root (defaults to .)").action((r,n)=>d5e(r,n)),t.command("rollback ").description("Record a rollback event and print the maintainer-runnable git command for the latest checkpoint").option("-r, --reason ","optional free-text reason recorded on the event payload").action(t5e),t.command("status").description("Render the feature \xD7 stage integrity matrix (business titles; use --internal for raw F-NNN ids)").option("--internal","show internal F-NNN ids and stage codes").option("--json","emit the row model as JSON \u2014 the same feature \xD7 stage integrity matrix rendered to the terminal (columns + per-feature glyph cells), one SSoT for terminal, JSON, and the audit bundle").action(p5e),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(o5e),t.command("impact ").description("Print the blast radius for a change \u2014 what depends on a feature/file + the tests to re-run (F-7794a6bc)").option("--depth ","bound the dependent walk to N hops (default: the full transitive radius)").action((r,n)=>s5e(r,n)),t.command("verdict").description("One-poll loop decision: DONE|ITERATE|ESCALATE|BLOCKED|BOOTSTRAP over the pre-push strict gate + feature statuses (F-2e28cc72). Single gate touch; DONE requires \u22651 non-liveness proof.").option("--json","emit the verdict object as JSON").option("--tier ","gate tier (default pre-push)").action(r=>CX(r,{checkStages:$A})),t.command("infer-deps").description("Suggest feature depends_on edges from the code import graph \u2014 the dependency edges cladding never auto-produced (F-2be3e3bb). Prints reviewable suggestions; does not write the spec.").option("--ambiguity ","emit edges for imports owned by \u2264 N features (default 1 = unambiguous single-owner only)").action(r=>a5e(r)),t.command("measure").description("Report the search + context efficiency the graph provides per feature \u2014 working-set tokens vs the naive baseline, dependency depth/edges resolved, regression-set coverage (F-16138071). Deterministic; no agent.").option("--json","emit the full report as JSON").option("--sessions","summarize recorded value-delivery telemetry instead \u2014 impact-card fire rate over eligible edits, the per-reason skip histogram, and MCP read-serve counts. Measures DELIVERY (did the surfaces fire), NOT adoption (F-6ba22c5c).").option("--trend [n]","render the last N (default 5) recorded measure snapshots with signed deltas \u2014 spot efficiency drift over time from the deduped .cladding/measure.jsonl ledger (F-39609db4)").action(r=>c5e(r));let e=t.command("graph").description("Render the spec\u2194code\u2194doc knowledge graph for a viewer, or report its shape (F-569f4b37)");return e.command("export").description("Export the graph: mermaid/dot/json to stdout, or an Obsidian vault to --out").option("--format ","mermaid | dot | json | obsidian | html (default: mermaid). html = a single self-contained offline viewer (requires --out)").option("--focus ","restrict to a feature/file node\u2019s neighborhood (id, slug, or module path)").option("--depth ","neighborhood radius around --focus (default: unbounded)").option("--out ","write to a file (or, for obsidian, a vault dir \u2014 default .cladding/graph)").action(r=>ate(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>cte()),e.command("serve").description("Serve a LIVE graph at localhost \u2014 recomputes on each load + auto-reloads on spec/doc changes (F-64a5c159)").option("--port ","port to listen on (default 3000)").action(r=>{lte(r)}),t.command("changelog").description("Render shipped changes since a git ref into human-facing documents (F-904495a5). Default: capability-grouped markdown from feature titles + acceptance sentences (no internal ids). --json emits the deterministic manifest hosts render release notes from; --audit the id-keeping verification table; --catalog the full capability \u2192 feature \u2192 acceptance catalog.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--json","print the deterministic ChangelogManifest as JSON (byte-identical across runs on the same state)").option("--audit","print the audit table \u2014 feature | AC | EARS | verification refs, each marked resolved \u2713/\u2717").option("--catalog","print the full capability \u2192 feature \u2192 acceptance listing of the living spec (no git range)").option("--measure","embed the release's own re-derivable measurement \u2014 but ONLY a snapshot taken at the current HEAD; no match renders a not-measured notice, never an older snapshot (F-ede6fa75)").action(r=>dG(r)),t.command("report").description("Render one deterministic review packet for a git range (F-f6cc5e5a) \u2014 spec-shard movement (from the changelog), changed source files resolved to their owning features via the reverse index, the deduped regression set, and gate + attestation state. For PR reviewers, team-leads, and auditors: it RENDERS, it gates nothing. Byte-identical across two runs on the same repository state.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--format ","md (default, the four-section markdown packet) | sarif (SARIF 2.1.0 \u2014 one result per error/warn drift finding, for code-scanning UIs) | json (the raw deterministic model)").action(r=>SY(r)),t.command("bundle").description("Write ONE self-contained HTML audit bundle (F-e940fffe) a non-coder can double-click \u2014 offline, zero network, no CDN, no scripts. Contains the project header + inventory, the feature \xD7 stage matrix, the capability catalog, shipped changes for the range, the audit table with resolved refs, and the attestation summary, under a provenance banner (git HEAD, date, version). Deterministic modulo the date stamp. If no anchor ref resolves, the changelog + audit sections show an omitted notice while the rest still renders.").requiredOption("--out ","destination path for the HTML bundle").option("--since ","git ref to diff shipped changes from (default: the latest tag via `git describe --tags --abbrev=0`)").action(r=>h5e(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(g5e),t.command("hook ").description("Host hook protocol adapter \u2014 consume one host lifecycle event (SessionStart | UserPromptSubmit | PreToolUse | PostToolUse | Stop) as stdin JSON and print the protocol response on stdout. Always exits 0 so a hook failure never bricks the host session.").action($X),t.command("serve").description("Run cladding as an MCP server over stdio \u2014 tools/resources/prompts for any MCP client").option("--cwd ","project directory exposed to the client (default cwd)").action(J8e),t.command("doctor").description("Summarise .cladding/events.log.jsonl \u2014 sentinel-miss frequency by phase/cause/fallback plus the top missed sentinels (LLM dispatcher health check)").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").option("--hosts","smoke-test host CLIs (Claude Code / Gemini / Antigravity / Codex / Cursor) and project wiring \u2192 dated artifact + docs/dogfood/matrix.md. Live LLM prompts run only with consent (CLAD_HOST_SMOKE=1 or --yes); otherwise not-run").option("--yes","grant live-run consent for --hosts (equivalent to CLAD_HOST_SMOKE=1)").option("--matrix-only","regenerate docs/dogfood/matrix.md from the newest host-smoke artifact without any probing").action(r=>{if(r.hosts||r.matrixOnly){JY({cwd:r.cwd,yes:r.yes,matrixOnly:r.matrixOnly});return}$Y(r)}),t.command("clarify [answer...]").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, free text in any language, e.g. `clad clarify B2B only`); the LLM refines spec/docs based on the full Q-A history and may emit new follow-up questions. Reads/writes `.cladding/onboarding/state.yaml`. Requires `clad init ` to have started a session first.").option("--cwd ","project directory containing .cladding/onboarding/state.yaml (default cwd)").option("--no-llm","force the deterministic interpreter (preserves current artifacts, logs the answer)").option("--json","emit the raw RefineReport for tooling; default is the human-readable surface").action(Hee),t}var _5e=!!globalThis.__CLADDING_BUNDLED,b5e=_5e||import.meta.url===`file://${G.argv[1]}`;b5e&&y5e().parse();export{i5e as TIER_STAGES,y5e as createProgram,h5e as runBundleCommand,l5e as runCheckCommand,$A as runCheckStages,e5e as runCheckpointCommand,o5e as runContextCommand,u5e as runDoneCommand,s5e as runImpactCommand,a5e as runInferDepsCommand,Y8e as runInitCommand,c5e as runMeasureCommand,d5e as runOracleCommand,t5e as runRollbackCommand,g5e as runRouteCommand,X8e as runRunCommand,J8e as runServeCommand,r5e as runSetupCommand,p5e as runStatusCommand,Q8e as runSyncCommand,n5e as runUpdateCommand}; diff --git a/spec.yaml b/spec.yaml index 6e2d98b..4e60e9e 100644 --- a/spec.yaml +++ b/spec.yaml @@ -54,7 +54,7 @@ project: # Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand. inventory: - features: 258 + features: 259 scenarios: 2 capabilities: 6 - test_files: 240 + test_files: 241 diff --git a/spec/attestation.yaml b/spec/attestation.yaml index b8ea2bc..9c30a21 100644 --- a/spec/attestation.yaml +++ b/spec/attestation.yaml @@ -20,12 +20,12 @@ attested_modules: CHANGELOG.md: 9580bab8d2c2d6f3 CLAUDE.md: 16212c1749e6005d GOVERNANCE.md: 21cc28eaaf637a20 - README.html: 65afa8fb2869af33 - README.ja.md: 76c65fbe8ce375ca - README.ko.html: b2c64abdef027cfe - README.ko.md: ec85f7c80d28aa7f - README.md: f224c6b0c048758e - README.zh.md: cd06282ef042ad3a + README.html: 3197384b3b9b62fb + README.ja.md: 764f0146b5e91a4d + README.ko.html: 529cb8fa2ef27a4e + README.ko.md: a97a9dc37e486bff + README.md: 303d3546af18e97d + README.zh.md: 6566893a50fc81ef SECURITY.md: df1d0c80304b2f28 bin/clad: 77b80666665dd1b0 conformance/fixtures.yaml: 4b1b94dae1cd20b0 @@ -38,10 +38,10 @@ attested_modules: docs/ab-evaluation/README.md: 2467808b9871dcf0 docs/ab-evaluation/case-doverunner-scale.md: 2a435b6855823d41 docs/ab-evaluation/case-efficiency-measurement.md: 348aca146a7b2faa - docs/ab-evaluation/case-existing-adoption.md: d9d0d649861024ce + docs/ab-evaluation/case-existing-adoption.md: 65fabb08cec129e0 docs/ab-evaluation/case-graph-efficiency.md: 83d3956d14a1517d docs/ab-evaluation/case-iterative-vs-fixed-vapt.md: 1d242b8b6071f343 - docs/ab-evaluation/case-payment-saas.md: ca1a9a22b933c5cf + docs/ab-evaluation/case-payment-saas.md: a316271b319816f6 docs/ab-evaluation/case-working-set-landmine.md: b4f44dc463e99722 docs/ab-evaluation/summary.md: 59e527a531f13209 docs/b1-adoption-protocol.md: a041d8ad5ba1447f @@ -113,7 +113,7 @@ attested_modules: skills/serve/SKILL.md: f08bbdbbfeb05041 skills/status/SKILL.md: 09faadc50b3449da skills/sync/SKILL.md: 775c0f990a52a3d9 - spec.yaml: 877c1ca13475b185 + spec.yaml: 587a14fca8bdcd03 spec/README.md: 7c257426396d435c spec/architecture.yaml: f0888480405a13a8 spec/features/: a4d0f0eb87fed960 @@ -146,17 +146,17 @@ attested_modules: src/cli: a4d0f0eb87fed960 src/cli/benchmark.ts: 77f84d2a898d724f src/cli/changelog.ts: 2de1adb009b89ab4 - src/cli/clad.ts: 8c5e056a4eea223a + src/cli/clad.ts: 2f11ce5f158a44da src/cli/clarify.ts: 393cc93a6feb698a src/cli/doctor-hosts.ts: 1f0c2cec5a310b81 src/cli/doctor.ts: b98b955fe75e7f7e - src/cli/done.ts: 02bd4397eaf34fa1 + src/cli/done.ts: 7eba807b6ec5a1aa src/cli/enforcement-advisory.ts: 554a7b56475981c3 src/cli/graph-serve.ts: 23e6e389225d0f98 src/cli/graph.ts: bab410061b8c746a - src/cli/hook.ts: 21f22f6e565466d1 + src/cli/hook.ts: 19a40c6254d139a0 src/cli/host-onboarding.ts: b046571d4be7280c - src/cli/init.ts: 04135bc767e58e02 + src/cli/init.ts: fbd96fa32906313c src/cli/intent-from-path.ts: e69862821d979f22 src/cli/measure.ts: 3a562f16589e26c2 src/cli/report.ts: 911f859b2446834b @@ -327,7 +327,7 @@ attested_modules: src/ui: a4d0f0eb87fed960 src/ui/panel.ts: 8b78cb14dafb28fb src/ui/pulse.ts: ee4255f5c6e49f51 - src/ui/softShell.ts: 6db9d46de2d2e1b0 + src/ui/softShell.ts: 57a9b5d02fc94339 src/verdict/gate-progress.ts: ac75e3082cc97a40 src/verdict/verdict.ts: 493251b3a2c494d3 tests/adapters/anthropic.test.ts: fa2fc7faf032a782 @@ -673,6 +673,7 @@ attested_features: F-e8912be3: ok F-e940fffe: ok F-eb732f: ok + F-ebbb20af: ok F-ede6fa75: ok F-ee47fc2b: ok F-ee5f643e: ok diff --git a/spec/features/soft-shell-leak-closure-ebbb20af.yaml b/spec/features/soft-shell-leak-closure-ebbb20af.yaml new file mode 100644 index 0000000..c7651a3 --- /dev/null +++ b/spec/features/soft-shell-leak-closure-ebbb20af.yaml @@ -0,0 +1,50 @@ +id: F-ebbb20af +slug: soft-shell-leak-closure +title: "close Soft Shell jargon leaks and tighten the plain-language enforcement" +status: done +modules: + - src/ui/softShell.ts + - src/cli/clad.ts + - src/cli/done.ts + - src/cli/hook.ts + - src/cli/init.ts +acceptance_criteria: + - id: AC-77f0ec75 + test_refs: + - tests/soft-shell-leak-closure.test.ts + ears: state + condition: "while rendering user-facing output (the drift plain table, clad check/done messages)" + response: "use plain domain words (spec, spec entry, feature) and never the internal word 'shard'" + text: "While rendering user-facing output, the system shall never use the internal word 'shard' — it shall say spec, spec entry, or feature — so a reader who never saw the source is never shown a term only maintainers know." + notes: "Leaks the audit found: INVENTORY_DRIFT.lead (softShell.ts), the clad check footer (clad.ts), and the clad done git-op / no-feature refusals (done.ts). Iron Core surfaces (code comments, field names, persona prompts) keep 'shard' by design." + - id: AC-78c153fa + test_refs: + - tests/soft-shell-leak-closure.test.ts + ears: unwanted + condition: "if a user-facing card would surface a raw detector name or a raw stage id as its lead" + response: "render the plain-English lead instead, with any machine id demoted to a trailing tail" + text: "If a user-facing card would surface a raw detector name or a raw stage id as its lead, the system shall render the plain-English lead instead — the machine id may appear only as a demoted tail." + notes: "The SessionStart stop-block line led with failures[0].detector (a raw detector name); the clad sync deliverable note leaked a raw stage id (stage_2.4). Reuse plainLead (already imported in hook.ts)." + - id: AC-c7c1c6e1 + test_refs: + - tests/soft-shell-leak-closure.test.ts + ears: state + condition: "while writing the scenarios README (spec/scenarios/README.md) prose the user reads" + response: "name no MCP tool and no 'shard'" + text: "While generating the scenarios README prose, the system shall name no MCP tool (no clad_-shaped identifier) and shall not use the word 'shard', describing what happens in plain language instead." + notes: "init.ts wrote `clad_create_feature` into the scenarios README prose. The spec.yaml first line is a structured, documented, tier-tagged provenance banner (Tier A · Refreshed by: ), verified by verb-residue + tier-banner tests — that is Iron Core metadata, out of scope here, and keeps its verb clause." + - id: AC-0cece94c + test_refs: + - tests/plain-render.test.ts + - tests/human-first-cards.test.ts + ears: unwanted + condition: "if a future edit reintroduces 'shard' into a plain-table lead or a raw detector-name lead into a card" + response: "the plain-language enforcement tests shall fail" + text: "If a future edit reintroduces the word 'shard' into a DETECTOR_PLAIN lead, or a raw detector-name lead into a driven card, the tightened enforcement tests shall fail, so these leaks cannot recur." + notes: "plain-render.test.ts scanned only `action` for MCP names; extend it to scan each `lead` for 'shard'. human-first-cards.test.ts banned MCP names + 'shard' per line; extend the stop-block case so a raw detector-name lead fails." + - id: AC-408e6838 + test_refs: + - tests/soft-shell-leak-closure.test.ts + ears: ubiquitous + text: "The behavior-triggered signals (the unbound-edit nudge and the enforcement advisory) shall fire from the same single English source regardless of the user's language — an all-non-ASCII spec (titles, paths) still triggers them — so the host can relay one message into any language." + notes: "cladding emits one English string; the host AI relays it into the user's language (instruction-led-language: English-only catalog, no locale keys). Firing is behavior-driven (edits, spec status), so it is language-agnostic by construction; this AC pins that." diff --git a/spec/index.yaml b/spec/index.yaml index 48e0816..3a0d0d9 100644 --- a/spec/index.yaml +++ b/spec/index.yaml @@ -247,6 +247,7 @@ features: F-e8912be3: {slug: status-aware-missing-impl, status: done, modules: 3} F-e940fffe: {slug: audit-bundle-html, status: done, modules: 3} F-eb732f: {slug: spec-authoring-anti-hollow, status: done, modules: 2} + F-ebbb20af: {slug: soft-shell-leak-closure, status: done, modules: 5} F-ede6fa75: {slug: self-measuring-release, status: done, modules: 3} F-ee47fc2b: {slug: reverse-index-core, status: done, modules: 1} F-ee5f643e: {slug: doc-graph-links, status: done, modules: 5} diff --git a/src/cli/clad.ts b/src/cli/clad.ts index 2e241e8..f658030 100644 --- a/src/cli/clad.ts +++ b/src/cli/clad.ts @@ -301,7 +301,7 @@ export function runSyncCommand(opts: {proposeArchive?: boolean} = {}): void { pulse( 'note', 'deliverable', - `auto-detected entry '${autoDeliverable.path}' — the gate now smoke-tests it (stage_2.4). Opt out with is_safe_to_smoke: false.`, + `auto-detected entry '${autoDeliverable.path}' — the gate now smoke-tests it. Opt out with is_safe_to_smoke: false.`, ); } } @@ -675,7 +675,7 @@ export function runCheckStages(opts: {internal?: boolean; strict?: boolean; tier // agent fixes in one pass instead of re-running to discover where + what. process.stdout.write(`${JSON.stringify({tier, worst, anyFailed, stages: collected}, null, 2)}\n`); } else if (anyFailed && !silent) { - process.stdout.write('\nℹ Run `clad doctor` for the event log, or `clad sync` to validate spec shards. Drift findings above name the offending detector.\n'); + process.stdout.write('\nℹ Run `clad doctor` for the event log, or `clad sync` to check the spec. The findings above say what drifted and why.\n'); } // F-b84c38 — verification freshness needs a data source: every tier run // lands in the ledger (best-effort, deduped per identical HEAD/tier/strict/ diff --git a/src/cli/done.ts b/src/cli/done.ts index 9ea18a6..ce7e227 100644 --- a/src/cli/done.ts +++ b/src/cli/done.ts @@ -135,7 +135,7 @@ export function runDone(cwd: string, featureId: string, deps: DoneDeps): DoneRes featureId, reason: `${op} in progress — refusing done until the tree settles.` + - ` Complete or abort the ${op}, then re-run \`clad done\`. No shard, attestation, or index was written.`, + ` Complete or abort the ${op}, then re-run \`clad done\`. Nothing in the spec or its records was changed.`, }; } const hit = findShardFile(cwd, featureId); @@ -145,7 +145,7 @@ export function runDone(cwd: string, featureId: string, deps: DoneDeps): DoneRes code: 1, featureId, reason: - `no feature shard under spec/features/ declares id '${featureId}'` + + `no feature in the spec declares id '${featureId}'` + ' (inline features: edit spec.yaml then run `clad check --tier=pre-push --strict` manually)', }; } diff --git a/src/cli/hook.ts b/src/cli/hook.ts index a5e4af6..33541bb 100644 --- a/src/cli/hook.ts +++ b/src/cli/hook.ts @@ -200,7 +200,9 @@ function renderSessionStartCard(cwd: string): string { if (existsSync(blockPath)) { try { const sb = JSON.parse(readFileSync(blockPath, 'utf8')) as {count?: unknown; first?: unknown}; - lines.push(`unresolved stop-block: ${Number(sb.count ?? 0)} finding(s) — ${asString(sb.first) || 'unknown'}`); + // Plain-first (AC-78c153fa): sb.first is a raw detector name; render its + // plain lead so the card never surfaces the internal id as its lead. + lines.push(`unresolved stop-block: ${Number(sb.count ?? 0)} finding(s) — ${plainLead(asString(sb.first), 'a prior check')}`); } catch { /* unreadable block file → omit the resurface line */ } diff --git a/src/cli/init.ts b/src/cli/init.ts index fb21f82..eb277a4 100644 --- a/src/cli/init.ts +++ b/src/cli/init.ts @@ -101,11 +101,9 @@ const SCENARIOS_README = [ 'Scenarios in cladding capture **user journeys** — the business flows your', 'system enables, not the architecture layers your code is organised into.', '', - 'You do not author scenario YAML by hand. They are auto-registered when you', - 'request a feature through natural-language conversation with your AI host —', - 'the host invokes the `clad` CLI (or the `clad_create_feature` MCP tool when', - 'cladding is wired as an MCP server). The scenario your request belongs to is', - 'inferred together with the feature itself.', + 'You do not author scenario YAML by hand. They are registered for you when you', + 'ask your AI assistant to add a feature in ordinary conversation. The scenario', + 'your request belongs to is inferred together with the feature itself.', '', 'This directory is intentionally empty at scan time. The first scenario lands', 'when you ship the first feature.', @@ -123,7 +121,7 @@ const SCENARIOS_README = [ '', '- `docs/conventions.md` — observed conventions (auto-generated)', '- `spec/architecture.yaml` — observed layers + forbidden_imports candidates', - '- `spec.yaml` — feature registry (grown by clad_create_feature)', + '- `spec.yaml` — feature registry (grown as you add features in conversation)', '', ].join('\n'); diff --git a/src/ui/softShell.ts b/src/ui/softShell.ts index 62d4cd7..e58a970 100644 --- a/src/ui/softShell.ts +++ b/src/ui/softShell.ts @@ -165,7 +165,7 @@ export const DETECTOR_PLAIN: Readonly> = { FIXTURE_REFERENCE_INVALID: {lead: 'A criterion refers to a test fixture that is not registered', action: 'register the fixture or fix the reference name'}, SLUG_CONFLICT: {lead: 'Two features or two scenarios share the same short name', action: 'rename one so each short name is unique'}, ID_COLLISION: {lead: 'Two features or two scenarios share the same id', action: 'give one of them a new id'}, - INVENTORY_DRIFT: {lead: 'The spec summary counts do not match the shard files on disk', action: 'run `clad sync` to refresh the counts'}, + INVENTORY_DRIFT: {lead: 'The spec summary counts do not match the spec files on disk', action: 'run `clad sync` to refresh the counts'}, AC_DUPLICATE_WITHIN_FEATURE: {lead: 'The same criterion id appears twice inside one feature', action: 'renumber or remove the duplicate criterion'}, ARCHITECTURE_FROM_SPEC: {lead: 'The code imports across layers in a way the architecture rules forbid', action: 'remove the cross-layer import or update the architecture rules'}, CAPABILITIES_FEATURE_MAPPING: {lead: 'A capability lists a feature id that does not exist', action: 'fix the capability feature list'}, diff --git a/tests/cli/done.test.ts b/tests/cli/done.test.ts index 6043027..aee75d0 100644 --- a/tests/cli/done.test.ts +++ b/tests/cli/done.test.ts @@ -219,14 +219,14 @@ describe('runDone', () => { expect(res.reason).toContain('feature id required'); }); - test('no matching shard → code 1 with "no feature shard"', () => { + test('no matching feature → code 1 with "no feature in the spec"', () => { // spec/features/ does not exist at all. const res = runDone(dir, FEATURE_ID, { checkStages: () => ({worst: 0}), }); expect(res.ok).toBe(false); expect(res.code).toBe(1); - expect(res.reason).toContain('no feature shard'); + expect(res.reason).toContain('no feature in the spec'); }); test('flip precedes the gate — the gate sees status: done already on disk', () => { @@ -321,7 +321,7 @@ describe('runDone git-operation guard (F-10cc42d1 · AC-611089cf)', () => { const res = runDone(dir, 'F-nomatch', {checkStages: () => ({worst: 0}), gitOpInProgress: () => 'merge'}); expect(res.ok).toBe(false); expect(res.reason).toContain('merge'); - expect(res.reason).not.toContain('no feature shard'); + expect(res.reason).not.toContain('no feature in the spec'); }); test('a null probe leaves the transition unguarded — the GREEN path still flips to done', () => { diff --git a/tests/cli/hook.test.ts b/tests/cli/hook.test.ts index e3c0172..7c29f8d 100644 --- a/tests/cli/hook.test.ts +++ b/tests/cli/hook.test.ts @@ -93,7 +93,7 @@ describe('SessionStart — context card', () => { expect(lines[0]).toBe('cladding: 3 features (1 done, 1 in progress) · 2 scenarios'); expect(lines[1]).toBe('in progress: F-bbb222 beta'); expect(lines[2]).toBe('last gate: pre-push strict=true → GREEN @ abcdef12'); - expect(lines[3]).toBe('unresolved stop-block: 2 finding(s) — AC_DRIFT'); + expect(lines[3]).toBe('unresolved stop-block: 2 finding(s) — An acceptance criterion is incomplete or out of sync with the spec'); // context capability line precedes policy; no ai_hints → no prefer lines. Both lines are // plain English with NO MCP tool names / no "shard" / no "SSoT" (F-f46d5c61, AC-2c63b999). expect(lines[4]).toBe( diff --git a/tests/human-first-cards.test.ts b/tests/human-first-cards.test.ts index f312dea..a650775 100644 --- a/tests/human-first-cards.test.ts +++ b/tests/human-first-cards.test.ts @@ -185,6 +185,9 @@ describe('AC-2c63b999 — zero MCP tool names, zero the retired term, on every u // vacuous-render guard: this must actually be the RICH multi-line card, not a degenerate one. expect(card.split('\n').length).toBeGreaterThanOrEqual(6); for (const line of card.split('\n')) expectHumanFirst(line, `SessionStart line "${line}"`); + // F-ebbb20af AC-78c153fa — the stop-block line is seeded with the raw detector + // name AC_DRIFT; it must be rendered as its plain lead, never surfaced raw. + expect(card, 'stop-block line must not surface the raw detector name').not.toContain('AC_DRIFT'); }); const PROMPT_SAMPLES: Readonly> = { diff --git a/tests/plain-render.test.ts b/tests/plain-render.test.ts index 433a61f..1bb0857 100644 --- a/tests/plain-render.test.ts +++ b/tests/plain-render.test.ts @@ -123,6 +123,20 @@ describe('DETECTOR_PLAIN catalog completeness (AC-746969b3)', () => { const actions = names.map((n) => DETECTOR_PLAIN[n].action).filter((a): a is string => Boolean(a)); expect(actions.some((a) => a.includes('clad '))).toBe(true); }); + + // F-ebbb20af AC-0cece94c — the leak that slipped past the action-only scan: + // INVENTORY_DRIFT.lead said "shard files". Scan LEADS too, for the internal + // word "shard" and for any MCP tool name. + test('no lead uses the internal word "shard" or names an MCP tool (and no action says "shard")', () => { + const shardWord = /\bshards?\b/i; + const mcpShapePattern = /\bclad_[a-z_]+/; + for (const name of names) { + const {lead, action} = DETECTOR_PLAIN[name]; + expect(lead, `${name}.lead must not say "shard"`).not.toMatch(shardWord); + expect(lead, `${name}.lead must not name an MCP tool`).not.toMatch(mcpShapePattern); + if (action) expect(action, `${name}.action must not say "shard"`).not.toMatch(shardWord); + } + }); }); // ─── AC-263adf79 — plain lead first, machine detail demoted to a tail ────── diff --git a/tests/soft-shell-leak-closure.test.ts b/tests/soft-shell-leak-closure.test.ts new file mode 100644 index 0000000..3cda03c --- /dev/null +++ b/tests/soft-shell-leak-closure.test.ts @@ -0,0 +1,106 @@ +// Cladding · F-ebbb20af — Soft Shell leak closure + language-agnostic firing. +// +// Proves the closed leaks stay closed (no "shard"/MCP name in user-facing output +// or generated files; a stop-block renders a plain lead, not a raw detector id) +// and that the behavior-triggered signals fire from one English source regardless +// of the user's language (an all-Korean spec still triggers them). + +import {existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync} from 'node:fs'; +import {tmpdir} from 'node:os'; +import {join} from 'node:path'; + +import {afterEach, beforeEach, describe, expect, test, vi} from 'vitest'; + +type DriftReport = {pass: boolean; exitCode: number; findings: unknown[]}; +const DRIFT_CLEAN: DriftReport = {pass: true, exitCode: 0, findings: []}; +vi.mock('../src/stages/drift.js', () => ({runDrift: () => DRIFT_CLEAN})); +vi.mock('../src/stages/arch.js', () => ({runArch: () => ({pass: true, exitCode: 0})})); +vi.mock('../src/stages/secret.js', () => ({runSecret: () => ({pass: true, exitCode: 0})})); + +const {DETECTOR_PLAIN, plainLead} = await import('../src/ui/softShell.js'); +const {runDone} = await import('../src/cli/done.js'); +const {enforcementAdvisory} = await import('../src/cli/enforcement-advisory.js'); +const {runInit} = await import('../src/cli/init.js'); +const {runHookEvent} = await import('../src/cli/hook.js'); + +const SHARD = /\bshards?\b/i; +const MCP = /\bclad_[a-z_]+/; +const NUDGE = "recent source edits aren't tracked by any feature"; + +let dir: string; +beforeEach(() => { + dir = mkdtempSync(join(tmpdir(), 'clad-ssl-')); +}); +afterEach(() => { + rmSync(dir, {recursive: true, force: true}); + vi.clearAllMocks(); +}); + +describe('F-ebbb20af — Soft Shell leak closure', () => { + test('AC-77f0ec75 — the INVENTORY_DRIFT lead says "spec", not "shard"', () => { + expect(DETECTOR_PLAIN.INVENTORY_DRIFT.lead).not.toMatch(SHARD); + expect(DETECTOR_PLAIN.INVENTORY_DRIFT.lead).toContain('spec'); + }); + + test('AC-77f0ec75 — the clad done no-feature refusal says "spec", not "shard"', () => { + writeFileSync(join(dir, 'spec.yaml'), 'schema: "0.1"\nproject: {name: t, language: typescript}\nfeatures: []\n'); + const res = runDone(dir, 'F-nope', {checkStages: () => ({worst: 0})}); + expect(res.ok).toBe(false); + expect(res.reason).not.toMatch(SHARD); + expect(res.reason).toContain('no feature in the spec'); + }); + + test('AC-78c153fa — a stop-block detector renders its plain lead, never the raw id', () => { + expect(plainLead('AC_DRIFT', 'a prior check')).toBe(DETECTOR_PLAIN.AC_DRIFT.lead); + expect(plainLead('AC_DRIFT', 'a prior check')).not.toBe('AC_DRIFT'); + // an unregistered detector falls back to a plain phrase, not the raw token + expect(plainLead('WEIRD_UNREGISTERED', 'a prior check')).toBe('a prior check'); + }); + + test('AC-c7c1c6e1 — the init-generated scenarios README prose names no MCP tool and no "shard"', async () => { + await runInit({cwd: dir}); + const readmePath = join(dir, 'spec', 'scenarios', 'README.md'); + expect(existsSync(readmePath), 'scenarios README should be generated').toBe(true); + const readme = readFileSync(readmePath, 'utf8'); + expect(readme, 'scenarios README').not.toMatch(MCP); + expect(readme, 'scenarios README').not.toMatch(SHARD); + }); + + // ── per-language firing: one English source, triggered by behavior, not words ── + + // NOTE: by design a slug is a machine id (ASCII kebab-case, schema-pinned); + // the human-facing title, project name, and AC text are any language. So the + // realistic Korean project keeps ASCII slugs and Korean everywhere a human reads. + test('AC-408e6838 — the enforcement advisory fires on a spec with Korean title/name/text', () => { + writeFileSync( + join(dir, 'spec.yaml'), + 'schema: "0.1"\nproject: {name: 한글프로젝트, language: typescript}\nfeatures:\n' + + ' - id: F-aaa111\n slug: login\n title: 사용자 로그인 기능\n status: in_progress\n' + + ' modules: [src/login.ts]\n acceptance_criteria:\n' + + ' - id: AC-001\n ears: ubiquitous\n text: 사용자는 로그인할 수 있어야 한다\n', + ); + const out = enforcementAdvisory(dir); + expect(out).toBeTypeOf('string'); // fires despite non-ASCII human content + expect(out).toContain('not yet done'); + }); + + test('AC-408e6838 — the unbound-edit nudge fires on a Korean-named path under a Korean-titled spec', () => { + writeFileSync( + join(dir, 'spec.yaml'), + 'schema: "0.1"\nproject: {name: 프로젝트, language: typescript}\nfeatures:\n' + + ' - id: F-aaa111\n slug: alpha\n title: 알파 기능\n status: done\n' + + ' modules: [src/foo.ts]\n acceptance_criteria:\n' + + ' - id: AC-001\n ears: ubiquitous\n text: t\n', + ); + const editKoreanUnbound = (): string => { + rmSync(join(dir, '.cladding', 'hook-drift-ts'), {force: true}); + return runHookEvent('PostToolUse', { + tool_name: 'Edit', + tool_input: {file_path: 'src/주문처리.ts', old_string: '', new_string: '한'.repeat(60)}, + }, dir); + }; + expect(editKoreanUnbound()).not.toContain(NUDGE); // 1 + expect(editKoreanUnbound()).not.toContain(NUDGE); // 2 + expect(editKoreanUnbound()).toContain(NUDGE); // 3 — fires regardless of language + }); +}); From f682eedb53bb6a5dd437b1480b73af855d1d5278 Mon Sep 17 00:00:00 2001 From: qwerfunch Date: Tue, 21 Jul 2026 00:04:35 +0900 Subject: [PATCH 4/6] feat(cycle): catch code-ahead-of-spec at the handoff and the resting state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A real dogfood exposed the failure the unbound-edit nudge only partially covers: after onboarding, a host read "ordinary development can begin" as "write code now" and scaffolded a whole project with features: [] — the feature cycle never started, and cladding stayed silent (the nudge is reactive and source-edit-triggered; the enforcement advisory needs an undone feature; no detector flags a young project's unbound code). The fix layers the signal across every moment the cycle can be skipped, with the gate as the only hard backstop. - Onboarding handoff (F-195cb59e): the init host instruction and the CLI clarify completion now steer to authoring the first feature's spec — its acceptance criteria and the files it will cover — BEFORE writing code, instead of a bare "ordinary development can begin". Names WHAT the spec contains, in plain language, across all four host mirrors. - Cold-start / resting state (F-be5306eb): a graduated featureCycleAdvisory — the cold-start signal ("source code but no feature specs — the cycle hasn't started") when un-started, else the enforcement advisory — surfaced at the SessionStart card (every session) and the clad check footer. Source presence is detected with the scan walker (vendor dirs ignored, early exit). Non-blocking; never changes the exit status. Layers: ① handoff steer · ② the existing unbound-edit nudge (in-flight) · ③ SessionStart + clad check cold-start signal · hard backstop = the gate (UNMAPPED_ARTIFACT once ≥8 features, clad done honesty). Re-verified live: a features:[] + code project now surfaces the cold-start signal via both clad check and the SessionStart card; the handoff steer reached every host. Both features authored spec-first; strict pre-push gate GREEN — 2602 tests, 41 detectors, 261 features (258 done). Co-Authored-By: Claude Opus 4.8 --- README.html | 8 +- README.ja.md | 4 +- README.ko.html | 8 +- README.ko.md | 4 +- README.md | 4 +- README.zh.md | 4 +- plugins/antigravity/skills/init/SKILL.md | 2 +- plugins/claude-code/commands/init.md | 2 +- plugins/claude-code/dist/clad.js | 731 +++++++++--------- plugins/codex/skills/init/SKILL.md | 2 +- plugins/gemini-cli/commands/init.toml | 2 +- skills/init/SKILL.md | 2 +- spec.yaml | 4 +- spec/attestation.yaml | 32 +- .../cold-start-cycle-signal-be5306eb.yaml | 41 + .../onboarding-handoff-steer-195cb59e.yaml | 32 + spec/index.yaml | 2 + src/cli/clad.ts | 9 +- src/cli/clarify.ts | 5 +- src/cli/enforcement-advisory.ts | 59 +- src/cli/hook.ts | 5 + tests/cli/clarify.test.ts | 6 + tests/cli/cold-start-signal.test.ts | 49 ++ tests/cli/enforcement-advisory.test.ts | 45 +- tests/cli/onboarding-handoff-steer.test.ts | 33 + 25 files changed, 676 insertions(+), 419 deletions(-) create mode 100644 spec/features/cold-start-cycle-signal-be5306eb.yaml create mode 100644 spec/features/onboarding-handoff-steer-195cb59e.yaml create mode 100644 tests/cli/cold-start-signal.test.ts create mode 100644 tests/cli/onboarding-handoff-steer.test.ts diff --git a/README.html b/README.html index 6d96be0..5e7a96b 100644 --- a/README.html +++ b/README.html @@ -233,7 +233,7 @@

cladding

ironclad spec - tests + tests detectors license

@@ -548,7 +548,7 @@

Status

tests
-
2593/2593
+
2602/2602
all pass
@@ -558,8 +558,8 @@

Status

features
-
259
-
256 done · self-spec
+
261
+
258 done · self-spec
diff --git a/README.ja.md b/README.ja.md index a09ad19..d6f5ee6 100644 --- a/README.ja.md +++ b/README.ja.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -339,7 +339,7 @@ clad update # 3. プロジェクト接続と派生状態を更新 | Version | 準拠レベル | Tests | Gate | Features | |---|---|---|---|---| -| v0.9.0(2026-07) | L4 · [自己申告](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2593 / 2593 | 15 段階 · 41 detectors | 259(256 done) | +| v0.9.0(2026-07) | L4 · [自己申告](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2602 / 2602 | 15 段階 · 41 detectors | 261(258 done) | 236 test files · capability 6 個 · カバレッジ低下は COVERAGE_DROP detector がブロック diff --git a/README.ko.html b/README.ko.html index 70669f3..c304e32 100644 --- a/README.ko.html +++ b/README.ko.html @@ -275,7 +275,7 @@

cladding

ironclad spec - tests + tests detectors license

@@ -584,7 +584,7 @@

Status

tests
-
2593/2593
+
2602/2602
all pass
@@ -594,8 +594,8 @@

Status

features
-
259
-
256 done · 자기 스펙
+
261
+
258 done · 자기 스펙
diff --git a/README.ko.md b/README.ko.md index adb9e99..3d9db6d 100644 --- a/README.ko.md +++ b/README.ko.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -338,7 +338,7 @@ clad update # 3. 프로젝트 연결과 파생 데이터를 함께 | version | 준수 등급 | tests | gate | features | |---|---|---|---|---| -| v0.9.0 · 2026-07 | L4 · [L0–L4 중 최고 · 자가 선언](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2593 / 2593 · all pass | 15 단계 · 41 detectors | 259 · 256 done · 자기 스펙 | +| v0.9.0 · 2026-07 | L4 · [L0–L4 중 최고 · 자가 선언](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2602 / 2602 · all pass | 15 단계 · 41 detectors | 261 · 258 done · 자기 스펙 | 236 test files · capability 6개 · coverage는 COVERAGE_DROP detector가 하락 차단 diff --git a/README.md b/README.md index cc30760..979e893 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -352,7 +352,7 @@ Reconcile the drift the update flagged. | Version | Conformance | Tests | Gate | Features | |---|---|---|---|---| -| v0.9.0 (2026-07) | L4 · [self-declared](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2593 / 2593 | 15 stages · 41 detectors | 259 (256 done) | +| v0.9.0 (2026-07) | L4 · [self-declared](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2602 / 2602 | 15 stages · 41 detectors | 261 (258 done) | 236 test files · 6 capabilities · coverage drop blocked by the COVERAGE_DROP detector diff --git a/README.zh.md b/README.zh.md index efe9b31..12839a2 100644 --- a/README.zh.md +++ b/README.zh.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -335,7 +335,7 @@ clad update # 3. 刷新项目连接和派生状态 | 版本 | 一致性 | Tests | Gate | Features | |---|---|---|---|---| -| v0.9.0(2026-07) | L4 · [自我声明](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2593 / 2593 | 15 阶段 · 41 检测器 | 259(256 done) | +| v0.9.0(2026-07) | L4 · [自我声明](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2602 / 2602 | 15 阶段 · 41 检测器 | 261(258 done) | 236 个测试文件 · 6 项 capability · 覆盖率下降由 COVERAGE_DROP 检测器拦下 diff --git a/plugins/antigravity/skills/init/SKILL.md b/plugins/antigravity/skills/init/SKILL.md index 1de064d..a7cb315 100644 --- a/plugins/antigravity/skills/init/SKILL.md +++ b/plugins/antigravity/skills/init/SKILL.md @@ -19,7 +19,7 @@ If the current user message itself matches `APPLY CLADDING XXXXXX`, do not call 3. Read the returned prompt and observations. Draft the structured object required by `clad_init` using the current host model, then call `clad_stage_init` with the preparation token and that draft. Staging validates the draft and stores only ignored runtime state under `.cladding/host/`; it does not modify authored project files. 4. Show `plannedChanges`, the staged `confirmationQuestion`, and its one-time `approvalChallenge` to the user, then stop and wait for a separate reply. The original initialization request is not confirmation. 5. Only when the user's separate reply exactly matches `approvalChallenge`, call `clad_init` with the entire reply verbatim as `confirmation`—never strip the `APPLY CLADDING` prefix. Include the draft and token when the host retained them; process-per-turn hosts may omit both because Cladding resolves the exact staged draft from its short-lived machine-local cache. Questions, paraphrases, and generic acknowledgements are not approval. -6. If `nextQuestion` is present, show it verbatim and end the assistant turn immediately. Never answer it, infer an answer, or call either clarify tool during the initialization-approval turn. Continue with the Cladding clarify workflow only after a new user message supplies the answer. If no question remains, report that ordinary development can begin. +6. If `nextQuestion` is present, show it verbatim and end the assistant turn immediately. Never answer it, infer an answer, or call either clarify tool during the initialization-approval turn. Continue with the Cladding clarify workflow only after a new user message supplies the answer. If no question remains, report that onboarding is complete and that the next step is to author the first feature's spec — its acceptance criteria and the files it will cover — before writing any code; the feature cycle starts there, not with scaffolding. Do not run `clad init` in a shell from an AI-host onboarding session. Do not use MCP sampling. If the MCP tools are absent, tell the user to run `clad setup`, restart the AI host in the project directory, and stop without writing project files. diff --git a/plugins/claude-code/commands/init.md b/plugins/claude-code/commands/init.md index 1de064d..a7cb315 100644 --- a/plugins/claude-code/commands/init.md +++ b/plugins/claude-code/commands/init.md @@ -19,7 +19,7 @@ If the current user message itself matches `APPLY CLADDING XXXXXX`, do not call 3. Read the returned prompt and observations. Draft the structured object required by `clad_init` using the current host model, then call `clad_stage_init` with the preparation token and that draft. Staging validates the draft and stores only ignored runtime state under `.cladding/host/`; it does not modify authored project files. 4. Show `plannedChanges`, the staged `confirmationQuestion`, and its one-time `approvalChallenge` to the user, then stop and wait for a separate reply. The original initialization request is not confirmation. 5. Only when the user's separate reply exactly matches `approvalChallenge`, call `clad_init` with the entire reply verbatim as `confirmation`—never strip the `APPLY CLADDING` prefix. Include the draft and token when the host retained them; process-per-turn hosts may omit both because Cladding resolves the exact staged draft from its short-lived machine-local cache. Questions, paraphrases, and generic acknowledgements are not approval. -6. If `nextQuestion` is present, show it verbatim and end the assistant turn immediately. Never answer it, infer an answer, or call either clarify tool during the initialization-approval turn. Continue with the Cladding clarify workflow only after a new user message supplies the answer. If no question remains, report that ordinary development can begin. +6. If `nextQuestion` is present, show it verbatim and end the assistant turn immediately. Never answer it, infer an answer, or call either clarify tool during the initialization-approval turn. Continue with the Cladding clarify workflow only after a new user message supplies the answer. If no question remains, report that onboarding is complete and that the next step is to author the first feature's spec — its acceptance criteria and the files it will cover — before writing any code; the feature cycle starts there, not with scaffolding. Do not run `clad init` in a shell from an AI-host onboarding session. Do not use MCP sampling. If the MCP tools are absent, tell the user to run `clad setup`, restart the AI host in the project directory, and stop without writing project files. diff --git a/plugins/claude-code/dist/clad.js b/plugins/claude-code/dist/clad.js index 53ca56f..8fec559 100755 --- a/plugins/claude-code/dist/clad.js +++ b/plugins/claude-code/dist/clad.js @@ -4,66 +4,66 @@ const require = __claddingCreateRequire(import.meta.url); // Marker for stages/*.ts: when true, the per-stage CLI-entry guard // short-circuits so the bundle doesn't fire every stage at startup. globalThis.__CLADDING_BUNDLED = true; -var Mde=Object.create;var kA=Object.defineProperty;var Fde=Object.getOwnPropertyDescriptor;var Lde=Object.getOwnPropertyNames;var zde=Object.getPrototypeOf,Ude=Object.prototype.hasOwnProperty;var Ge=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pr=(t,e)=>{for(var r in e)kA(t,r,{get:e[r],enumerable:!0})},qde=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Lde(e))!Ude.call(t,i)&&i!==r&&kA(t,i,{get:()=>e[i],enumerable:!(n=Fde(e,i))||n.enumerable});return t};var St=(t,e,r)=>(r=t!=null?Mde(zde(t)):{},qde(e||!t||!t.__esModule?kA(r,"default",{value:t,enumerable:!0}):r,t));var nf=v(AA=>{var _y=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},EA=class extends _y{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};AA.CommanderError=_y;AA.InvalidArgumentError=EA});var by=v(OA=>{var{InvalidArgumentError:Bde}=nf(),TA=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Bde(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Hde(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}OA.Argument=TA;OA.humanReadableArgName=Hde});var PA=v(IA=>{var{humanReadableArgName:Gde}=by(),RA=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Gde(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),s.join(` -`)}displayWidth(e){return l4(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),c=2,u=(this.helpWidth??80)-r-c-2,d;return utypeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Pr=(t,e)=>{for(var r in e)EA(t,r,{get:e[r],enumerable:!0})},Bde=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of zde(e))!qde.call(t,i)&&i!==r&&EA(t,i,{get:()=>e[i],enumerable:!(n=Lde(e,i))||n.enumerable});return t};var St=(t,e,r)=>(r=t!=null?Fde(Ude(t)):{},Bde(e||!t||!t.__esModule?EA(r,"default",{value:t,enumerable:!0}):r,t));var nf=v(TA=>{var by=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},AA=class extends by{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};TA.CommanderError=by;TA.InvalidArgumentError=AA});var vy=v(RA=>{var{InvalidArgumentError:Hde}=nf(),OA=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Hde(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Gde(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}RA.Argument=OA;RA.humanReadableArgName=Gde});var CA=v(PA=>{var{humanReadableArgName:Zde}=vy(),IA=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Zde(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),s.join(` +`)}displayWidth(e){return u4(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),c=2,u=(this.helpWidth??80)-r-c-2,d;return u{let a=s.match(i);if(a===null){o.push("");return}let c=[a.shift()],l=this.displayWidth(c[0]);a.forEach(u=>{let d=this.displayWidth(u);if(l+d<=r){c.push(u),l+=d;return}o.push(c.join(""));let f=u.trimStart();c=[f],l=this.displayWidth(f)}),o.push(c.join(""))}),o.join(` -`)}};function l4(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}IA.Help=RA;IA.stripColor=l4});var jA=v(NA=>{var{InvalidArgumentError:Zde}=nf(),CA=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Vde(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Zde(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?u4(this.name().replace(/^no-/,"")):u4(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},DA=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function u4(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Vde(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a} +`)}};function u4(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}PA.Help=IA;PA.stripColor=u4});var MA=v(jA=>{var{InvalidArgumentError:Vde}=nf(),DA=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Wde(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Vde(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?d4(this.name().replace(/^no-/,"")):d4(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},NA=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function d4(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Wde(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a} - a short flag is a single dash and a single character - either use a single dash and a single character (for a short flag) - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a} - too many short flags`):i.test(s)?new Error(`${a} - too many long flags`):new Error(`${a} -- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}NA.Option=CA;NA.DualOptions=DA});var f4=v(d4=>{function Wde(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function Kde(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=Wde(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(as.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?` +- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}jA.Option=DA;jA.DualOptions=NA});var p4=v(f4=>{function Kde(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function Jde(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=Kde(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(as.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?` (Did you mean one of ${n.join(", ")}?)`:n.length===1?` -(Did you mean ${n[0]}?)`:""}d4.suggestSimilar=Kde});var g4=v(UA=>{var Jde=Ge("node:events").EventEmitter,MA=Ge("node:child_process"),fo=Ge("node:path"),vy=Ge("node:fs"),Be=Ge("node:process"),{Argument:Yde,humanReadableArgName:Xde}=by(),{CommanderError:FA}=nf(),{Help:Qde,stripColor:efe}=PA(),{Option:p4,DualOptions:tfe}=jA(),{suggestSimilar:m4}=f4(),LA=class t extends Jde{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>Be.stdout.write(r),writeErr:r=>Be.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>Be.stdout.isTTY?Be.stdout.columns:void 0,getErrHelpWidth:()=>Be.stderr.isTTY?Be.stderr.columns:void 0,getOutHasColors:()=>zA()??(Be.stdout.isTTY&&Be.stdout.hasColors?.()),getErrHasColors:()=>zA()??(Be.stderr.isTTY&&Be.stderr.hasColors?.()),stripColor:r=>efe(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return i&&(c.description(i),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Qde,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name -- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new Yde(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'. -Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new FA(e,r,n)),Be.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new p4(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}' -- already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,s):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof p4)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,l)=>{let u=a.exec(c);return u?u[0]:l},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){Be.versions?.electron&&(r.from="electron");let i=Be.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=Be.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":Be.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true. -- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,n){if(vy.existsSync(e))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist +(Did you mean ${n[0]}?)`:""}f4.suggestSimilar=Jde});var y4=v(qA=>{var Yde=Ge("node:events").EventEmitter,FA=Ge("node:child_process"),fo=Ge("node:path"),Sy=Ge("node:fs"),Be=Ge("node:process"),{Argument:Xde,humanReadableArgName:Qde}=vy(),{CommanderError:LA}=nf(),{Help:efe,stripColor:tfe}=CA(),{Option:m4,DualOptions:rfe}=MA(),{suggestSimilar:h4}=p4(),zA=class t extends Yde{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>Be.stdout.write(r),writeErr:r=>Be.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>Be.stdout.isTTY?Be.stdout.columns:void 0,getErrHelpWidth:()=>Be.stderr.isTTY?Be.stderr.columns:void 0,getOutHasColors:()=>UA()??(Be.stdout.isTTY&&Be.stdout.hasColors?.()),getErrHasColors:()=>UA()??(Be.stderr.isTTY&&Be.stderr.hasColors?.()),stripColor:r=>tfe(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return i&&(c.description(i),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new efe,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name +- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new Xde(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'. +Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new LA(e,r,n)),Be.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new m4(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}' +- already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,s):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof m4)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,l)=>{let u=a.exec(c);return u?u[0]:l},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){Be.versions?.electron&&(r.from="electron");let i=Be.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=Be.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":Be.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true. +- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,n){if(Sy.existsSync(e))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead - if the default executable name is not suitable, use the executableFile option to supply a custom name or path - - ${i}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(u,d){let f=fo.resolve(u,d);if(vy.existsSync(f))return f;if(i.includes(fo.extname(d)))return;let p=i.find(m=>vy.existsSync(`${f}${m}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=vy.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=fo.resolve(fo.dirname(u),a)}if(a){let u=o(a,s);if(!u&&!e._executableFile&&this._scriptPath){let d=fo.basename(this._scriptPath,fo.extname(this._scriptPath));d!==this._name&&(u=o(a,`${d}-${e._name}`))}s=u||s}n=i.includes(fo.extname(s));let c;Be.platform!=="win32"?n?(r.unshift(s),r=h4(Be.execArgv).concat(r),c=MA.spawn(Be.argv[0],r,{stdio:"inherit"})):c=MA.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,e._name),r.unshift(s),r=h4(Be.execArgv).concat(r),c=MA.spawn(Be.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{Be.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let l=this._exitCallback;c.on("close",u=>{u=u??1,l?l(new FA(u,"commander.executeSubCommandAsync","(close)")):Be.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(s,a,e._name);else if(u.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)Be.exit(1);else{let d=new FA(1,"commander.executeSubCommandAsync","(error)");d.nestedError=u,l(d)}}),this.runningCommand=c}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?ie(n,a,s),n.defaultValue))):o===void 0&&(o=[]):ir()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r;function o(u){return u.length>1&&u[0]==="-"}let s=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(d=>d.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,c=null,l=0;for(;l2&&u[0]==="-"&&u[1]!=="-"){let d=this._findOption(`-${u[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,u.slice(2)):(this.emit(`option:${d.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let d=u.indexOf("="),f=this._findOption(u.slice(0,d));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,u.slice(d+1));continue}}if(i===r&&o(u)&&!(this.commands.length===0&&s(u))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),n.push(...e.slice(l));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u,...e.slice(l));break}else if(this._defaultCommandName){n.push(u,...e.slice(l));break}}if(this._passThroughOptions){i.push(u,...e.slice(l));break}i.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;nObject.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e} + - ${i}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(u,d){let f=fo.resolve(u,d);if(Sy.existsSync(f))return f;if(i.includes(fo.extname(d)))return;let p=i.find(m=>Sy.existsSync(`${f}${m}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=Sy.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=fo.resolve(fo.dirname(u),a)}if(a){let u=o(a,s);if(!u&&!e._executableFile&&this._scriptPath){let d=fo.basename(this._scriptPath,fo.extname(this._scriptPath));d!==this._name&&(u=o(a,`${d}-${e._name}`))}s=u||s}n=i.includes(fo.extname(s));let c;Be.platform!=="win32"?n?(r.unshift(s),r=g4(Be.execArgv).concat(r),c=FA.spawn(Be.argv[0],r,{stdio:"inherit"})):c=FA.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,e._name),r.unshift(s),r=g4(Be.execArgv).concat(r),c=FA.spawn(Be.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{Be.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let l=this._exitCallback;c.on("close",u=>{u=u??1,l?l(new LA(u,"commander.executeSubCommandAsync","(close)")):Be.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(s,a,e._name);else if(u.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)Be.exit(1);else{let d=new LA(1,"commander.executeSubCommandAsync","(error)");d.nestedError=u,l(d)}}),this.runningCommand=c}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?ie(n,a,s),n.defaultValue))):o===void 0&&(o=[]):ir()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r;function o(u){return u.length>1&&u[0]==="-"}let s=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(d=>d.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,c=null,l=0;for(;l2&&u[0]==="-"&&u[1]!=="-"){let d=this._findOption(`-${u[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,u.slice(2)):(this.emit(`option:${d.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let d=u.indexOf("="),f=this._findOption(u.slice(0,d));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,u.slice(d+1));continue}}if(i===r&&o(u)&&!(this.commands.length===0&&s(u))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),n.push(...e.slice(l));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u,...e.slice(l));break}else if(this._defaultCommandName){n.push(u,...e.slice(l));break}}if(this._passThroughOptions){i.push(u,...e.slice(l));break}i.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;nObject.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e} `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError} `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(` -`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Be.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Be.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new tfe(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),u=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||s},i=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=m4(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=m4(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e} -`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Xde(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=fo.basename(e,fo.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(Be.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText. +`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Be.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Be.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new rfe(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),u=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||s},i=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=h4(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=h4(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e} +`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Qde(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=fo.basename(e,fo.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(Be.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s} -`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function h4(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function zA(){if(Be.env.NO_COLOR||Be.env.FORCE_COLOR==="0"||Be.env.FORCE_COLOR==="false")return!1;if(Be.env.FORCE_COLOR||Be.env.CLICOLOR_FORCE!==void 0)return!0}UA.Command=LA;UA.useColor=zA});var v4=v(kn=>{var{Argument:y4}=by(),{Command:qA}=g4(),{CommanderError:rfe,InvalidArgumentError:_4}=nf(),{Help:nfe}=PA(),{Option:b4}=jA();kn.program=new qA;kn.createCommand=t=>new qA(t);kn.createOption=(t,e)=>new b4(t,e);kn.createArgument=(t,e)=>new y4(t,e);kn.Command=qA;kn.Option=b4;kn.Argument=y4;kn.Help=nfe;kn.CommanderError=rfe;kn.InvalidArgumentError=_4;kn.InvalidOptionArgumentError=_4});var De=v(Qt=>{"use strict";var HA=Symbol.for("yaml.alias"),$4=Symbol.for("yaml.document"),Sy=Symbol.for("yaml.map"),k4=Symbol.for("yaml.pair"),GA=Symbol.for("yaml.scalar"),wy=Symbol.for("yaml.seq"),po=Symbol.for("yaml.node.type"),lfe=t=>!!t&&typeof t=="object"&&t[po]===HA,ufe=t=>!!t&&typeof t=="object"&&t[po]===$4,dfe=t=>!!t&&typeof t=="object"&&t[po]===Sy,ffe=t=>!!t&&typeof t=="object"&&t[po]===k4,E4=t=>!!t&&typeof t=="object"&&t[po]===GA,pfe=t=>!!t&&typeof t=="object"&&t[po]===wy;function A4(t){if(t&&typeof t=="object")switch(t[po]){case Sy:case wy:return!0}return!1}function mfe(t){if(t&&typeof t=="object")switch(t[po]){case HA:case Sy:case GA:case wy:return!0}return!1}var hfe=t=>(E4(t)||A4(t))&&!!t.anchor;Qt.ALIAS=HA;Qt.DOC=$4;Qt.MAP=Sy;Qt.NODE_TYPE=po;Qt.PAIR=k4;Qt.SCALAR=GA;Qt.SEQ=wy;Qt.hasAnchor=hfe;Qt.isAlias=lfe;Qt.isCollection=A4;Qt.isDocument=ufe;Qt.isMap=dfe;Qt.isNode=mfe;Qt.isPair=ffe;Qt.isScalar=E4;Qt.isSeq=pfe});var of=v(ZA=>{"use strict";var Ut=De(),Cr=Symbol("break visit"),T4=Symbol("skip children"),Ai=Symbol("remove node");function xy(t,e){let r=O4(e);Ut.isDocument(t)?Qc(null,t.contents,r,Object.freeze([t]))===Ai&&(t.contents=null):Qc(null,t,r,Object.freeze([]))}xy.BREAK=Cr;xy.SKIP=T4;xy.REMOVE=Ai;function Qc(t,e,r,n){let i=R4(t,e,r,n);if(Ut.isNode(i)||Ut.isPair(i))return I4(t,n,i),Qc(t,i,r,n);if(typeof i!="symbol"){if(Ut.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o{"use strict";var P4=De(),gfe=of(),yfe={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_fe=t=>t.replace(/[!,[\]{}]/g,e=>yfe[e]),sf=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+_fe(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&P4.isNode(e.contents)){let o={};gfe.visit(e.contents,(s,a)=>{P4.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(` -`)}};sf.defaultYaml={explicit:!1,version:"1.2"};sf.defaultTags={"!!":"tag:yaml.org,2002:"};C4.Directives=sf});var ky=v(af=>{"use strict";var D4=De(),bfe=of();function vfe(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function N4(t){let e=new Set;return bfe.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function j4(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function Sfe(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=N4(t));let s=j4(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(D4.isScalar(s.node)||D4.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}af.anchorIsValid=vfe;af.anchorNames=N4;af.createNodeAnchors=Sfe;af.findNewAnchor=j4});var WA=v(M4=>{"use strict";function cf(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i{"use strict";var wfe=De();function F4(t,e,r){if(Array.isArray(t))return t.map((n,i)=>F4(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!wfe.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}L4.toJS=F4});var Ey=v(U4=>{"use strict";var xfe=WA(),z4=De(),$fe=Zo(),KA=class{constructor(e){Object.defineProperty(this,z4.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!z4.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=$fe.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?xfe.applyReviver(o,{"":a},"",a):a}};U4.NodeBase=KA});var lf=v(q4=>{"use strict";var kfe=ky(),Efe=of(),tl=De(),Afe=Ey(),Tfe=Zo(),JA=class extends Afe.NodeBase{constructor(e){super(tl.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Efe.visit(e,{Node:(o,s)=>{(tl.isAlias(s)||tl.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(Tfe.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Ay(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(kfe.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function Ay(t,e,r){if(tl.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(tl.isCollection(e)){let n=0;for(let i of e.items){let o=Ay(t,i,r);o>n&&(n=o)}return n}else if(tl.isPair(e)){let n=Ay(t,e.key,r),i=Ay(t,e.value,r);return Math.max(n,i)}return 1}q4.Alias=JA});var Dt=v(YA=>{"use strict";var Ofe=De(),Rfe=Ey(),Ife=Zo(),Pfe=t=>!t||typeof t!="function"&&typeof t!="object",Vo=class extends Rfe.NodeBase{constructor(e){super(Ofe.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Ife.toJS(this.value,e,r)}toString(){return String(this.value)}};Vo.BLOCK_FOLDED="BLOCK_FOLDED";Vo.BLOCK_LITERAL="BLOCK_LITERAL";Vo.PLAIN="PLAIN";Vo.QUOTE_DOUBLE="QUOTE_DOUBLE";Vo.QUOTE_SINGLE="QUOTE_SINGLE";YA.Scalar=Vo;YA.isScalarValue=Pfe});var uf=v(H4=>{"use strict";var Cfe=lf(),da=De(),B4=Dt(),Dfe="tag:yaml.org,2002:";function Nfe(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function jfe(t,e,r){if(da.isDocument(t)&&(t=t.contents),da.isNode(t))return t;if(da.isPair(t)){let d=r.schema[da.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new Cfe.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Dfe+e.slice(2));let l=Nfe(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new B4.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?s[da.MAP]:Symbol.iterator in Object(t)?s[da.SEQ]:s[da.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new B4.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}H4.createNode=jfe});var Oy=v(Ty=>{"use strict";var Mfe=uf(),Ti=De(),Ffe=Ey();function XA(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return Mfe.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var G4=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,QA=class extends Ffe.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Ti.isNode(n)||Ti.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(G4(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(Ti.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,XA(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Ti.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&Ti.isScalar(o)?o.value:o:Ti.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ti.isPair(r))return!1;let n=r.value;return n==null||e&&Ti.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Ti.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(Ti.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,XA(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Ty.Collection=QA;Ty.collectionFromPath=XA;Ty.isEmptyPath=G4});var df=v(Ry=>{"use strict";var Lfe=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function eT(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var zfe=(t,e,r)=>t.endsWith(` -`)?eT(r,e):r.includes(` +`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function g4(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function UA(){if(Be.env.NO_COLOR||Be.env.FORCE_COLOR==="0"||Be.env.FORCE_COLOR==="false")return!1;if(Be.env.FORCE_COLOR||Be.env.CLICOLOR_FORCE!==void 0)return!0}qA.Command=zA;qA.useColor=UA});var S4=v(kn=>{var{Argument:_4}=vy(),{Command:BA}=y4(),{CommanderError:nfe,InvalidArgumentError:b4}=nf(),{Help:ife}=CA(),{Option:v4}=MA();kn.program=new BA;kn.createCommand=t=>new BA(t);kn.createOption=(t,e)=>new v4(t,e);kn.createArgument=(t,e)=>new _4(t,e);kn.Command=BA;kn.Option=v4;kn.Argument=_4;kn.Help=ife;kn.CommanderError=nfe;kn.InvalidArgumentError=b4;kn.InvalidOptionArgumentError=b4});var De=v(Qt=>{"use strict";var GA=Symbol.for("yaml.alias"),k4=Symbol.for("yaml.document"),wy=Symbol.for("yaml.map"),E4=Symbol.for("yaml.pair"),ZA=Symbol.for("yaml.scalar"),xy=Symbol.for("yaml.seq"),po=Symbol.for("yaml.node.type"),ufe=t=>!!t&&typeof t=="object"&&t[po]===GA,dfe=t=>!!t&&typeof t=="object"&&t[po]===k4,ffe=t=>!!t&&typeof t=="object"&&t[po]===wy,pfe=t=>!!t&&typeof t=="object"&&t[po]===E4,A4=t=>!!t&&typeof t=="object"&&t[po]===ZA,mfe=t=>!!t&&typeof t=="object"&&t[po]===xy;function T4(t){if(t&&typeof t=="object")switch(t[po]){case wy:case xy:return!0}return!1}function hfe(t){if(t&&typeof t=="object")switch(t[po]){case GA:case wy:case ZA:case xy:return!0}return!1}var gfe=t=>(A4(t)||T4(t))&&!!t.anchor;Qt.ALIAS=GA;Qt.DOC=k4;Qt.MAP=wy;Qt.NODE_TYPE=po;Qt.PAIR=E4;Qt.SCALAR=ZA;Qt.SEQ=xy;Qt.hasAnchor=gfe;Qt.isAlias=ufe;Qt.isCollection=T4;Qt.isDocument=dfe;Qt.isMap=ffe;Qt.isNode=hfe;Qt.isPair=pfe;Qt.isScalar=A4;Qt.isSeq=mfe});var of=v(VA=>{"use strict";var Ut=De(),Cr=Symbol("break visit"),O4=Symbol("skip children"),Ai=Symbol("remove node");function $y(t,e){let r=R4(e);Ut.isDocument(t)?Qc(null,t.contents,r,Object.freeze([t]))===Ai&&(t.contents=null):Qc(null,t,r,Object.freeze([]))}$y.BREAK=Cr;$y.SKIP=O4;$y.REMOVE=Ai;function Qc(t,e,r,n){let i=I4(t,e,r,n);if(Ut.isNode(i)||Ut.isPair(i))return P4(t,n,i),Qc(t,i,r,n);if(typeof i!="symbol"){if(Ut.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o{"use strict";var C4=De(),yfe=of(),_fe={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},bfe=t=>t.replace(/[!,[\]{}]/g,e=>_fe[e]),sf=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+bfe(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&C4.isNode(e.contents)){let o={};yfe.visit(e.contents,(s,a)=>{C4.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(` +`)}};sf.defaultYaml={explicit:!1,version:"1.2"};sf.defaultTags={"!!":"tag:yaml.org,2002:"};D4.Directives=sf});var Ey=v(af=>{"use strict";var N4=De(),vfe=of();function Sfe(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function j4(t){let e=new Set;return vfe.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function M4(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function wfe(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=j4(t));let s=M4(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(N4.isScalar(s.node)||N4.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}af.anchorIsValid=Sfe;af.anchorNames=j4;af.createNodeAnchors=wfe;af.findNewAnchor=M4});var KA=v(F4=>{"use strict";function cf(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i{"use strict";var xfe=De();function L4(t,e,r){if(Array.isArray(t))return t.map((n,i)=>L4(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!xfe.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}z4.toJS=L4});var Ay=v(q4=>{"use strict";var $fe=KA(),U4=De(),kfe=Zo(),JA=class{constructor(e){Object.defineProperty(this,U4.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!U4.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=kfe.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?$fe.applyReviver(o,{"":a},"",a):a}};q4.NodeBase=JA});var lf=v(B4=>{"use strict";var Efe=Ey(),Afe=of(),tl=De(),Tfe=Ay(),Ofe=Zo(),YA=class extends Tfe.NodeBase{constructor(e){super(tl.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Afe.visit(e,{Node:(o,s)=>{(tl.isAlias(s)||tl.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(Ofe.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Ty(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(Efe.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function Ty(t,e,r){if(tl.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(tl.isCollection(e)){let n=0;for(let i of e.items){let o=Ty(t,i,r);o>n&&(n=o)}return n}else if(tl.isPair(e)){let n=Ty(t,e.key,r),i=Ty(t,e.value,r);return Math.max(n,i)}return 1}B4.Alias=YA});var Dt=v(XA=>{"use strict";var Rfe=De(),Ife=Ay(),Pfe=Zo(),Cfe=t=>!t||typeof t!="function"&&typeof t!="object",Vo=class extends Ife.NodeBase{constructor(e){super(Rfe.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Pfe.toJS(this.value,e,r)}toString(){return String(this.value)}};Vo.BLOCK_FOLDED="BLOCK_FOLDED";Vo.BLOCK_LITERAL="BLOCK_LITERAL";Vo.PLAIN="PLAIN";Vo.QUOTE_DOUBLE="QUOTE_DOUBLE";Vo.QUOTE_SINGLE="QUOTE_SINGLE";XA.Scalar=Vo;XA.isScalarValue=Cfe});var uf=v(G4=>{"use strict";var Dfe=lf(),da=De(),H4=Dt(),Nfe="tag:yaml.org,2002:";function jfe(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function Mfe(t,e,r){if(da.isDocument(t)&&(t=t.contents),da.isNode(t))return t;if(da.isPair(t)){let d=r.schema[da.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new Dfe.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Nfe+e.slice(2));let l=jfe(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new H4.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?s[da.MAP]:Symbol.iterator in Object(t)?s[da.SEQ]:s[da.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new H4.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}G4.createNode=Mfe});var Ry=v(Oy=>{"use strict";var Ffe=uf(),Ti=De(),Lfe=Ay();function QA(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return Ffe.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Z4=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,eT=class extends Lfe.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Ti.isNode(n)||Ti.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(Z4(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(Ti.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,QA(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Ti.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&Ti.isScalar(o)?o.value:o:Ti.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ti.isPair(r))return!1;let n=r.value;return n==null||e&&Ti.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Ti.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(Ti.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,QA(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Oy.Collection=eT;Oy.collectionFromPath=QA;Oy.isEmptyPath=Z4});var df=v(Iy=>{"use strict";var zfe=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function tT(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Ufe=(t,e,r)=>t.endsWith(` +`)?tT(r,e):r.includes(` `)?` -`+eT(r,e):(t.endsWith(" ")?"":" ")+r;Ry.indentComment=eT;Ry.lineComment=zfe;Ry.stringifyComment=Lfe});var V4=v(ff=>{"use strict";var Ufe="flow",tT="block",Iy="quoted";function qfe(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,o)?l.push(0):d=i-n);let f,p,m=!1,h=-1,g=-1,b=-1;r===tT&&(h=Z4(t,h,e.length),h!==-1&&(d=h+c));for(let S;S=t[h+=1];){if(r===Iy&&S==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(S===` -`)r===tT&&(h=Z4(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(S===" "&&p&&p!==" "&&p!==` +`+tT(r,e):(t.endsWith(" ")?"":" ")+r;Iy.indentComment=tT;Iy.lineComment=Ufe;Iy.stringifyComment=zfe});var W4=v(ff=>{"use strict";var qfe="flow",rT="block",Py="quoted";function Bfe(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,o)?l.push(0):d=i-n);let f,p,m=!1,h=-1,g=-1,b=-1;r===rT&&(h=V4(t,h,e.length),h!==-1&&(d=h+c));for(let S;S=t[h+=1];){if(r===Py&&S==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(S===` +`)r===rT&&(h=V4(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(S===" "&&p&&p!==" "&&p!==` `&&p!==" "){let x=t[h+1];x&&x!==" "&&x!==` -`&&x!==" "&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(r===Iy){for(;p===" "||p===" ";)p=S,S=t[h+=1],m=!0;let x=h>b+1?h-2:g-1;if(u[x])return t;l.push(x),u[x]=!0,d=x+c,f=void 0}else m=!0}p=S}if(m&&a&&a(),l.length===0)return t;s&&s();let _=t.slice(0,l[0]);for(let S=0;S{"use strict";var Kn=Dt(),Wo=V4(),Cy=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Dy=t=>/^(%|---|\.\.\.)/m.test(t);function Bfe(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;on)return!0;if(s=o+1,i-s<=n)return!1}return!0}function pf(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Dy(t)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let u=r.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length=d)if(f)l.push(f),d=f+c,f=void 0;else if(r===Py){for(;p===" "||p===" ";)p=S,S=t[h+=1],m=!0;let x=h>b+1?h-2:g-1;if(u[x])return t;l.push(x),u[x]=!0,d=x+c,f=void 0}else m=!0}p=S}if(m&&a&&a(),l.length===0)return t;s&&s();let _=t.slice(0,l[0]);for(let S=0;S{"use strict";var Kn=Dt(),Wo=W4(),Dy=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Ny=t=>/^(%|---|\.\.\.)/m.test(t);function Hfe(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;on)return!0;if(s=o+1,i-s<=n)return!1}return!0}function pf(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Ny(t)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let u=r.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length `;let d,f;for(f=r.length;f>0;--f){let w=r[f-1];if(w!==` `&&w!==" "&&w!==" ")break}let p=r.substring(f),m=p.indexOf(` `);m===-1?d="-":r===p||m!==p.length-1?(d="+",o&&o()):d="",p&&(r=r.slice(0,-p.length),p[p.length-1]===` -`&&(p=p.slice(0,-1)),p=p.replace(nT,`$&${l}`));let h=!1,g,b=-1;for(g=0;g{O=!0});let A=Wo.foldFlowLines(`${_}${w}${p}`,l,Wo.FOLD_BLOCK,T);if(!O)return`>${x} +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),O=!1,T=Dy(n,!0);s!=="folded"&&e!==Kn.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{O=!0});let A=Wo.foldFlowLines(`${_}${w}${p}`,l,Wo.FOLD_BLOCK,T);if(!O)return`>${x} ${l}${A}`}return r=r.replace(/\n+/g,`$&${l}`),`|${x} -${l}${_}${r}${p}`}function Hfe(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(` +${l}${_}${r}${p}`}function Gfe(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(` `)||u&&/[[\]{},]/.test(o))return rl(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` -`)?rl(o,e):Py(t,e,r,n);if(!a&&!u&&i!==Kn.Scalar.PLAIN&&o.includes(` -`))return Py(t,e,r,n);if(Dy(o)){if(c==="")return e.forceBlockIndent=!0,Py(t,e,r,n);if(a&&c===l)return rl(o,e)}let d=o.replace(/\n+/g,`$& -${c}`);if(s){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:m}=e.doc.schema;if(m.some(f)||p?.some(f))return rl(o,e)}return a?d:Wo.foldFlowLines(d,c,Wo.FOLD_FLOW,Cy(e,!1))}function Gfe(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Kn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Kn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Kn.Scalar.BLOCK_FOLDED:case Kn.Scalar.BLOCK_LITERAL:return i||o?rl(s.value,e):Py(s,e,r,n);case Kn.Scalar.QUOTE_DOUBLE:return pf(s.value,e);case Kn.Scalar.QUOTE_SINGLE:return rT(s.value,e);case Kn.Scalar.PLAIN:return Hfe(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}W4.stringifyString=Gfe});var hf=v(iT=>{"use strict";var Zfe=ky(),Ko=De(),Vfe=df(),Wfe=mf();function Kfe(t,e){let r=Object.assign({blockQuote:!0,commentString:Vfe.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Jfe(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(Ko.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Yfe(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(Ko.isScalar(t)||Ko.isCollection(t))&&t.anchor;o&&Zfe.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Xfe(t,e,r,n){if(Ko.isPair(t))return t.toString(e,r,n);if(Ko.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=Ko.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Jfe(e.doc.schema.tags,o));let s=Yfe(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):Ko.isScalar(o)?Wfe.stringifyString(o,e,r,n):o.toString(e,r,n);return s?Ko.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} -${e.indent}${a}`:a}iT.createStringifyContext=Kfe;iT.stringify=Xfe});var X4=v(Y4=>{"use strict";var mo=De(),K4=Dt(),J4=hf(),gf=df();function Qfe({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=mo.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(mo.isCollection(t)||!mo.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||mo.isCollection(t)||(mo.isScalar(t)?t.type===K4.Scalar.BLOCK_FOLDED||t.type===K4.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!o),indent:a+c});let m=!1,h=!1,g=J4.stringify(t,r,()=>m=!0,()=>h=!0);if(!p&&!r.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(o||e==null)return m&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(o&&!d||e==null&&p)return g=`? ${g}`,f&&!m?g+=gf.lineComment(g,r.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=gf.lineComment(g,r.indent,l(f))),g=`? ${g} -${a}:`):(g=`${g}:`,f&&(g+=gf.lineComment(g,r.indent,l(f))));let b,_,S;mo.isNode(e)?(b=!!e.spaceBefore,_=e.commentBefore,S=e.comment):(b=!1,_=null,S=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!p&&!f&&mo.isScalar(e)&&(r.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&mo.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let x=!1,w=J4.stringify(e,r,()=>x=!0,()=>h=!0),O=" ";if(f||b||_){if(O=b?` +`)?rl(o,e):Cy(t,e,r,n);if(!a&&!u&&i!==Kn.Scalar.PLAIN&&o.includes(` +`))return Cy(t,e,r,n);if(Ny(o)){if(c==="")return e.forceBlockIndent=!0,Cy(t,e,r,n);if(a&&c===l)return rl(o,e)}let d=o.replace(/\n+/g,`$& +${c}`);if(s){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:m}=e.doc.schema;if(m.some(f)||p?.some(f))return rl(o,e)}return a?d:Wo.foldFlowLines(d,c,Wo.FOLD_FLOW,Dy(e,!1))}function Zfe(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Kn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Kn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Kn.Scalar.BLOCK_FOLDED:case Kn.Scalar.BLOCK_LITERAL:return i||o?rl(s.value,e):Cy(s,e,r,n);case Kn.Scalar.QUOTE_DOUBLE:return pf(s.value,e);case Kn.Scalar.QUOTE_SINGLE:return nT(s.value,e);case Kn.Scalar.PLAIN:return Gfe(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}K4.stringifyString=Zfe});var hf=v(oT=>{"use strict";var Vfe=Ey(),Ko=De(),Wfe=df(),Kfe=mf();function Jfe(t,e){let r=Object.assign({blockQuote:!0,commentString:Wfe.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Yfe(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(Ko.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Xfe(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(Ko.isScalar(t)||Ko.isCollection(t))&&t.anchor;o&&Vfe.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Qfe(t,e,r,n){if(Ko.isPair(t))return t.toString(e,r,n);if(Ko.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=Ko.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Yfe(e.doc.schema.tags,o));let s=Xfe(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):Ko.isScalar(o)?Kfe.stringifyString(o,e,r,n):o.toString(e,r,n);return s?Ko.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} +${e.indent}${a}`:a}oT.createStringifyContext=Jfe;oT.stringify=Qfe});var Q4=v(X4=>{"use strict";var mo=De(),J4=Dt(),Y4=hf(),gf=df();function epe({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=mo.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(mo.isCollection(t)||!mo.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||mo.isCollection(t)||(mo.isScalar(t)?t.type===J4.Scalar.BLOCK_FOLDED||t.type===J4.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!o),indent:a+c});let m=!1,h=!1,g=Y4.stringify(t,r,()=>m=!0,()=>h=!0);if(!p&&!r.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(o||e==null)return m&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(o&&!d||e==null&&p)return g=`? ${g}`,f&&!m?g+=gf.lineComment(g,r.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=gf.lineComment(g,r.indent,l(f))),g=`? ${g} +${a}:`):(g=`${g}:`,f&&(g+=gf.lineComment(g,r.indent,l(f))));let b,_,S;mo.isNode(e)?(b=!!e.spaceBefore,_=e.commentBefore,S=e.comment):(b=!1,_=null,S=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!p&&!f&&mo.isScalar(e)&&(r.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&mo.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let x=!1,w=Y4.stringify(e,r,()=>x=!0,()=>h=!0),O=" ";if(f||b||_){if(O=b?` `:"",_){let T=l(_);O+=` ${gf.indentComment(T,r.indent)}`}w===""&&!r.inFlow?O===` `&&S&&(O=` @@ -72,34 +72,34 @@ ${gf.indentComment(T,r.indent)}`}w===""&&!r.inFlow?O===` ${r.indent}`}else if(!p&&mo.isCollection(e)){let T=w[0],A=w.indexOf(` `),D=A!==-1,$=r.inFlow??e.flow??e.items.length===0;if(D||!$){let ie=!1;if(D&&(T==="&"||T==="!")){let K=w.indexOf(" ");T==="&"&&K!==-1&&K{"use strict";var Q4=Ge("process");function epe(t,...e){t==="debug"&&console.log(...e)}function tpe(t,e){(t==="debug"||t==="warn")&&(typeof Q4.emitWarning=="function"?Q4.emitWarning(e):console.warn(e))}oT.debug=epe;oT.warn=tpe});var Ly=v(Fy=>{"use strict";var My=De(),e6=Dt(),Ny="<<",jy={identify:t=>t===Ny||typeof t=="symbol"&&t.description===Ny,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new e6.Scalar(Symbol(Ny)),{addToJSMap:t6}),stringify:()=>Ny},rpe=(t,e)=>(jy.identify(e)||My.isScalar(e)&&(!e.type||e.type===e6.Scalar.PLAIN)&&jy.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===jy.tag&&r.default);function t6(t,e,r){let n=r6(t,r);if(My.isSeq(n))for(let i of n.items)aT(t,e,i);else if(Array.isArray(n))for(let i of n)aT(t,e,i);else aT(t,e,n)}function aT(t,e,r){let n=r6(t,r);if(!My.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function r6(t,e){return t&&My.isAlias(e)?e.resolve(t.doc,t):e}Fy.addMergeToJSMap=t6;Fy.isMergeKey=rpe;Fy.merge=jy});var lT=v(o6=>{"use strict";var npe=sT(),n6=Ly(),ipe=hf(),i6=De(),cT=Zo();function ope(t,e,{key:r,value:n}){if(i6.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(n6.isMergeKey(t,r))n6.addMergeToJSMap(t,e,n);else{let i=cT.toJS(r,"",t);if(e instanceof Map)e.set(i,cT.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=spe(r,i,t),s=cT.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function spe(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(i6.isNode(t)&&r?.doc){let n=ipe.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),npe.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}o6.addPairToJSMap=ope});var Jo=v(uT=>{"use strict";var s6=uf(),ape=X4(),cpe=lT(),zy=De();function lpe(t,e,r){let n=s6.createNode(t,void 0,r),i=s6.createNode(e,void 0,r);return new Uy(n,i)}var Uy=class t{constructor(e,r=null){Object.defineProperty(this,zy.NODE_TYPE,{value:zy.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return zy.isNode(r)&&(r=r.clone(e)),zy.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return cpe.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?ape.stringifyPair(this,e,r,n):JSON.stringify(this)}};uT.Pair=Uy;uT.createPair=lpe});var dT=v(c6=>{"use strict";var fa=De(),a6=hf(),qy=df();function upe(t,e,r){return(e.inFlow??t.flow?fpe:dpe)(t,e,r)}function dpe({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(b+=qy.lineComment(b,o,l(g))),d&&g&&(d=!1),f.push(n+b)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;m{"use strict";var e6=Ge("process");function tpe(t,...e){t==="debug"&&console.log(...e)}function rpe(t,e){(t==="debug"||t==="warn")&&(typeof e6.emitWarning=="function"?e6.emitWarning(e):console.warn(e))}sT.debug=tpe;sT.warn=rpe});var zy=v(Ly=>{"use strict";var Fy=De(),t6=Dt(),jy="<<",My={identify:t=>t===jy||typeof t=="symbol"&&t.description===jy,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new t6.Scalar(Symbol(jy)),{addToJSMap:r6}),stringify:()=>jy},npe=(t,e)=>(My.identify(e)||Fy.isScalar(e)&&(!e.type||e.type===t6.Scalar.PLAIN)&&My.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===My.tag&&r.default);function r6(t,e,r){let n=n6(t,r);if(Fy.isSeq(n))for(let i of n.items)cT(t,e,i);else if(Array.isArray(n))for(let i of n)cT(t,e,i);else cT(t,e,n)}function cT(t,e,r){let n=n6(t,r);if(!Fy.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function n6(t,e){return t&&Fy.isAlias(e)?e.resolve(t.doc,t):e}Ly.addMergeToJSMap=r6;Ly.isMergeKey=npe;Ly.merge=My});var uT=v(s6=>{"use strict";var ipe=aT(),i6=zy(),ope=hf(),o6=De(),lT=Zo();function spe(t,e,{key:r,value:n}){if(o6.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(i6.isMergeKey(t,r))i6.addMergeToJSMap(t,e,n);else{let i=lT.toJS(r,"",t);if(e instanceof Map)e.set(i,lT.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=ape(r,i,t),s=lT.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function ape(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(o6.isNode(t)&&r?.doc){let n=ope.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),ipe.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}s6.addPairToJSMap=spe});var Jo=v(dT=>{"use strict";var a6=uf(),cpe=Q4(),lpe=uT(),Uy=De();function upe(t,e,r){let n=a6.createNode(t,void 0,r),i=a6.createNode(e,void 0,r);return new qy(n,i)}var qy=class t{constructor(e,r=null){Object.defineProperty(this,Uy.NODE_TYPE,{value:Uy.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Uy.isNode(r)&&(r=r.clone(e)),Uy.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return lpe.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?cpe.stringifyPair(this,e,r,n):JSON.stringify(this)}};dT.Pair=qy;dT.createPair=upe});var fT=v(l6=>{"use strict";var fa=De(),c6=hf(),By=df();function dpe(t,e,r){return(e.inFlow??t.flow?ppe:fpe)(t,e,r)}function fpe({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(b+=By.lineComment(b,o,l(g))),d&&g&&(d=!1),f.push(n+b)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;mg=null);l||(l=d.length>u||b.includes(` -`)),m0&&(l||(l=d.reduce((_,S)=>_+S.length+2,2)+(b.length+2)>e.options.lineWidth)),l&&(b+=",")),g&&(b+=qy.lineComment(b,n,a(g))),d.push(b),u=d.length}let{start:f,end:p}=r;if(d.length===0)return f+p;if(!l){let m=d.reduce((h,g)=>h+g.length+2,2);l=e.options.lineWidth>0&&m>e.options.lineWidth}if(l){let m=f;for(let h of d)m+=h?` +`+By.indentComment(l(t),c),a&&a()):d&&s&&s(),p}function ppe({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;n+=o;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let m=0;mg=null);l||(l=d.length>u||b.includes(` +`)),m0&&(l||(l=d.reduce((_,S)=>_+S.length+2,2)+(b.length+2)>e.options.lineWidth)),l&&(b+=",")),g&&(b+=By.lineComment(b,n,a(g))),d.push(b),u=d.length}let{start:f,end:p}=r;if(d.length===0)return f+p;if(!l){let m=d.reduce((h,g)=>h+g.length+2,2);l=e.options.lineWidth>0&&m>e.options.lineWidth}if(l){let m=f;for(let h of d)m+=h?` ${o}${i}${h}`:` `;return`${m} -${i}${p}`}else return`${f}${s}${d.join(" ")}${s}${p}`}function By({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=qy.indentComment(e(n),t);r.push(o.trimStart())}}c6.stringifyCollection=upe});var Xo=v(pT=>{"use strict";var ppe=dT(),mpe=lT(),hpe=Oy(),Yo=De(),Hy=Jo(),gpe=Dt();function yf(t,e){let r=Yo.isScalar(e)?e.value:e;for(let n of t)if(Yo.isPair(n)&&(n.key===e||n.key===r||Yo.isScalar(n.key)&&n.key.value===r))return n}var fT=class extends hpe.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Yo.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(Hy.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;Yo.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Hy.Pair(e,e?.value):n=new Hy.Pair(e.key,e.value);let i=yf(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Yo.isScalar(i.value)&&gpe.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=yf(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=yf(this.items,e)?.value;return(!r&&Yo.isScalar(i)?i.value:i)??void 0}has(e){return!!yf(this.items,e)}set(e,r){this.add(new Hy.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)mpe.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Yo.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ppe.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};pT.YAMLMap=fT;pT.findPair=yf});var nl=v(u6=>{"use strict";var ype=De(),l6=Xo(),_pe={collection:"map",default:!0,nodeClass:l6.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return ype.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>l6.YAMLMap.from(t,e,r)};u6.map=_pe});var Qo=v(d6=>{"use strict";var bpe=uf(),vpe=dT(),Spe=Oy(),Zy=De(),wpe=Dt(),xpe=Zo(),mT=class extends Spe.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Zy.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Gy(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Gy(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Zy.isScalar(i)?i.value:i}has(e){let r=Gy(e);return typeof r=="number"&&r=0?e:null}d6.YAMLSeq=mT});var il=v(p6=>{"use strict";var $pe=De(),f6=Qo(),kpe={collection:"seq",default:!0,nodeClass:f6.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return $pe.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>f6.YAMLSeq.from(t,e,r)};p6.seq=kpe});var _f=v(m6=>{"use strict";var Epe=mf(),Ape={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),Epe.stringifyString(t,e,r,n)}};m6.string=Ape});var Vy=v(y6=>{"use strict";var h6=Dt(),g6={identify:t=>t==null,createNode:()=>new h6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new h6.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&g6.test.test(t)?t:e.options.nullStr};y6.nullTag=g6});var hT=v(b6=>{"use strict";var Tpe=Dt(),_6={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Tpe.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&_6.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};b6.boolTag=_6});var ol=v(v6=>{"use strict";function Ope({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}v6.stringifyNumber=Ope});var yT=v(Wy=>{"use strict";var Rpe=Dt(),gT=ol(),Ipe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:gT.stringifyNumber},Ppe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():gT.stringifyNumber(t)}},Cpe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Rpe.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:gT.stringifyNumber};Wy.float=Cpe;Wy.floatExp=Ppe;Wy.floatNaN=Ipe});var bT=v(Jy=>{"use strict";var S6=ol(),Ky=t=>typeof t=="bigint"||Number.isInteger(t),_T=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function w6(t,e,r){let{value:n}=t;return Ky(n)&&n>=0?r+n.toString(e):S6.stringifyNumber(t)}var Dpe={identify:t=>Ky(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>_T(t,2,8,r),stringify:t=>w6(t,8,"0o")},Npe={identify:Ky,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>_T(t,0,10,r),stringify:S6.stringifyNumber},jpe={identify:t=>Ky(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>_T(t,2,16,r),stringify:t=>w6(t,16,"0x")};Jy.int=Npe;Jy.intHex=jpe;Jy.intOct=Dpe});var $6=v(x6=>{"use strict";var Mpe=nl(),Fpe=Vy(),Lpe=il(),zpe=_f(),Upe=hT(),vT=yT(),ST=bT(),qpe=[Mpe.map,Lpe.seq,zpe.string,Fpe.nullTag,Upe.boolTag,ST.intOct,ST.int,ST.intHex,vT.floatNaN,vT.floatExp,vT.float];x6.schema=qpe});var A6=v(E6=>{"use strict";var Bpe=Dt(),Hpe=nl(),Gpe=il();function k6(t){return typeof t=="bigint"||Number.isInteger(t)}var Yy=({value:t})=>JSON.stringify(t),Zpe=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Yy},{identify:t=>t==null,createNode:()=>new Bpe.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Yy},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Yy},{identify:k6,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>k6(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Yy}],Vpe={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Wpe=[Hpe.map,Gpe.seq].concat(Zpe,Vpe);E6.schema=Wpe});var xT=v(T6=>{"use strict";var bf=Ge("buffer"),wT=Dt(),Kpe=mf(),Jpe={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof bf.Buffer=="function")return bf.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i{"use strict";var Xy=De(),$T=Jo(),Ype=Dt(),Xpe=Qo();function O6(t,e){if(Xy.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new $T.Pair(new Ype.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore} +${i}${p}`}else return`${f}${s}${d.join(" ")}${s}${p}`}function Hy({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=By.indentComment(e(n),t);r.push(o.trimStart())}}l6.stringifyCollection=dpe});var Xo=v(mT=>{"use strict";var mpe=fT(),hpe=uT(),gpe=Ry(),Yo=De(),Gy=Jo(),ype=Dt();function yf(t,e){let r=Yo.isScalar(e)?e.value:e;for(let n of t)if(Yo.isPair(n)&&(n.key===e||n.key===r||Yo.isScalar(n.key)&&n.key.value===r))return n}var pT=class extends gpe.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Yo.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(Gy.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;Yo.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Gy.Pair(e,e?.value):n=new Gy.Pair(e.key,e.value);let i=yf(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Yo.isScalar(i.value)&&ype.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=yf(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=yf(this.items,e)?.value;return(!r&&Yo.isScalar(i)?i.value:i)??void 0}has(e){return!!yf(this.items,e)}set(e,r){this.add(new Gy.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)hpe.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Yo.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),mpe.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};mT.YAMLMap=pT;mT.findPair=yf});var nl=v(d6=>{"use strict";var _pe=De(),u6=Xo(),bpe={collection:"map",default:!0,nodeClass:u6.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return _pe.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>u6.YAMLMap.from(t,e,r)};d6.map=bpe});var Qo=v(f6=>{"use strict";var vpe=uf(),Spe=fT(),wpe=Ry(),Vy=De(),xpe=Dt(),$pe=Zo(),hT=class extends wpe.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Vy.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Zy(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Zy(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Vy.isScalar(i)?i.value:i}has(e){let r=Zy(e);return typeof r=="number"&&r=0?e:null}f6.YAMLSeq=hT});var il=v(m6=>{"use strict";var kpe=De(),p6=Qo(),Epe={collection:"seq",default:!0,nodeClass:p6.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return kpe.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>p6.YAMLSeq.from(t,e,r)};m6.seq=Epe});var _f=v(h6=>{"use strict";var Ape=mf(),Tpe={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),Ape.stringifyString(t,e,r,n)}};h6.string=Tpe});var Wy=v(_6=>{"use strict";var g6=Dt(),y6={identify:t=>t==null,createNode:()=>new g6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new g6.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&y6.test.test(t)?t:e.options.nullStr};_6.nullTag=y6});var gT=v(v6=>{"use strict";var Ope=Dt(),b6={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Ope.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&b6.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};v6.boolTag=b6});var ol=v(S6=>{"use strict";function Rpe({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}S6.stringifyNumber=Rpe});var _T=v(Ky=>{"use strict";var Ipe=Dt(),yT=ol(),Ppe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:yT.stringifyNumber},Cpe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():yT.stringifyNumber(t)}},Dpe={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Ipe.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:yT.stringifyNumber};Ky.float=Dpe;Ky.floatExp=Cpe;Ky.floatNaN=Ppe});var vT=v(Yy=>{"use strict";var w6=ol(),Jy=t=>typeof t=="bigint"||Number.isInteger(t),bT=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function x6(t,e,r){let{value:n}=t;return Jy(n)&&n>=0?r+n.toString(e):w6.stringifyNumber(t)}var Npe={identify:t=>Jy(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>bT(t,2,8,r),stringify:t=>x6(t,8,"0o")},jpe={identify:Jy,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>bT(t,0,10,r),stringify:w6.stringifyNumber},Mpe={identify:t=>Jy(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>bT(t,2,16,r),stringify:t=>x6(t,16,"0x")};Yy.int=jpe;Yy.intHex=Mpe;Yy.intOct=Npe});var k6=v($6=>{"use strict";var Fpe=nl(),Lpe=Wy(),zpe=il(),Upe=_f(),qpe=gT(),ST=_T(),wT=vT(),Bpe=[Fpe.map,zpe.seq,Upe.string,Lpe.nullTag,qpe.boolTag,wT.intOct,wT.int,wT.intHex,ST.floatNaN,ST.floatExp,ST.float];$6.schema=Bpe});var T6=v(A6=>{"use strict";var Hpe=Dt(),Gpe=nl(),Zpe=il();function E6(t){return typeof t=="bigint"||Number.isInteger(t)}var Xy=({value:t})=>JSON.stringify(t),Vpe=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Xy},{identify:t=>t==null,createNode:()=>new Hpe.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Xy},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Xy},{identify:E6,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>E6(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Xy}],Wpe={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Kpe=[Gpe.map,Zpe.seq].concat(Vpe,Wpe);A6.schema=Kpe});var $T=v(O6=>{"use strict";var bf=Ge("buffer"),xT=Dt(),Jpe=mf(),Ype={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof bf.Buffer=="function")return bf.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i{"use strict";var Qy=De(),kT=Jo(),Xpe=Dt(),Qpe=Qo();function R6(t,e){if(Qy.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new kT.Pair(new Xpe.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore} ${i.key.commentBefore}`:n.commentBefore),n.comment){let o=i.value??i.key;o.comment=o.comment?`${n.comment} -${o.comment}`:n.comment}n=i}t.items[r]=Xy.isPair(n)?n:new $T.Pair(n)}}else e("Expected a sequence for this tag");return t}function R6(t,e,r){let{replacer:n}=r,i=new Xpe.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push($T.createPair(a,c,r))}return i}var Qpe={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:O6,createNode:R6};Qy.createPairs=R6;Qy.pairs=Qpe;Qy.resolvePairs=O6});var AT=v(ET=>{"use strict";var I6=De(),kT=Zo(),vf=Xo(),eme=Qo(),P6=e_(),pa=class t extends eme.YAMLSeq{constructor(){super(),this.add=vf.YAMLMap.prototype.add.bind(this),this.delete=vf.YAMLMap.prototype.delete.bind(this),this.get=vf.YAMLMap.prototype.get.bind(this),this.has=vf.YAMLMap.prototype.has.bind(this),this.set=vf.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(I6.isPair(i)?(o=kT.toJS(i.key,"",r),s=kT.toJS(i.value,o,r)):o=kT.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=P6.createPairs(e,r,n),o=new this;return o.items=i.items,o}};pa.tag="tag:yaml.org,2002:omap";var tme={collection:"seq",identify:t=>t instanceof Map,nodeClass:pa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=P6.resolvePairs(t,e),n=[];for(let{key:i}of r.items)I6.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new pa,r)},createNode:(t,e,r)=>pa.from(t,e,r)};ET.YAMLOMap=pa;ET.omap=tme});var M6=v(TT=>{"use strict";var C6=Dt();function D6({value:t,source:e},r){return e&&(t?N6:j6).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var N6={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new C6.Scalar(!0),stringify:D6},j6={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new C6.Scalar(!1),stringify:D6};TT.falseTag=j6;TT.trueTag=N6});var F6=v(t_=>{"use strict";var rme=Dt(),OT=ol(),nme={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:OT.stringifyNumber},ime={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():OT.stringifyNumber(t)}},ome={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new rme.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:OT.stringifyNumber};t_.float=ome;t_.floatExp=ime;t_.floatNaN=nme});var z6=v(wf=>{"use strict";var L6=ol(),Sf=t=>typeof t=="bigint"||Number.isInteger(t);function r_(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function RT(t,e,r){let{value:n}=t;if(Sf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return L6.stringifyNumber(t)}var sme={identify:Sf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>r_(t,2,2,r),stringify:t=>RT(t,2,"0b")},ame={identify:Sf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>r_(t,1,8,r),stringify:t=>RT(t,8,"0")},cme={identify:Sf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>r_(t,0,10,r),stringify:L6.stringifyNumber},lme={identify:Sf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>r_(t,2,16,r),stringify:t=>RT(t,16,"0x")};wf.int=cme;wf.intBin=sme;wf.intHex=lme;wf.intOct=ame});var PT=v(IT=>{"use strict";var o_=De(),n_=Jo(),i_=Xo(),ma=class t extends i_.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;o_.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new n_.Pair(e.key,null):r=new n_.Pair(e,null),i_.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=i_.findPair(this.items,e);return!r&&o_.isPair(n)?o_.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=i_.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new n_.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(n_.createPair(s,null,n));return o}};ma.tag="tag:yaml.org,2002:set";var ume={collection:"map",identify:t=>t instanceof Set,nodeClass:ma,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ma.from(t,e,r),resolve(t,e){if(o_.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ma,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};IT.YAMLSet=ma;IT.set=ume});var DT=v(s_=>{"use strict";var dme=ol();function CT(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function U6(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return dme.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var fme={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>CT(t,r),stringify:U6},pme={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>CT(t,!1),stringify:U6},q6={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(q6.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=CT(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};s_.floatTime=pme;s_.intTime=fme;s_.timestamp=q6});var G6=v(H6=>{"use strict";var mme=nl(),hme=Vy(),gme=il(),yme=_f(),_me=xT(),B6=M6(),NT=F6(),a_=z6(),bme=Ly(),vme=AT(),Sme=e_(),wme=PT(),jT=DT(),xme=[mme.map,gme.seq,yme.string,hme.nullTag,B6.trueTag,B6.falseTag,a_.intBin,a_.intOct,a_.int,a_.intHex,NT.floatNaN,NT.floatExp,NT.float,_me.binary,bme.merge,vme.omap,Sme.pairs,wme.set,jT.intTime,jT.floatTime,jT.timestamp];H6.schema=xme});var tB=v(LT=>{"use strict";var K6=nl(),$me=Vy(),J6=il(),kme=_f(),Eme=hT(),MT=yT(),FT=bT(),Ame=$6(),Tme=A6(),Y6=xT(),xf=Ly(),X6=AT(),Q6=e_(),Z6=G6(),eB=PT(),c_=DT(),V6=new Map([["core",Ame.schema],["failsafe",[K6.map,J6.seq,kme.string]],["json",Tme.schema],["yaml11",Z6.schema],["yaml-1.1",Z6.schema]]),W6={binary:Y6.binary,bool:Eme.boolTag,float:MT.float,floatExp:MT.floatExp,floatNaN:MT.floatNaN,floatTime:c_.floatTime,int:FT.int,intHex:FT.intHex,intOct:FT.intOct,intTime:c_.intTime,map:K6.map,merge:xf.merge,null:$me.nullTag,omap:X6.omap,pairs:Q6.pairs,seq:J6.seq,set:eB.set,timestamp:c_.timestamp},Ome={"tag:yaml.org,2002:binary":Y6.binary,"tag:yaml.org,2002:merge":xf.merge,"tag:yaml.org,2002:omap":X6.omap,"tag:yaml.org,2002:pairs":Q6.pairs,"tag:yaml.org,2002:set":eB.set,"tag:yaml.org,2002:timestamp":c_.timestamp};function Rme(t,e,r){let n=V6.get(e);if(n&&!t)return r&&!n.includes(xf.merge)?n.concat(xf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(V6.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(xf.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?W6[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(W6).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}LT.coreKnownTags=Ome;LT.getTags=Rme});var qT=v(rB=>{"use strict";var zT=De(),Ime=nl(),Pme=il(),Cme=_f(),l_=tB(),Dme=(t,e)=>t.keye.key?1:0,UT=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?l_.getTags(e,"compat"):e?l_.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?l_.coreKnownTags:{},this.tags=l_.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,zT.MAP,{value:Ime.map}),Object.defineProperty(this,zT.SCALAR,{value:Cme.string}),Object.defineProperty(this,zT.SEQ,{value:Pme.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Dme:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};rB.Schema=UT});var iB=v(nB=>{"use strict";var Nme=De(),BT=hf(),$f=df();function jme(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=BT.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift($f.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(Nme.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push($f.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=BT.stringify(t.contents,i,()=>a=null,c);a&&(l+=$f.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(BT.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(` +${o.comment}`:n.comment}n=i}t.items[r]=Qy.isPair(n)?n:new kT.Pair(n)}}else e("Expected a sequence for this tag");return t}function I6(t,e,r){let{replacer:n}=r,i=new Qpe.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(kT.createPair(a,c,r))}return i}var eme={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:R6,createNode:I6};e_.createPairs=I6;e_.pairs=eme;e_.resolvePairs=R6});var TT=v(AT=>{"use strict";var P6=De(),ET=Zo(),vf=Xo(),tme=Qo(),C6=t_(),pa=class t extends tme.YAMLSeq{constructor(){super(),this.add=vf.YAMLMap.prototype.add.bind(this),this.delete=vf.YAMLMap.prototype.delete.bind(this),this.get=vf.YAMLMap.prototype.get.bind(this),this.has=vf.YAMLMap.prototype.has.bind(this),this.set=vf.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(P6.isPair(i)?(o=ET.toJS(i.key,"",r),s=ET.toJS(i.value,o,r)):o=ET.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=C6.createPairs(e,r,n),o=new this;return o.items=i.items,o}};pa.tag="tag:yaml.org,2002:omap";var rme={collection:"seq",identify:t=>t instanceof Map,nodeClass:pa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=C6.resolvePairs(t,e),n=[];for(let{key:i}of r.items)P6.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new pa,r)},createNode:(t,e,r)=>pa.from(t,e,r)};AT.YAMLOMap=pa;AT.omap=rme});var F6=v(OT=>{"use strict";var D6=Dt();function N6({value:t,source:e},r){return e&&(t?j6:M6).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var j6={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new D6.Scalar(!0),stringify:N6},M6={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new D6.Scalar(!1),stringify:N6};OT.falseTag=M6;OT.trueTag=j6});var L6=v(r_=>{"use strict";var nme=Dt(),RT=ol(),ime={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:RT.stringifyNumber},ome={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():RT.stringifyNumber(t)}},sme={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new nme.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:RT.stringifyNumber};r_.float=sme;r_.floatExp=ome;r_.floatNaN=ime});var U6=v(wf=>{"use strict";var z6=ol(),Sf=t=>typeof t=="bigint"||Number.isInteger(t);function n_(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function IT(t,e,r){let{value:n}=t;if(Sf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return z6.stringifyNumber(t)}var ame={identify:Sf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>n_(t,2,2,r),stringify:t=>IT(t,2,"0b")},cme={identify:Sf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>n_(t,1,8,r),stringify:t=>IT(t,8,"0")},lme={identify:Sf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>n_(t,0,10,r),stringify:z6.stringifyNumber},ume={identify:Sf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>n_(t,2,16,r),stringify:t=>IT(t,16,"0x")};wf.int=lme;wf.intBin=ame;wf.intHex=ume;wf.intOct=cme});var CT=v(PT=>{"use strict";var s_=De(),i_=Jo(),o_=Xo(),ma=class t extends o_.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;s_.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new i_.Pair(e.key,null):r=new i_.Pair(e,null),o_.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=o_.findPair(this.items,e);return!r&&s_.isPair(n)?s_.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=o_.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new i_.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(i_.createPair(s,null,n));return o}};ma.tag="tag:yaml.org,2002:set";var dme={collection:"map",identify:t=>t instanceof Set,nodeClass:ma,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ma.from(t,e,r),resolve(t,e){if(s_.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ma,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};PT.YAMLSet=ma;PT.set=dme});var NT=v(a_=>{"use strict";var fme=ol();function DT(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function q6(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return fme.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var pme={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>DT(t,r),stringify:q6},mme={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>DT(t,!1),stringify:q6},B6={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(B6.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=DT(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};a_.floatTime=mme;a_.intTime=pme;a_.timestamp=B6});var Z6=v(G6=>{"use strict";var hme=nl(),gme=Wy(),yme=il(),_me=_f(),bme=$T(),H6=F6(),jT=L6(),c_=U6(),vme=zy(),Sme=TT(),wme=t_(),xme=CT(),MT=NT(),$me=[hme.map,yme.seq,_me.string,gme.nullTag,H6.trueTag,H6.falseTag,c_.intBin,c_.intOct,c_.int,c_.intHex,jT.floatNaN,jT.floatExp,jT.float,bme.binary,vme.merge,Sme.omap,wme.pairs,xme.set,MT.intTime,MT.floatTime,MT.timestamp];G6.schema=$me});var rB=v(zT=>{"use strict";var J6=nl(),kme=Wy(),Y6=il(),Eme=_f(),Ame=gT(),FT=_T(),LT=vT(),Tme=k6(),Ome=T6(),X6=$T(),xf=zy(),Q6=TT(),eB=t_(),V6=Z6(),tB=CT(),l_=NT(),W6=new Map([["core",Tme.schema],["failsafe",[J6.map,Y6.seq,Eme.string]],["json",Ome.schema],["yaml11",V6.schema],["yaml-1.1",V6.schema]]),K6={binary:X6.binary,bool:Ame.boolTag,float:FT.float,floatExp:FT.floatExp,floatNaN:FT.floatNaN,floatTime:l_.floatTime,int:LT.int,intHex:LT.intHex,intOct:LT.intOct,intTime:l_.intTime,map:J6.map,merge:xf.merge,null:kme.nullTag,omap:Q6.omap,pairs:eB.pairs,seq:Y6.seq,set:tB.set,timestamp:l_.timestamp},Rme={"tag:yaml.org,2002:binary":X6.binary,"tag:yaml.org,2002:merge":xf.merge,"tag:yaml.org,2002:omap":Q6.omap,"tag:yaml.org,2002:pairs":eB.pairs,"tag:yaml.org,2002:set":tB.set,"tag:yaml.org,2002:timestamp":l_.timestamp};function Ime(t,e,r){let n=W6.get(e);if(n&&!t)return r&&!n.includes(xf.merge)?n.concat(xf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(W6.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(xf.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?K6[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(K6).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}zT.coreKnownTags=Rme;zT.getTags=Ime});var BT=v(nB=>{"use strict";var UT=De(),Pme=nl(),Cme=il(),Dme=_f(),u_=rB(),Nme=(t,e)=>t.keye.key?1:0,qT=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?u_.getTags(e,"compat"):e?u_.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?u_.coreKnownTags:{},this.tags=u_.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,UT.MAP,{value:Pme.map}),Object.defineProperty(this,UT.SCALAR,{value:Dme.string}),Object.defineProperty(this,UT.SEQ,{value:Cme.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Nme:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};nB.Schema=qT});var oB=v(iB=>{"use strict";var jme=De(),HT=hf(),$f=df();function Mme(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=HT.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift($f.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(jme.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push($f.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=HT.stringify(t.contents,i,()=>a=null,c);a&&(l+=$f.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(HT.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(` `)?(r.push("..."),r.push($f.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&r[r.length-1]!==""&&r.push(""),r.push($f.indentComment(o(c),"")))}return r.join(` `)+` -`}nB.stringifyDocument=jme});var kf=v(oB=>{"use strict";var Mme=lf(),sl=Oy(),En=De(),Fme=Jo(),Lme=Zo(),zme=qT(),Ume=iB(),HT=ky(),qme=WA(),Bme=uf(),GT=VA(),ZT=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,En.NODE_TYPE,{value:En.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new GT.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[En.NODE_TYPE]:{value:En.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=En.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){al(this.contents)&&this.contents.add(e)}addIn(e,r){al(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=HT.anchorNames(this);e.anchor=!r||n.has(r)?HT.findNewAnchor(r||"a",n):r}return new Mme.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let g=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,b=r.filter(g).map(String);b.length>0&&(r=r.concat(b)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=HT.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=Bme.createNode(e,u,m);return a&&En.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new Fme.Pair(i,o)}delete(e){return al(this.contents)?this.contents.delete(e):!1}deleteIn(e){return sl.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):al(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return En.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return sl.isEmptyPath(e)?!r&&En.isScalar(this.contents)?this.contents.value:this.contents:En.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return En.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return sl.isEmptyPath(e)?this.contents!==void 0:En.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=sl.collectionFromPath(this.schema,[e],r):al(this.contents)&&this.contents.set(e,r)}setIn(e,r){sl.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=sl.collectionFromPath(this.schema,Array.from(e),r):al(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new GT.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new GT.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new zme.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Lme.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?qme.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Ume.stringifyDocument(this,e)}};function al(t){if(En.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}oB.Document=ZT});var Tf=v(Af=>{"use strict";var Ef=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},VT=class extends Ef{constructor(e,r,n){super("YAMLParseError",e,r,n)}},WT=class extends Ef{constructor(e,r,n){super("YAMLWarning",e,r,n)}},Hme=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 +`}iB.stringifyDocument=Mme});var kf=v(sB=>{"use strict";var Fme=lf(),sl=Ry(),En=De(),Lme=Jo(),zme=Zo(),Ume=BT(),qme=oB(),GT=Ey(),Bme=KA(),Hme=uf(),ZT=WA(),VT=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,En.NODE_TYPE,{value:En.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new ZT.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[En.NODE_TYPE]:{value:En.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=En.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){al(this.contents)&&this.contents.add(e)}addIn(e,r){al(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=GT.anchorNames(this);e.anchor=!r||n.has(r)?GT.findNewAnchor(r||"a",n):r}return new Fme.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let g=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,b=r.filter(g).map(String);b.length>0&&(r=r.concat(b)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=GT.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=Hme.createNode(e,u,m);return a&&En.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new Lme.Pair(i,o)}delete(e){return al(this.contents)?this.contents.delete(e):!1}deleteIn(e){return sl.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):al(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return En.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return sl.isEmptyPath(e)?!r&&En.isScalar(this.contents)?this.contents.value:this.contents:En.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return En.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return sl.isEmptyPath(e)?this.contents!==void 0:En.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=sl.collectionFromPath(this.schema,[e],r):al(this.contents)&&this.contents.set(e,r)}setIn(e,r){sl.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=sl.collectionFromPath(this.schema,Array.from(e),r):al(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ZT.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new ZT.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new Ume.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=zme.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?Bme.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return qme.stringifyDocument(this,e)}};function al(t){if(En.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}sB.Document=VT});var Tf=v(Af=>{"use strict";var Ef=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},WT=class extends Ef{constructor(e,r,n){super("YAMLParseError",e,r,n)}},KT=class extends Ef{constructor(e,r,n){super("YAMLWarning",e,r,n)}},Gme=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 `),s=a+s}if(/[^ ]/.test(s)){let a=1,c=r.linePos[1];c?.line===n&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-o)));let l=" ".repeat(o)+"^".repeat(a);r.message+=`: ${s} ${l} -`}};Af.YAMLError=Ef;Af.YAMLParseError=VT;Af.YAMLWarning=WT;Af.prettifyError=Hme});var Of=v(sB=>{"use strict";function Gme(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,m=!1,h=null,g=null,b=null,_=null,S=null,x=null,w=null;for(let A of t)switch(m&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&o(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(l&&A.type!=="comment"&&A.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),A.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&A.source.includes(" ")&&(h=A),u=!0;break;case"comment":{u||o(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=A.source.substring(1)||" ";d?d+=f+D:d=D,f="",l=!1;break}case"newline":l?d?d+=A.source:(!x||r!=="seq-item-ind")&&(c=!0):f+=A.source,l=!0,p=!0,(g||b)&&(_=A),u=!0;break;case"anchor":g&&o(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&o(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=A,w??(w=A.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(A,"MULTIPLE_TAGS","A node can have at most one tag"),b=A,w??(w=A.offset),l=!1,u=!1,m=!0;break}case r:(g||b)&&o(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),x&&o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e??"collection"}`),x=A,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){S&&o(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=A,l=!1,u=!1;break}default:o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),l=!1,u=!1}let O=t[t.length-1],T=O?O.offset+O.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:x,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:b,newlineAfterProp:_,end:T,start:w??T}}sB.resolveProps=Gme});var u_=v(aB=>{"use strict";function KT(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` -`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(KT(e.key)||KT(e.value))return!0}return!1;default:return!0}}aB.containsNewline=KT});var JT=v(cB=>{"use strict";var Zme=u_();function Vme(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Zme.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}cB.flowIndentCheck=Vme});var YT=v(uB=>{"use strict";var lB=De();function Wme(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||lB.isScalar(o)&&lB.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}uB.mapIncludes=Wme});var gB=v(hB=>{"use strict";var dB=Jo(),Kme=Xo(),fB=Of(),Jme=u_(),pB=JT(),Yme=YT(),mB="All mapping items must start at the same column";function Xme({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Kme.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:m}=u,h=fB.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",mB)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=` -`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||Jme.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",mB);r.atKey=!0;let b=h.end,_=f?t(r,f,h,i):e(r,b,d,null,h,i);r.schema.compat&&pB.flowIndentCheck(n.indent,f,i),r.atKey=!1,Yme.mapIncludes(r,a.items,_)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let S=fB.resolveProps(p??[],{indicator:"map-value-ind",next:m,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=S.end,S.found){g&&(m?.type==="block-map"&&!S.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start{"use strict";var Qme=Qo(),ehe=Of(),the=JT();function rhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Qme.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=ehe.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&the.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}yB.resolveBlockSeq=rhe});var cl=v(bB=>{"use strict";function nhe(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}bB.resolveEnd=nhe});var xB=v(wB=>{"use strict";var ihe=De(),ohe=Jo(),vB=Xo(),she=Qo(),ahe=cl(),SB=Of(),che=u_(),lhe=YT(),XT="Block collections are not allowed within flow collections",QT=t=>t&&(t.type==="block-map"||t.type==="block-seq");function uhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?vB.YAMLMap:she.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g0){let g=ahe.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` -`+g.comment:l.comment=g.comment),l.range=[n.offset,h,g.offset]}else l.range=[n.offset,h,h];return l}wB.resolveFlowCollection=uhe});var kB=v($B=>{"use strict";var dhe=De(),fhe=Dt(),phe=Xo(),mhe=Qo(),hhe=gB(),ghe=_B(),yhe=xB();function eO(t,e,r,n,i,o){let s=r.type==="block-map"?hhe.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?ghe.resolveBlockSeq(t,e,r,n,o):yhe.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function _he(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,m=f&&o?f.offset>o.offset?f:o:f??o;m&&(!p||p.offsetf.tag===s&&f.collection===a);if(!c){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),eO(t,e,r,i,s)}let l=eO(t,e,r,i,s,c),u=c.resolve?.(l,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??l,d=dhe.isNode(u)?u:new fhe.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}$B.composeCollection=_he});var rO=v(EB=>{"use strict";var tO=Dt();function bhe(t,e,r){let n=e.offset,i=vhe(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?tO.Scalar.BLOCK_FOLDED:tO.Scalar.BLOCK_LITERAL,s=e.source?She(e.source):[],a=s.length;for(let h=s.length-1;h>=0;--h){let g=s[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&s.length>0?` +`}};Af.YAMLError=Ef;Af.YAMLParseError=WT;Af.YAMLWarning=KT;Af.prettifyError=Gme});var Of=v(aB=>{"use strict";function Zme(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,m=!1,h=null,g=null,b=null,_=null,S=null,x=null,w=null;for(let A of t)switch(m&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&o(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(l&&A.type!=="comment"&&A.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),A.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&A.source.includes(" ")&&(h=A),u=!0;break;case"comment":{u||o(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=A.source.substring(1)||" ";d?d+=f+D:d=D,f="",l=!1;break}case"newline":l?d?d+=A.source:(!x||r!=="seq-item-ind")&&(c=!0):f+=A.source,l=!0,p=!0,(g||b)&&(_=A),u=!0;break;case"anchor":g&&o(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&o(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=A,w??(w=A.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(A,"MULTIPLE_TAGS","A node can have at most one tag"),b=A,w??(w=A.offset),l=!1,u=!1,m=!0;break}case r:(g||b)&&o(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),x&&o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e??"collection"}`),x=A,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){S&&o(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=A,l=!1,u=!1;break}default:o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),l=!1,u=!1}let O=t[t.length-1],T=O?O.offset+O.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:x,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:b,newlineAfterProp:_,end:T,start:w??T}}aB.resolveProps=Zme});var d_=v(cB=>{"use strict";function JT(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(JT(e.key)||JT(e.value))return!0}return!1;default:return!0}}cB.containsNewline=JT});var YT=v(lB=>{"use strict";var Vme=d_();function Wme(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Vme.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}lB.flowIndentCheck=Wme});var XT=v(dB=>{"use strict";var uB=De();function Kme(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||uB.isScalar(o)&&uB.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}dB.mapIncludes=Kme});var yB=v(gB=>{"use strict";var fB=Jo(),Jme=Xo(),pB=Of(),Yme=d_(),mB=YT(),Xme=XT(),hB="All mapping items must start at the same column";function Qme({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Jme.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:m}=u,h=pB.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",hB)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=` +`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||Yme.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",hB);r.atKey=!0;let b=h.end,_=f?t(r,f,h,i):e(r,b,d,null,h,i);r.schema.compat&&mB.flowIndentCheck(n.indent,f,i),r.atKey=!1,Xme.mapIncludes(r,a.items,_)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let S=pB.resolveProps(p??[],{indicator:"map-value-ind",next:m,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=S.end,S.found){g&&(m?.type==="block-map"&&!S.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start{"use strict";var ehe=Qo(),the=Of(),rhe=YT();function nhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??ehe.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=the.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&rhe.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}_B.resolveBlockSeq=nhe});var cl=v(vB=>{"use strict";function ihe(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}vB.resolveEnd=ihe});var $B=v(xB=>{"use strict";var ohe=De(),she=Jo(),SB=Xo(),ahe=Qo(),che=cl(),wB=Of(),lhe=d_(),uhe=XT(),QT="Block collections are not allowed within flow collections",eO=t=>t&&(t.type==="block-map"||t.type==="block-seq");function dhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?SB.YAMLMap:ahe.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g0){let g=che.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` +`+g.comment:l.comment=g.comment),l.range=[n.offset,h,g.offset]}else l.range=[n.offset,h,h];return l}xB.resolveFlowCollection=dhe});var EB=v(kB=>{"use strict";var fhe=De(),phe=Dt(),mhe=Xo(),hhe=Qo(),ghe=yB(),yhe=bB(),_he=$B();function tO(t,e,r,n,i,o){let s=r.type==="block-map"?ghe.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?yhe.resolveBlockSeq(t,e,r,n,o):_he.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function bhe(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,m=f&&o?f.offset>o.offset?f:o:f??o;m&&(!p||p.offsetf.tag===s&&f.collection===a);if(!c){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),tO(t,e,r,i,s)}let l=tO(t,e,r,i,s,c),u=c.resolve?.(l,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??l,d=fhe.isNode(u)?u:new phe.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}kB.composeCollection=bhe});var nO=v(AB=>{"use strict";var rO=Dt();function vhe(t,e,r){let n=e.offset,i=She(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?rO.Scalar.BLOCK_FOLDED:rO.Scalar.BLOCK_LITERAL,s=e.source?whe(e.source):[],a=s.length;for(let h=s.length-1;h>=0;--h){let g=s[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&s.length>0?` `.repeat(Math.max(1,s.length-1)):"",g=n+i.length;return e.source&&(g+=e.source.length),{value:h,type:o,comment:i.comment,range:[n,g,g]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let h=0;hc&&(c=g.length);else{g.length=a;--h)s[h][0].length>c&&(a=h+1);let d="",f="",p=!1;for(let h=0;hc||b[0]===" "?(f===" "?f=` `:!p&&f===` `&&(f=` @@ -112,91 +112,91 @@ ${l} `+s[h][0].slice(c);d[d.length-1]!==` `&&(d+=` `);break;default:d+=` -`}let m=n+i.length+e.source.length;return{value:d,type:o,comment:i.comment,range:[n,m,m]}}function vhe({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",c=-1;for(let f=1;f{"use strict";var nO=Dt(),whe=cl();function xhe(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(f,p,m)=>r(n+f,p,m);switch(i){case"scalar":a=nO.Scalar.PLAIN,c=$he(o,l);break;case"single-quoted-scalar":a=nO.Scalar.QUOTE_SINGLE,c=khe(o,l);break;case"double-quoted-scalar":a=nO.Scalar.QUOTE_DOUBLE,c=Ehe(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,d=whe.resolveEnd(s,u,e,r);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function $he(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),AB(t)}function khe(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),AB(t.slice(1,-1)).replace(/''/g,"'")}function AB(t){let e,r;try{e=new RegExp(`(.*?)(?{"use strict";var iO=Dt(),xhe=cl();function $he(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(f,p,m)=>r(n+f,p,m);switch(i){case"scalar":a=iO.Scalar.PLAIN,c=khe(o,l);break;case"single-quoted-scalar":a=iO.Scalar.QUOTE_SINGLE,c=Ehe(o,l);break;case"double-quoted-scalar":a=iO.Scalar.QUOTE_DOUBLE,c=Ahe(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,d=xhe.resolveEnd(s,u,e,r);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function khe(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),TB(t)}function Ehe(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),TB(t.slice(1,-1)).replace(/''/g,"'")}function TB(t){let e,r;try{e=new RegExp(`(.*?)(?o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function Ahe(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` +`)&&(r+=n>o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function The(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` `||n==="\r")&&!(n==="\r"&&t[e+2]!==` `);)n===` `&&(r+=` -`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var The={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Ohe(t,e,r,n){let i=t.substr(e,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}TB.resolveFlowScalar=xhe});var IB=v(RB=>{"use strict";var ha=De(),OB=Dt(),Rhe=rO(),Ihe=iO();function Phe(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?Rhe.resolveBlockScalar(t,e,n):Ihe.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[ha.SCALAR]:c?l=Che(t.schema,i,c,r,n):e.type==="scalar"?l=Dhe(t,i,e,n):l=t.schema[ha.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=ha.isScalar(d)?d:new OB.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new OB.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function Che(t,e,r,n,i){if(r==="!")return t[ha.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[ha.SCALAR])}function Dhe({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[ha.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[ha.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}RB.composeScalar=Phe});var CB=v(PB=>{"use strict";function Nhe(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}PB.emptyScalarPosition=Nhe});var jB=v(sO=>{"use strict";var jhe=lf(),Mhe=De(),Fhe=kB(),DB=IB(),Lhe=cl(),zhe=CB(),Uhe={composeNode:NB,composeEmptyNode:oO};function NB(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=qhe(t,e,n),(a||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=DB.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Fhe.composeCollection(Uhe,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(d){let f=d instanceof Error?d.message:String(d);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=oO(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Mhe.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function oO(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:zhe.emptyScalarPosition(e,r,n),indent:-1,source:""},d=DB.composeScalar(t,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function qhe({options:t},{offset:e,source:r,end:n},i){let o=new jhe.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=Lhe.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}sO.composeEmptyNode=oO;sO.composeNode=NB});var LB=v(FB=>{"use strict";var Bhe=kf(),MB=jB(),Hhe=cl(),Ghe=Of();function Zhe(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new Bhe.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Ghe.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?MB.composeNode(l,i,u,s):MB.composeEmptyNode(l,u.end,n,null,u,s);let d=c.contents.range[2],f=Hhe.resolveEnd(o,d,!1,s);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}FB.composeDoc=Zhe});var cO=v(qB=>{"use strict";var Vhe=Ge("process"),Whe=VA(),Khe=kf(),Rf=Tf(),zB=De(),Jhe=LB(),Yhe=cl();function If(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function UB(t){let e="",r=!1,n=!1;for(let i=0;i{"use strict";var ha=De(),RB=Dt(),Ihe=nO(),Phe=oO();function Che(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?Ihe.resolveBlockScalar(t,e,n):Phe.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[ha.SCALAR]:c?l=Dhe(t.schema,i,c,r,n):e.type==="scalar"?l=Nhe(t,i,e,n):l=t.schema[ha.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=ha.isScalar(d)?d:new RB.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new RB.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function Dhe(t,e,r,n,i){if(r==="!")return t[ha.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[ha.SCALAR])}function Nhe({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[ha.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[ha.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}IB.composeScalar=Che});var DB=v(CB=>{"use strict";function jhe(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}CB.emptyScalarPosition=jhe});var MB=v(aO=>{"use strict";var Mhe=lf(),Fhe=De(),Lhe=EB(),NB=PB(),zhe=cl(),Uhe=DB(),qhe={composeNode:jB,composeEmptyNode:sO};function jB(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=Bhe(t,e,n),(a||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=NB.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Lhe.composeCollection(qhe,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(d){let f=d instanceof Error?d.message:String(d);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=sO(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Fhe.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function sO(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:Uhe.emptyScalarPosition(e,r,n),indent:-1,source:""},d=NB.composeScalar(t,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function Bhe({options:t},{offset:e,source:r,end:n},i){let o=new Mhe.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=zhe.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}aO.composeEmptyNode=sO;aO.composeNode=jB});var zB=v(LB=>{"use strict";var Hhe=kf(),FB=MB(),Ghe=cl(),Zhe=Of();function Vhe(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new Hhe.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Zhe.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?FB.composeNode(l,i,u,s):FB.composeEmptyNode(l,u.end,n,null,u,s);let d=c.contents.range[2],f=Ghe.resolveEnd(o,d,!1,s);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}LB.composeDoc=Vhe});var lO=v(BB=>{"use strict";var Whe=Ge("process"),Khe=WA(),Jhe=kf(),Rf=Tf(),UB=De(),Yhe=zB(),Xhe=cl();function If(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function qB(t){let e="",r=!1,n=!1;for(let i=0;i{let s=If(r);o?this.warnings.push(new Rf.YAMLWarning(s,n,i)):this.errors.push(new Rf.YAMLParseError(s,n,i))},this.directives=new Whe.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=UB(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment} -${n}`:n;else if(i||e.directives.docStart||!o)e.commentBefore=n;else if(zB.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];zB.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${n} +`)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var cO=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,o)=>{let s=If(r);o?this.warnings.push(new Rf.YAMLWarning(s,n,i)):this.errors.push(new Rf.YAMLParseError(s,n,i))},this.directives=new Khe.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=qB(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment} +${n}`:n;else if(i||e.directives.docStart||!o)e.commentBefore=n;else if(UB.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];UB.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${n} ${a}`:n}else{let s=o.commentBefore;o.commentBefore=s?`${n} -${s}`:n}}if(r){for(let o=0;o{let o=If(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Jhe.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Rf.YAMLParseError(If(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Rf.YAMLParseError(If(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Yhe.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} -${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Rf.YAMLParseError(If(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Khe.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};qB.Composer=aO});var GB=v(d_=>{"use strict";var Xhe=rO(),Qhe=iO(),ege=Tf(),BB=mf();function tge(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new ege.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Qhe.resolveFlowScalar(t,e,n);case"block-scalar":return Xhe.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function rge(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=BB.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:` +${s}`:n}}if(r){for(let o=0;o{let o=If(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Yhe.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Rf.YAMLParseError(If(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Rf.YAMLParseError(If(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Xhe.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} +${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Rf.YAMLParseError(If(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Jhe.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};BB.Composer=cO});var ZB=v(f_=>{"use strict";var Qhe=nO(),ege=oO(),tge=Tf(),HB=mf();function rge(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new tge.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return ege.resolveFlowScalar(t,e,n);case"block-scalar":return Qhe.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function nge(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=HB.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:` `}];switch(a[0]){case"|":case">":{let l=a.indexOf(` `),u=a.substring(0,l),d=a.substring(l+1)+` -`,f=[{type:"block-scalar-header",offset:o,indent:n,source:u}];return HB(f,c)||f.push({type:"newline",offset:-1,indent:n,source:` -`}),{type:"block-scalar",offset:o,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function nge(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=BB.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":ige(t,c);break;case'"':lO(t,c,"double-quoted-scalar");break;case"'":lO(t,c,"single-quoted-scalar");break;default:lO(t,c,"scalar")}}function ige(t,e){let r=e.indexOf(` +`,f=[{type:"block-scalar-header",offset:o,indent:n,source:u}];return GB(f,c)||f.push({type:"newline",offset:-1,indent:n,source:` +`}),{type:"block-scalar",offset:o,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function ige(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=HB.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":oge(t,c);break;case'"':uO(t,c,"double-quoted-scalar");break;case"'":uO(t,c,"single-quoted-scalar");break;default:uO(t,c,"scalar")}}function oge(t,e){let r=e.indexOf(` `),n=e.substring(0,r),i=e.substring(r+1)+` -`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=n,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];HB(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` -`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function HB(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function lO(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of n)o.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` -`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}d_.createScalarToken=rge;d_.resolveAsScalar=tge;d_.setScalarValue=nge});var VB=v(ZB=>{"use strict";var oge=t=>"type"in t?p_(t):f_(t);function p_(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=p_(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=f_(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=f_(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=f_(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function f_({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=p_(e)),r)for(let o of r)i+=o.source;return n&&(i+=p_(n)),i}ZB.stringify=oge});var YB=v(JB=>{"use strict";var uO=Symbol("break visit"),sge=Symbol("skip children"),WB=Symbol("remove item");function ga(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),KB(Object.freeze([]),t,e)}ga.BREAK=uO;ga.SKIP=sge;ga.REMOVE=WB;ga.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};ga.parentCollection=(t,e)=>{let r=ga.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function KB(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s{"use strict";var dO=GB(),age=VB(),cge=YB(),fO="\uFEFF",pO="",mO="",hO="",lge=t=>!!t&&"items"in t,uge=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function dge(t){switch(t){case fO:return"";case pO:return"";case mO:return"";case hO:return"";default:return JSON.stringify(t)}}function fge(t){switch(t){case fO:return"byte-order-mark";case pO:return"doc-mode";case mO:return"flow-error-end";case hO:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=n,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];GB(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` +`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function GB(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function uO(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of n)o.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` +`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}f_.createScalarToken=nge;f_.resolveAsScalar=rge;f_.setScalarValue=ige});var WB=v(VB=>{"use strict";var sge=t=>"type"in t?m_(t):p_(t);function m_(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=m_(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=p_(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=p_(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=p_(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function p_({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=m_(e)),r)for(let o of r)i+=o.source;return n&&(i+=m_(n)),i}VB.stringify=sge});var XB=v(YB=>{"use strict";var dO=Symbol("break visit"),age=Symbol("skip children"),KB=Symbol("remove item");function ga(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),JB(Object.freeze([]),t,e)}ga.BREAK=dO;ga.SKIP=age;ga.REMOVE=KB;ga.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};ga.parentCollection=(t,e)=>{let r=ga.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function JB(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s{"use strict";var fO=ZB(),cge=WB(),lge=XB(),pO="\uFEFF",mO="",hO="",gO="",uge=t=>!!t&&"items"in t,dge=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function fge(t){switch(t){case pO:return"";case mO:return"";case hO:return"";case gO:return"";default:return JSON.stringify(t)}}function pge(t){switch(t){case pO:return"byte-order-mark";case mO:return"doc-mode";case hO:return"flow-error-end";case gO:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Dr.createScalarToken=dO.createScalarToken;Dr.resolveAsScalar=dO.resolveAsScalar;Dr.setScalarValue=dO.setScalarValue;Dr.stringify=age.stringify;Dr.visit=cge.visit;Dr.BOM=fO;Dr.DOCUMENT=pO;Dr.FLOW_END=mO;Dr.SCALAR=hO;Dr.isCollection=lge;Dr.isScalar=uge;Dr.prettyToken=dge;Dr.tokenType=fge});var _O=v(QB=>{"use strict";var Pf=m_();function Jn(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}var XB=new Set("0123456789ABCDEFabcdef"),pge=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),h_=new Set(",[]{}"),mge=new Set(` ,[]{} -\r `),gO=t=>!t||mge.has(t),yO=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Dr.createScalarToken=fO.createScalarToken;Dr.resolveAsScalar=fO.resolveAsScalar;Dr.setScalarValue=fO.setScalarValue;Dr.stringify=cge.stringify;Dr.visit=lge.visit;Dr.BOM=pO;Dr.DOCUMENT=mO;Dr.FLOW_END=hO;Dr.SCALAR=gO;Dr.isCollection=uge;Dr.isScalar=dge;Dr.prettyToken=fge;Dr.tokenType=pge});var bO=v(eH=>{"use strict";var Pf=h_();function Jn(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}var QB=new Set("0123456789ABCDEFabcdef"),mge=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),g_=new Set(",[]{}"),hge=new Set(` ,[]{} +\r `),yO=t=>!t||hge.has(t),_O=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` `?!0:r==="\r"?this.buffer[e+1]===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===` `||!i&&!this.atEnd)return e+n+1}return r===` `||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Jn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Jn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Jn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(gO),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&nthis.indentValue&&!Jn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Jn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(yO),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Jn(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let o=this.pos;n=this.buffer[o];++o)switch(n){case" ":r+=1;break;case` `:e=o,r=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===` `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(` `,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===` `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let o=e-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===` -`&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield Pf.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(Jn(o)||e&&h_.has(o))break;r=n}else if(Jn(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===` +`&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield Pf.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(Jn(o)||e&&g_.has(o))break;r=n}else if(Jn(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===` `?(n+=1,i=` -`,o=this.buffer[n+1]):r=n),o==="#"||e&&h_.has(o))break;if(i===` -`){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&h_.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Pf.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(gO),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Jn(n)||r&&h_.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Jn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(pge.has(r))r=this.buffer[++e];else if(r==="%"&&XB.has(this.buffer[e+1])&&XB.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` +`,o=this.buffer[n+1]):r=n),o==="#"||e&&g_.has(o))break;if(i===` +`){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&g_.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Pf.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(yO),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Jn(n)||r&&g_.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Jn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(mge.has(r))r=this.buffer[++e];else if(r==="%"&&QB.has(this.buffer[e+1])&&QB.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};QB.Lexer=yO});var vO=v(eH=>{"use strict";var bO=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[o]{"use strict";var hge=Ge("process"),tH=m_(),gge=_O();function es(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function y_(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&nH(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&rH(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};eH.Lexer=_O});var SO=v(tH=>{"use strict";var vO=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[o]{"use strict";var gge=Ge("process"),rH=h_(),yge=bO();function es(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function __(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&iH(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&nH(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;ae.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(es(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(iH(r.key)&&!es(r.sep,"newline")){let s=ll(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(es(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=ll(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):es(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!es(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){y_(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||es(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=g_(n),o=ll(i);nH(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` +`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){__(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;ae.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(es(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(oH(r.key)&&!es(r.sep,"newline")){let s=ll(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(es(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=ll(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):es(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!es(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){__(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||es(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=y_(n),o=ll(i);iH(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(` -`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=g_(e),n=ll(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=g_(e),n=ll(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};oH.Parser=SO});var uH=v(Df=>{"use strict";var sH=cO(),yge=kf(),Cf=Tf(),_ge=sT(),bge=De(),vge=vO(),aH=wO();function cH(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new vge.LineCounter||null,prettyErrors:e}}function Sge(t,e={}){let{lineCounter:r,prettyErrors:n}=cH(e),i=new aH.Parser(r?.addNewLine),o=new sH.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(Cf.prettifyError(t,r)),a.warnings.forEach(Cf.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function lH(t,e={}){let{lineCounter:r,prettyErrors:n}=cH(e),i=new aH.Parser(r?.addNewLine),o=new sH.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Cf.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(Cf.prettifyError(t,r)),s.warnings.forEach(Cf.prettifyError(t,r))),s}function wge(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=lH(t,r);if(!i)return null;if(i.warnings.forEach(o=>_ge.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function xge(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return bge.isDocument(t)&&!n?t.toString(r):new yge.Document(t,n,r).toString(r)}Df.parse=wge;Df.parseAllDocuments=Sge;Df.parseDocument=lH;Df.stringify=xge});var er=v(Ze=>{"use strict";var $ge=cO(),kge=kf(),Ege=qT(),xO=Tf(),Age=lf(),ts=De(),Tge=Jo(),Oge=Dt(),Rge=Xo(),Ige=Qo(),Pge=m_(),Cge=_O(),Dge=vO(),Nge=wO(),__=uH(),dH=of();Ze.Composer=$ge.Composer;Ze.Document=kge.Document;Ze.Schema=Ege.Schema;Ze.YAMLError=xO.YAMLError;Ze.YAMLParseError=xO.YAMLParseError;Ze.YAMLWarning=xO.YAMLWarning;Ze.Alias=Age.Alias;Ze.isAlias=ts.isAlias;Ze.isCollection=ts.isCollection;Ze.isDocument=ts.isDocument;Ze.isMap=ts.isMap;Ze.isNode=ts.isNode;Ze.isPair=ts.isPair;Ze.isScalar=ts.isScalar;Ze.isSeq=ts.isSeq;Ze.Pair=Tge.Pair;Ze.Scalar=Oge.Scalar;Ze.YAMLMap=Rge.YAMLMap;Ze.YAMLSeq=Ige.YAMLSeq;Ze.CST=Pge;Ze.Lexer=Cge.Lexer;Ze.LineCounter=Dge.LineCounter;Ze.Parser=Nge.Parser;Ze.parse=__.parse;Ze.parseAllDocuments=__.parseAllDocuments;Ze.parseDocument=__.parseDocument;Ze.stringify=__.stringify;Ze.visit=dH.visit;Ze.visitAsync=dH.visitAsync});import{execFileSync as fH}from"node:child_process";import{existsSync as b_}from"node:fs";import{join as v_,resolve as jge}from"node:path";function Mge(t){try{let e=fH("git",["rev-parse","--git-dir"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return e?jge(t,e):null}catch{return null}}function $O(t){let e=Mge(t);if(!e)return null;try{if(b_(v_(e,"MERGE_HEAD")))return"merge";if(b_(v_(e,"CHERRY_PICK_HEAD")))return"cherry-pick";if(b_(v_(e,"rebase-merge"))||b_(v_(e,"rebase-apply")))return"rebase"}catch{return null}return null}function ya(t){return $O(t)!==null}function kO(t,e){try{let r=fH("git",["rev-parse","--verify","--quiet",`${e}^{commit}`],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return r.length>0?r:null}catch{return null}}function S_(t,e){return kO(t,e)!==null}var _a=y(()=>{"use strict"});import{execFileSync as Fge}from"node:child_process";import{existsSync as Lge,readFileSync as zge}from"node:fs";import{join as hH}from"node:path";function Nf(t,e){return Fge("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}function rs(t){try{let e=Nf(t,["describe","--tags","--abbrev=0"]).trim();if(e.length>0)return e}catch{}throw new Error("changelog: no git tag found to anchor the default range \u2014 pass --since explicitly (e.g. clad changelog --since v1.0.0)")}function ns(t,e){Uge(t,e);let r=Nf(t,["rev-parse","HEAD"]).trim(),n=qge(t,e);return{groups:Bge(t,n),head:r,inventory:{after:mH(x_(t,"spec.yaml")),before:mH(EO(t,e,"spec.yaml"))},since:e,unsharded_commits:Vge(t,e)}}function AO(t){if(t.text&&t.text.trim().length>0)return t.text.trim();let e=t.action?.trim();if(!e)return null;let r=t.condition?.trim(),n=t.response?.trim(),i=r?`${r.charAt(0).toUpperCase()}${r.slice(1)}, the system shall ${e}`:`The system shall ${e}`;return n?`${i} \u2014 ${n}.`:`${i}.`}function Uge(t,e){let r=(e??"").trim();if(r.length===0)throw new Error("changelog: empty since ref \u2014 pass --since ");if(!S_(t,r))throw new Error(`changelog: '${r}' does not resolve to a commit in this repository \u2014 pass --since that exists. An unknown ref is an error, never a silently empty changelog.`)}function qge(t,e){let r=Nf(t,["diff","--name-status",`${e}..HEAD`,"--","spec/"]),n=[];for(let i of r.split(` -`)){if(i.trim().length===0)continue;let o=i.split(" "),s=o[0]??"",a=o[1]??"",c=o.length>2?o[2]:a;if(!(!pH(c)&&!pH(a)))if(s.startsWith("A")){let l=w_(x_(t,c));if(!l)continue;l.status==="done"?n.push(ul(l,"added-as-done")):l.status==="archived"&&n.push(ul(l,"archived"))}else if(s.startsWith("D")){let l=w_(EO(t,e,a));l&&n.push(ul(l,"archived"))}else{let l=w_(x_(t,c));if(!l)continue;let d=w_(EO(t,e,a))?.status;l.status==="done"&&d!=="done"?n.push(ul(l,"flipped-to-done")):l.status==="done"&&d==="done"?n.push(ul(l,"modified-while-done")):l.status==="archived"&&d!=="archived"&&n.push(ul(l,"archived"))}}return n.sort((i,o)=>i.id.localeCompare(o.id)),n}function pH(t){return t.startsWith("spec/features/")&&(t.endsWith(".yaml")||t.endsWith(".yml"))}function ul(t,e){return{acceptance:(t.acceptance_criteria??[]).map(n=>AO(n)).filter(n=>n!==null),change:e,id:t.id,...t.slug?{slug:t.slug}:{},title:t.title}}function w_(t){if(t===null)return null;let e;try{e=(0,$_.parse)(t)}catch{return null}let r=e;return!r||typeof r.id!="string"||typeof r.status!="string"?null:{id:r.id,slug:typeof r.slug=="string"?r.slug:void 0,title:typeof r.title=="string"?r.title:r.id,status:r.status,acceptance_criteria:r.acceptance_criteria}}function x_(t,e){let r=hH(t,e);if(!Lge(r))return null;try{return zge(r,"utf8")}catch{return null}}function EO(t,e,r){try{return Nf(t,["show",`${e}:${r}`])}catch{return null}}function Bge(t,e){let r=Hge(t).filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=[],i=new Set;for(let s of r){let a=new Set(s.features??[]),c=e.filter(l=>a.has(l.id)&&!i.has(l.id));if(c.length!==0){for(let l of c)i.add(l.id);n.push({capability:s.id,features:c,title:s.title??s.id})}}let o=e.filter(s=>!i.has(s.id));return o.length>0&&n.push({capability:"uncategorized",features:o,title:"Uncategorized"}),n}function Hge(t){let e=x_(t,hH("spec","capabilities.yaml"));if(e===null)return[];try{let r=(0,$_.parse)(e);return Array.isArray(r?.capabilities)?r.capabilities:[]}catch{return[]}}function mH(t){let e={};if(t!==null)try{let n=(0,$_.parse)(t);n&&typeof n.inventory=="object"&&n.inventory!==null&&(e=n.inventory)}catch{}let r=n=>typeof e[n]=="number"?e[n]:0;return{capabilities:r("capabilities"),features:r("features"),scenarios:r("scenarios"),test_files:r("test_files")}}function Vge(t,e){let r=Nf(t,["log",`${e}..HEAD`,"--format=%h%x09%s","--","src/"]),n=[];for(let i of r.split(` -`)){if(i.trim().length===0)continue;let o=i.indexOf(" ");if(o<0)continue;let s=i.slice(0,o),a=i.slice(o+1);Gge.test(a)&&(Zge.test(a)||n.push({hash:s,subject:a}))}return n}var $_,Gge,Zge,dl=y(()=>{"use strict";$_=St(er(),1);_a();Gge=/^(feat|fix)(\([^)]*\))?!?:/,Zge=/\bF-(\d{3,}|[a-f0-9]{6,})\b/});import{execFileSync as gH}from"node:child_process";import{appendFileSync as Wge,existsSync as TO,mkdirSync as Kge,readFileSync as Jge,renameSync as Yge,statSync as Xge}from"node:fs";import{userInfo as Qge}from"node:os";import{dirname as eye,join as RO}from"node:path";function IO(t){return RO(t,yH,tye)}function Qr(t,e){let r=IO(t),n=eye(r);TO(n)||Kge(n,{recursive:!0});try{TO(r)&&Xge(r).size>rye&&Yge(r,RO(n,_H))}catch{}Wge(r,`${JSON.stringify(e)} -`,"utf8")}function OO(t){if(!TO(t))return[];let e=Jge(t,"utf8").trim();return e.length===0?[]:e.split(` -`).filter(r=>r.length>0).map(r=>JSON.parse(r))}function ba(t){return OO(IO(t))}function k_(t){return[...OO(RO(t,yH,_H)),...OO(IO(t))]}function en(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function nye(t){let e;try{e=gH("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=Qge().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function iye(t){try{return gH("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function jf(t,e){try{let r=ba(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function tr(t,e,r){try{let n=iye(t),i=nye(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=jf(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Qr(t,en(e,o))}catch{}}var yH,tye,_H,rye,Nr=y(()=>{"use strict";yH=".cladding",tye="events.log.jsonl",_H="events.log.1.jsonl",rye=5*1024*1024});import{execFileSync as oye}from"node:child_process";import{existsSync as bH,readdirSync as sye,readFileSync as aye,statSync as vH}from"node:fs";import{createHash as cye}from"node:crypto";import{join as PO}from"node:path";function va(t){try{return oye("git",["rev-parse","HEAD"],{cwd:t,stdio:["ignore","pipe","ignore"]}).toString("utf8").trim()||null}catch{return null}}function CO(t){let e=[],r=PO(t,"spec.yaml");bH(r)&&vH(r).isFile()&&e.push(r);for(let i of["features","scenarios"]){let o=PO(t,"spec",i);if(!(!bH(o)||!vH(o).isDirectory()))for(let s of sye(o))s.endsWith(".yaml")&&e.push(PO(o,s))}e.sort();let n=cye("sha256");for(let i of e){let o=i.slice(t.length+1);n.update(`${o}\0`),n.update(aye(i)),n.update("\0")}return n.digest("hex")}function E_(t,e){let r={featureId:e,gitHead:va(t),specDigest:CO(t),timestamp:new Date().toISOString()};return Qr(t,en("feature_checkpoint",{feature:e,git_head:r.gitHead,spec_digest:r.specDigest})),r}function A_(t,e){let r=ba(t);for(let n=r.length-1;n>=0;n--){let i=r[n];if(i.type==="feature_checkpoint"&&i.payload.feature===e)return{featureId:e,gitHead:i.payload.git_head??null,specDigest:String(i.payload.spec_digest??""),timestamp:i.timestamp}}return null}function T_(t,e,r,n){let i=en("feature_rolled_back",{feature:e,to_git_head:r.gitHead,to_spec_digest:r.specDigest,to_checkpoint_at:r.timestamp,reason:n??null});return Qr(t,i),i}var Mf=y(()=>{"use strict";Nr()});import{readFileSync as lye,statSync as uye}from"node:fs";import{extname as dye,resolve as DO,sep as fye}from"node:path";function tn(t){return Math.ceil(t.length/4)}function hye(t,e){let r=DO(e),n=DO(r,t);return n===r||n.startsWith(r+fye)}function wH(t,e,r,n){if(!hye(t,e))return{path:t,omitted:"unsafe-path"};if(!pye.has(dye(t).toLowerCase()))return{path:t,omitted:"unsupported"};let i,o;if(n){let l=n(t);if(l==null)return{path:t,omitted:"missing"};if(i=l,o=Buffer.byteLength(l,"utf8"),o>SH)return{path:t,omitted:"too-large",bytes:o}}else{let l=DO(e,t);try{o=uye(l).size}catch{return{path:t,omitted:"missing"}}if(o>SH)return{path:t,omitted:"too-large",bytes:o};try{i=lye(l,"utf8")}catch{return{path:t,omitted:"missing",bytes:o}}}if(i.includes(mye))return{path:t,omitted:"binary",bytes:o};let s=Math.max(0,Math.floor(r));if(i.length<=s)return{path:t,text:i,bytes:o};let a=` +`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=y_(e),n=ll(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=y_(e),n=ll(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};sH.Parser=wO});var dH=v(Df=>{"use strict";var aH=lO(),_ge=kf(),Cf=Tf(),bge=aT(),vge=De(),Sge=SO(),cH=xO();function lH(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Sge.LineCounter||null,prettyErrors:e}}function wge(t,e={}){let{lineCounter:r,prettyErrors:n}=lH(e),i=new cH.Parser(r?.addNewLine),o=new aH.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(Cf.prettifyError(t,r)),a.warnings.forEach(Cf.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function uH(t,e={}){let{lineCounter:r,prettyErrors:n}=lH(e),i=new cH.Parser(r?.addNewLine),o=new aH.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Cf.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(Cf.prettifyError(t,r)),s.warnings.forEach(Cf.prettifyError(t,r))),s}function xge(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=uH(t,r);if(!i)return null;if(i.warnings.forEach(o=>bge.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function $ge(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return vge.isDocument(t)&&!n?t.toString(r):new _ge.Document(t,n,r).toString(r)}Df.parse=xge;Df.parseAllDocuments=wge;Df.parseDocument=uH;Df.stringify=$ge});var er=v(Ze=>{"use strict";var kge=lO(),Ege=kf(),Age=BT(),$O=Tf(),Tge=lf(),ts=De(),Oge=Jo(),Rge=Dt(),Ige=Xo(),Pge=Qo(),Cge=h_(),Dge=bO(),Nge=SO(),jge=xO(),b_=dH(),fH=of();Ze.Composer=kge.Composer;Ze.Document=Ege.Document;Ze.Schema=Age.Schema;Ze.YAMLError=$O.YAMLError;Ze.YAMLParseError=$O.YAMLParseError;Ze.YAMLWarning=$O.YAMLWarning;Ze.Alias=Tge.Alias;Ze.isAlias=ts.isAlias;Ze.isCollection=ts.isCollection;Ze.isDocument=ts.isDocument;Ze.isMap=ts.isMap;Ze.isNode=ts.isNode;Ze.isPair=ts.isPair;Ze.isScalar=ts.isScalar;Ze.isSeq=ts.isSeq;Ze.Pair=Oge.Pair;Ze.Scalar=Rge.Scalar;Ze.YAMLMap=Ige.YAMLMap;Ze.YAMLSeq=Pge.YAMLSeq;Ze.CST=Cge;Ze.Lexer=Dge.Lexer;Ze.LineCounter=Nge.LineCounter;Ze.Parser=jge.Parser;Ze.parse=b_.parse;Ze.parseAllDocuments=b_.parseAllDocuments;Ze.parseDocument=b_.parseDocument;Ze.stringify=b_.stringify;Ze.visit=fH.visit;Ze.visitAsync=fH.visitAsync});import{execFileSync as pH}from"node:child_process";import{existsSync as v_}from"node:fs";import{join as S_,resolve as Mge}from"node:path";function Fge(t){try{let e=pH("git",["rev-parse","--git-dir"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return e?Mge(t,e):null}catch{return null}}function kO(t){let e=Fge(t);if(!e)return null;try{if(v_(S_(e,"MERGE_HEAD")))return"merge";if(v_(S_(e,"CHERRY_PICK_HEAD")))return"cherry-pick";if(v_(S_(e,"rebase-merge"))||v_(S_(e,"rebase-apply")))return"rebase"}catch{return null}return null}function ya(t){return kO(t)!==null}function EO(t,e){try{let r=pH("git",["rev-parse","--verify","--quiet",`${e}^{commit}`],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return r.length>0?r:null}catch{return null}}function w_(t,e){return EO(t,e)!==null}var _a=y(()=>{"use strict"});import{execFileSync as Lge}from"node:child_process";import{existsSync as zge,readFileSync as Uge}from"node:fs";import{join as gH}from"node:path";function Nf(t,e){return Lge("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}function rs(t){try{let e=Nf(t,["describe","--tags","--abbrev=0"]).trim();if(e.length>0)return e}catch{}throw new Error("changelog: no git tag found to anchor the default range \u2014 pass --since explicitly (e.g. clad changelog --since v1.0.0)")}function ns(t,e){qge(t,e);let r=Nf(t,["rev-parse","HEAD"]).trim(),n=Bge(t,e);return{groups:Hge(t,n),head:r,inventory:{after:hH($_(t,"spec.yaml")),before:hH(AO(t,e,"spec.yaml"))},since:e,unsharded_commits:Wge(t,e)}}function TO(t){if(t.text&&t.text.trim().length>0)return t.text.trim();let e=t.action?.trim();if(!e)return null;let r=t.condition?.trim(),n=t.response?.trim(),i=r?`${r.charAt(0).toUpperCase()}${r.slice(1)}, the system shall ${e}`:`The system shall ${e}`;return n?`${i} \u2014 ${n}.`:`${i}.`}function qge(t,e){let r=(e??"").trim();if(r.length===0)throw new Error("changelog: empty since ref \u2014 pass --since ");if(!w_(t,r))throw new Error(`changelog: '${r}' does not resolve to a commit in this repository \u2014 pass --since that exists. An unknown ref is an error, never a silently empty changelog.`)}function Bge(t,e){let r=Nf(t,["diff","--name-status",`${e}..HEAD`,"--","spec/"]),n=[];for(let i of r.split(` +`)){if(i.trim().length===0)continue;let o=i.split(" "),s=o[0]??"",a=o[1]??"",c=o.length>2?o[2]:a;if(!(!mH(c)&&!mH(a)))if(s.startsWith("A")){let l=x_($_(t,c));if(!l)continue;l.status==="done"?n.push(ul(l,"added-as-done")):l.status==="archived"&&n.push(ul(l,"archived"))}else if(s.startsWith("D")){let l=x_(AO(t,e,a));l&&n.push(ul(l,"archived"))}else{let l=x_($_(t,c));if(!l)continue;let d=x_(AO(t,e,a))?.status;l.status==="done"&&d!=="done"?n.push(ul(l,"flipped-to-done")):l.status==="done"&&d==="done"?n.push(ul(l,"modified-while-done")):l.status==="archived"&&d!=="archived"&&n.push(ul(l,"archived"))}}return n.sort((i,o)=>i.id.localeCompare(o.id)),n}function mH(t){return t.startsWith("spec/features/")&&(t.endsWith(".yaml")||t.endsWith(".yml"))}function ul(t,e){return{acceptance:(t.acceptance_criteria??[]).map(n=>TO(n)).filter(n=>n!==null),change:e,id:t.id,...t.slug?{slug:t.slug}:{},title:t.title}}function x_(t){if(t===null)return null;let e;try{e=(0,k_.parse)(t)}catch{return null}let r=e;return!r||typeof r.id!="string"||typeof r.status!="string"?null:{id:r.id,slug:typeof r.slug=="string"?r.slug:void 0,title:typeof r.title=="string"?r.title:r.id,status:r.status,acceptance_criteria:r.acceptance_criteria}}function $_(t,e){let r=gH(t,e);if(!zge(r))return null;try{return Uge(r,"utf8")}catch{return null}}function AO(t,e,r){try{return Nf(t,["show",`${e}:${r}`])}catch{return null}}function Hge(t,e){let r=Gge(t).filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=[],i=new Set;for(let s of r){let a=new Set(s.features??[]),c=e.filter(l=>a.has(l.id)&&!i.has(l.id));if(c.length!==0){for(let l of c)i.add(l.id);n.push({capability:s.id,features:c,title:s.title??s.id})}}let o=e.filter(s=>!i.has(s.id));return o.length>0&&n.push({capability:"uncategorized",features:o,title:"Uncategorized"}),n}function Gge(t){let e=$_(t,gH("spec","capabilities.yaml"));if(e===null)return[];try{let r=(0,k_.parse)(e);return Array.isArray(r?.capabilities)?r.capabilities:[]}catch{return[]}}function hH(t){let e={};if(t!==null)try{let n=(0,k_.parse)(t);n&&typeof n.inventory=="object"&&n.inventory!==null&&(e=n.inventory)}catch{}let r=n=>typeof e[n]=="number"?e[n]:0;return{capabilities:r("capabilities"),features:r("features"),scenarios:r("scenarios"),test_files:r("test_files")}}function Wge(t,e){let r=Nf(t,["log",`${e}..HEAD`,"--format=%h%x09%s","--","src/"]),n=[];for(let i of r.split(` +`)){if(i.trim().length===0)continue;let o=i.indexOf(" ");if(o<0)continue;let s=i.slice(0,o),a=i.slice(o+1);Zge.test(a)&&(Vge.test(a)||n.push({hash:s,subject:a}))}return n}var k_,Zge,Vge,dl=y(()=>{"use strict";k_=St(er(),1);_a();Zge=/^(feat|fix)(\([^)]*\))?!?:/,Vge=/\bF-(\d{3,}|[a-f0-9]{6,})\b/});import{execFileSync as yH}from"node:child_process";import{appendFileSync as Kge,existsSync as OO,mkdirSync as Jge,readFileSync as Yge,renameSync as Xge,statSync as Qge}from"node:fs";import{userInfo as eye}from"node:os";import{dirname as tye,join as IO}from"node:path";function PO(t){return IO(t,_H,rye)}function Qr(t,e){let r=PO(t),n=tye(r);OO(n)||Jge(n,{recursive:!0});try{OO(r)&&Qge(r).size>nye&&Xge(r,IO(n,bH))}catch{}Kge(r,`${JSON.stringify(e)} +`,"utf8")}function RO(t){if(!OO(t))return[];let e=Yge(t,"utf8").trim();return e.length===0?[]:e.split(` +`).filter(r=>r.length>0).map(r=>JSON.parse(r))}function ba(t){return RO(PO(t))}function E_(t){return[...RO(IO(t,_H,bH)),...RO(PO(t))]}function en(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function iye(t){let e;try{e=yH("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=eye().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function oye(t){try{return yH("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function jf(t,e){try{let r=ba(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function tr(t,e,r){try{let n=oye(t),i=iye(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=jf(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Qr(t,en(e,o))}catch{}}var _H,rye,bH,nye,Nr=y(()=>{"use strict";_H=".cladding",rye="events.log.jsonl",bH="events.log.1.jsonl",nye=5*1024*1024});import{execFileSync as sye}from"node:child_process";import{existsSync as vH,readdirSync as aye,readFileSync as cye,statSync as SH}from"node:fs";import{createHash as lye}from"node:crypto";import{join as CO}from"node:path";function va(t){try{return sye("git",["rev-parse","HEAD"],{cwd:t,stdio:["ignore","pipe","ignore"]}).toString("utf8").trim()||null}catch{return null}}function DO(t){let e=[],r=CO(t,"spec.yaml");vH(r)&&SH(r).isFile()&&e.push(r);for(let i of["features","scenarios"]){let o=CO(t,"spec",i);if(!(!vH(o)||!SH(o).isDirectory()))for(let s of aye(o))s.endsWith(".yaml")&&e.push(CO(o,s))}e.sort();let n=lye("sha256");for(let i of e){let o=i.slice(t.length+1);n.update(`${o}\0`),n.update(cye(i)),n.update("\0")}return n.digest("hex")}function A_(t,e){let r={featureId:e,gitHead:va(t),specDigest:DO(t),timestamp:new Date().toISOString()};return Qr(t,en("feature_checkpoint",{feature:e,git_head:r.gitHead,spec_digest:r.specDigest})),r}function T_(t,e){let r=ba(t);for(let n=r.length-1;n>=0;n--){let i=r[n];if(i.type==="feature_checkpoint"&&i.payload.feature===e)return{featureId:e,gitHead:i.payload.git_head??null,specDigest:String(i.payload.spec_digest??""),timestamp:i.timestamp}}return null}function O_(t,e,r,n){let i=en("feature_rolled_back",{feature:e,to_git_head:r.gitHead,to_spec_digest:r.specDigest,to_checkpoint_at:r.timestamp,reason:n??null});return Qr(t,i),i}var Mf=y(()=>{"use strict";Nr()});import{readFileSync as uye,statSync as dye}from"node:fs";import{extname as fye,resolve as NO,sep as pye}from"node:path";function tn(t){return Math.ceil(t.length/4)}function gye(t,e){let r=NO(e),n=NO(r,t);return n===r||n.startsWith(r+pye)}function xH(t,e,r,n){if(!gye(t,e))return{path:t,omitted:"unsafe-path"};if(!mye.has(fye(t).toLowerCase()))return{path:t,omitted:"unsupported"};let i,o;if(n){let l=n(t);if(l==null)return{path:t,omitted:"missing"};if(i=l,o=Buffer.byteLength(l,"utf8"),o>wH)return{path:t,omitted:"too-large",bytes:o}}else{let l=NO(e,t);try{o=dye(l).size}catch{return{path:t,omitted:"missing"}}if(o>wH)return{path:t,omitted:"too-large",bytes:o};try{i=uye(l,"utf8")}catch{return{path:t,omitted:"missing",bytes:o}}}if(i.includes(hye))return{path:t,omitted:"binary",bytes:o};let s=Math.max(0,Math.floor(r));if(i.length<=s)return{path:t,text:i,bytes:o};let a=` /* ... clipped (${o} bytes total) ... */ -`,c=Math.max(0,s-a.length);return{path:t,text:i.slice(0,c)+a,truncated:!0,bytes:o}}var pye,SH,mye,O_=y(()=>{"use strict";pye=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".rs",".go",".java",".kt",".kts",".cs",".rb",".php",".swift",".c",".h",".cpp",".hpp",".css",".scss",".sql",".sh",".yaml",".yml",".json",".md",".toml"]),SH=2e6,mye="\0"});function yye(t){for(let i of gye)if(t.startsWith(i))return null;let e=t.indexOf("#"),n=(e>=0?t.slice(0,e):t).trim();return n.length>0?n:null}function NO(t,e,r){let n=t.get(e);n||(n=new Set,t.set(e,n)),n.add(r)}function _ye(t){let e=new Map,r=new Map,n=new Map;for(let i of t.features??[]){let o=i.id;for(let s of i.depends_on??[])NO(e,s,o);for(let s of i.modules??[])NO(r,s,o);for(let s of i.acceptance_criteria??[])for(let a of s.test_refs??[]){let c=yye(a);c&&NO(n,c,o)}}return{dependents:e,moduleOwners:r,testRefCitations:n}}function An(t){let e=xH.get(t);return e||(e=_ye(t),xH.set(t,e)),e}var gye,xH,Sa=y(()=>{"use strict";gye=["derived:","fixture:","script:","self-dogfood:"];xH=new WeakMap});function jO(t,e,r=1/0){let n=new Set,i=new Set(t),o=[...i],s=0;for(;o.length>0&&sn.id===e)??r.find(n=>n.slug===e)??null}function vr(t,e,r={}){let n=r.depth??1/0,i=An(t),o=new Map((t.features??[]).map(_=>[_.id,_])),s=[],a,c=bye(t,e);if(c)s=[c];else{let _=i.moduleOwners.get(e);_&&_.size>0&&(a=e,s=[..._].map(S=>o.get(S)).filter(S=>!!S))}if(s.length===0)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/spec/load.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (run clad sync if missing); module paths live in each shard\u2019s modules:; if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let l=s.map(_=>_.id),u=jO(l,i.dependents,n),d=[...u].map(_=>o.get(_)).filter(_=>!!_).map(_=>({id:_.id,title:_.title,status:_.status})).sort((_,S)=>_.id.localeCompare(S.id)),f=new Set([...l,...u]),p=[...f].map(_=>o.get(_)).filter(_=>!!_),m=[...new Set(p.flatMap(_=>_.modules??[]))].sort(),h=(t.scenarios??[]).filter(_=>(_.features??[]).some(S=>f.has(S))).map(_=>({id:_.id,title:_.title})).sort((_,S)=>_.id.localeCompare(S.id)),g=[...new Set(p.flatMap(_=>(_.acceptance_criteria??[]).flatMap(S=>S.test_refs??[])))].sort();return{focus:a?{module:a,owners:[...l].sort()}:{id:s[0].id,title:s[0].title,status:s[0].status},impacted:d,impacted_modules:m,scenarios:h,test_refs:g,ledger:MO(i)}}var wa=y(()=>{"use strict";Sa()});function $H(t){return t.impacted.length}function I_(t,e,r={}){let n=r.initialDepth??R_.initialDepth,i=r.maxDepth??R_.maxDepth,o=r.coverageThreshold??R_.coverageThreshold,s=r.marginYieldThreshold??R_.marginYieldThreshold,a=An(t),c=new Map((t.features??[]).map(b=>[b.id,b])),l=[],u=(t.features??[]).find(b=>b.id===e||b.slug===e);if(u)l=[u.id];else{let b=a.moduleOwners.get(e);b&&b.size>0&&(l=[...b].filter(_=>c.has(_)))}if(l.length===0){let b=vr(t,e,{depth:1});return"not_found"in b,b}let d=jO(l,a.dependents,1/0).size;if(d===0){let b=vr(t,e,{depth:n});return"not_found"in b?b:{slice:b,depthUsed:n,stoppedBy:"no-known-dependents",analysis:{frontierExhausted:!0,coverage:null,marginalYields:[0],totalKnownDependents:0}}}let f=[],p=0,m=null;for(let b=n;b<=i;b++){let _=vr(t,e,{depth:b});if("not_found"in _)return _;m=_;let S=$H(_),x=S-p,w=S>0?x/S:0;f.push(w);let O=d>0?S/d:1,T=x===0&&b>n,A={frontierExhausted:T,coverage:O,marginalYields:[...f],totalKnownDependents:d};if(T)return{slice:_,depthUsed:b,stoppedBy:"exhaustion",analysis:A};if(O>=o)return{slice:_,depthUsed:b,stoppedBy:"coverage",analysis:A};if(f.length>=2&&f[f.length-1]0?g/d:1,marginalYields:[...f],totalKnownDependents:d}}}var R_,FO=y(()=>{"use strict";wa();Sa();R_={initialDepth:1,maxDepth:10,coverageThreshold:.9,marginYieldThreshold:.05}});function vye(t,e){let r=new Set,n=[t];for(;n.length>0;){let i=n.pop();if(!i||r.has(i))continue;r.add(i);let o=e.get(i);for(let s of o?.depends_on??[])n.push(s)}return r}function kH(t,e){let r=new Map(t.features.map(a=>[a.id,a]));if(!r.has(e))return t;let n=vye(e,r),i=t.features.filter(a=>n.has(a.id)),o=(t.scenarios??[]).filter(a=>(a.features??[]).some(c=>n.has(c)));return{...t,features:i,scenarios:o}}var EH=y(()=>{"use strict"});function Sye(t,e){let r=t.features??[];return r.find(n=>n.id===e)??r.find(n=>n.slug===e)??r.find(n=>(n.modules??[]).includes(e))??null}function fl(t,e){let r=Sye(t,e);if(!r)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/auth/login.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (id, slug, status; run clad sync if missing); if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let n=kH(t,r.id),i=(n.features??[]).filter(c=>c.id!==r.id).map(c=>({id:c.id,title:c.title,status:c.status})).sort((c,l)=>c.id.localeCompare(l.id)),o=(n.scenarios??[]).map(c=>({id:c.id,title:c.title})).sort((c,l)=>c.id.localeCompare(l.id)),s=(t.project?.ai_hints?.preferred_patterns??[]).map(c=>({when:c.when,prefer:c.prefer,...c.over!==void 0?{over:c.over}:{}})),a=[...new Set((r.acceptance_criteria??[]).flatMap(c=>c.test_refs??[]))].sort();return{focus:r,ancestors:i,scenarios:o,preferred_patterns:s,test_refs:a}}var P_=y(()=>{"use strict";EH()});import{existsSync as TH,readdirSync as wye,readFileSync as xye}from"node:fs";import{join as zO}from"node:path";function UO(t,e=kye){let r=t.trim().replace(/\s+/g," ");return r.length<=e?r:`${r.slice(0,e-1)}\u2026`}function Eye(t){let e=t.payload??{};if(t.type==="drift_detected"){let n=typeof e.gate=="string"&&e.gate?e.gate:"drift";return{detector:n,message:UO(`drift detected at gate ${n}`)}}let r=typeof e.worst=="number"?` (worst ${e.worst})`:"";return{detector:"done_attempted",message:UO(`done reverted \u2014 pre-push strict gate red${r}`)}}function AH(t){let e=Date.parse(t.timestamp);return Number.isFinite(e)?e:0}function Aye(t){let e=[];t.lastFailedGate&&e.push(`failed ${t.lastFailedGate}`),typeof t.retryCount=="number"&&e.push(`${t.retryCount} retries`);let r=e.length?` (${e.join(", ")})`:"",n=t.recovery?`recover: ${t.recovery}${r}`:`rolled back${r}`;return UO(n)}function Tye(t,e,r,n={}){let i=t.filter(m=>m&&m.payload&&m.payload.feature===r),o=e.filter(m=>m&&m.featureId===r).slice().sort((m,h)=>AH(m)-AH(h)),s=i.filter(m=>m.type==="drift_detected"||m.type==="done_attempted"&&m.payload.kept===!1),a=i.filter(m=>m.type==="feature_rolled_back");if(s.length===0&&a.length===0&&o.length===0)return;let c=o.length?o[o.length-1]:void 0,l;for(let m=s.length-1;m>=0;m--){let h=s[m].payload.gate;if(s[m].type==="drift_detected"&&typeof h=="string"&&h){l=h;break}}!l&&c?.lastFailedGate&&(l=c.lastFailedGate);let u=s.slice(-$ye).map(Eye),d;for(let m=a.length-1;m>=0;m--){let h=a[m].payload.to_git_head;if(typeof h=="string"&&h){d=h;break}}let f=typeof c?.retryCount=="number"?c.retryCount:void 0,p=c?Aye(c):void 0;return{attempts:s.length,...l?{last_failed_gate:l}:{},...f!==void 0?{retry_count:f}:{},...u.length?{drift_history:u}:{},...d?{rolled_back_at:d}:{},...p?{recovery_hint:p}:{},...n.truncated?{truncated_history:!0}:{}}}function LO(t,e){let r=t.match(e);return r&&r[1]?r[1].trim():void 0}function Oye(t){let e=t.indexOf("## Recommended recovery");if(e<0)return;let r=t.slice(e).match(/```[^\n]*\n([\s\S]*?)```/);return r&&r[1].split(` -`).map(i=>i.trim()).find(i=>i.length>0)||void 0}function Rye(t,e,r){let n=LO(t,/_Rolled back at_\s*`([^`]+)`/),i=LO(t,/Last failed gate:\s*`([^`]+)`/),o=LO(t,/Retry attempts:\s*(\d+)/),s=Oye(t);return{featureId:e,timestamp:n??r,...i?{lastFailedGate:i}:{},...o?{retryCount:Number(o)}:{},...s?{recovery:s}:{}}}function Iye(t,e){let r=zO(t,".cladding","post-mortems");if(!TH(r))return[];let n=`post-mortem-${e}-`,i=[];for(let o of wye(r))if(!(!o.startsWith(n)||!o.endsWith(".md")))try{i.push(Rye(xye(zO(r,o),"utf8"),e,o))}catch{}return i}function OH(t,e){try{let r=k_(t),n=Iye(t,e),i=TH(zO(t,".cladding","events.log.1.jsonl"));return Tye(r,n,e,{truncated:i})}catch{return}}var $ye,kye,RH=y(()=>{"use strict";Nr();$ye=5,kye=120});function C_(t,e,r){return tn(JSON.stringify({...t,needs:e,must_edit:{...t.must_edit,code:r}}))}function xa(t,e,r={}){let n=r.cwd??".",i=r.maxTokens&&r.maxTokens>0?r.maxTokens:Pye,o=e,s,a=An(t).moduleOwners.get(e);if(a&&a.size>0){let se=[...a].sort();o=se[0],se.length>1&&(s=se)}let c=fl(t,o);if("not_found"in c)return c;let l=c.focus,u=OH(n,l.id),d=a&&a.size>0?e:l.id,f=I_(t,d),p="not_found"in f?null:f.slice,m=p?p.impacted:[],h=p?p.test_refs:[],g="not_found"in f?null:{depth:f.depthUsed,stopped_by:f.stoppedBy,coverage:f.analysis.coverage===null?null:Math.round(f.analysis.coverage*100)/100,total_known_dependents:f.analysis.totalKnownDependents},b=l.acceptance_criteria??[],_=b.filter(se=>se.ears==="unwanted"||se.ears==="state").map(se=>({id:se.id,ears:String(se.ears)})),S=[...new Set(b.flatMap(se=>se.oracle_refs??[]))].sort(),x=[],w={must_edit:{id:l.id,title:l.title,status:l.status,modules:l.modules??[],acceptance_criteria:b,code:[],...s?{co_owners:s}:{}},needs:c.ancestors,breaks_if_changed:{impacted:m,regression_tests:h,...g?{radius:g}:{}},verify:{scenarios:c.scenarios,test_refs:c.test_refs,oracle_refs:S,high_risk_acs:_},guidance:{preferred_patterns:c.preferred_patterns},budget:{max_tokens:i,used_tokens:0,truncated:x}},O=[...c.ancestors];for(;O.length>Cye&&C_(w,O,[])>i;)O.pop();O.lengthi){x.push(`code: omitted ${se} (budget)`);continue}A.push(Kt),Kt.truncated&&x.push(`code: clipped ${se}`)}T>i&&x.push("must-edit exceeds budget \u2014 retained in full (focus is never dropped)");let D=(se,Ce)=>({impacted:se,regression_tests:Ce,...g?{radius:g}:{},...p?.ledger?{ledger:p.ledger}:{}}),$=(se,Ce,Kt,dr)=>{let Xt=Kt+dr>0?[`breaks: omitted ${Kt} feature(s) / ${dr} test(s)`]:[],lo={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:D(se,Ce),budget:{...w.budget,truncated:[...x,...Xt]}};return tn(JSON.stringify(lo))>i},ie=m,K=h;if($(ie,K,0,0)){let se=vr(t,d,{depth:1}),Ce=new Set("not_found"in se?[]:se.impacted.map(de=>de.id)),Kt=new Set("not_found"in se?[]:se.test_refs),Xt=[...m.filter(de=>Ce.has(de.id)),...m.filter(de=>!Ce.has(de.id))],lo=0;for(;Xt.length>Ce.size&&$(Xt,K,lo,0);)Xt=Xt.slice(0,-1),lo++;let $i=[...h],Xr=0;for(;$(Xt,$i,lo,Xr);){let de=-1;for(let uo=$i.length-1;uo>=0;uo--)if(!Kt.has($i[uo])){de=uo;break}if(de<0)break;$i.splice(de,1),Xr++}ie=Xt,K=$i,lo+Xr>0&&x.push(`breaks: omitted ${lo} feature(s) / ${Xr} test(s)`),$(ie,K,0,0)&&x.push("breaks: direct set retained in full \u2014 exceeds budget")}let xe=D(ie,K),C={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:xe},P=C;if(u){let se={...C,prior_attempts:u};tn(JSON.stringify(se))<=i?P=se:x.push("prior_attempts: omitted (budget)")}let Ir=tn(JSON.stringify(P));return{...P,budget:{max_tokens:i,used_tokens:Ir,truncated:x}}}var Pye,Cye,D_=y(()=>{"use strict";O_();P_();FO();RH();wa();Sa();Pye=3e3,Cye=3});function Yn(t){if(t.length===0)return 0;let e=[...t].sort((n,i)=>n-i),r=Math.floor(e.length/2);return e.length%2?e[r]:(e[r-1]+e[r])/2}function Dye(t,e){if(t.length===0)return 0;let r=[...t].sort((n,i)=>n-i);return r[Math.min(r.length-1,Math.floor(e/100*r.length))]}function IH(t,e,r="."){let n=An(t),i=t.features??[],o=[];for(let f of i){let p=xa(t,f.id,{cwd:r,read:e});if("not_found"in p)continue;let m=xa(t,f.id,{cwd:r,read:e,maxTokens:Number.MAX_SAFE_INTEGER}),h=I_(t,f.id),g=!("not_found"in h),b=tn(JSON.stringify(p)),_="not_found"in m?b:tn(JSON.stringify(m)),S=tn(JSON.stringify(f));for(let O of f.modules??[]){let T=e(O);T&&(S+=tn(T))}let x=(f.depends_on??[]).length,w=n.dependents.get(f.id)?.size??0;o.push({id:f.id,sliceTokens:b,structuralTokens:_,naiveTokens:S,contextRatio:S>0?b/S:1,budgetSaturated:p.budget.truncated.length>0,searchDepth:g?h.depthUsed:1,edgesResolved:x+w,stoppedBy:g?h.stoppedBy:"n/a",coverage:g?h.analysis.coverage:1,regressionTests:p.breaks_if_changed.regression_tests.length})}o.sort((f,p)=>f.id.localeCompare(p.id));let s=o.map(f=>f.contextRatio),a=f=>f.filter(p=>p.sliceTokens>0).map(p=>p.naiveTokens/p.sliceTokens),c=o.filter(f=>!f.budgetSaturated),l=o.filter(f=>f.budgetSaturated),u=o.filter(f=>f.naiveTokens>0).map(f=>f.structuralTokens/f.naiveTokens),d={};for(let f of o)d[f.stoppedBy]=(d[f.stoppedBy]??0)+1;return{featureCount:i.length,measured:o.length,context:{medianContextRatio:Math.round(Yn(s)*1e3)/1e3,medianShrinkFactor:Math.round(Yn(a(o))*10)/10,fitsCount:c.length,truncatedCount:l.length,medianShrinkFit:Math.round(Yn(a(c))*10)/10,medianShrinkTruncated:Math.round(Yn(a(l))*10)/10,medianStructuralRatio:Math.round(Yn(u)*100)/100,medianSliceTokens:Math.round(Yn(o.map(f=>f.sliceTokens))),medianNaiveTokens:Math.round(Yn(o.map(f=>f.naiveTokens)))},search:{medianDepth:Yn(o.map(f=>f.searchDepth)),p95Depth:Dye(o.map(f=>f.searchDepth),95),medianEdges:Yn(o.map(f=>f.edgesResolved)),maxEdges:o.reduce((f,p)=>Math.max(f,p.edgesResolved),0)},stability:{byStopReason:d,medianCoverage:Math.round(Yn(o.map(f=>f.coverage).filter(f=>f!==null))*100)/100,medianRegressionTests:Yn(o.map(f=>f.regressionTests))},features:o}}var pl,N_=y(()=>{"use strict";O_();FO();D_();Sa();pl="(deterministic upper bound vs the shard+all-modules baseline \u2014 not an agent-adoption measurement)"});import{appendFileSync as Nye,existsSync as qO,mkdirSync as jye,readFileSync as PH}from"node:fs";import{dirname as Mye,join as Fye}from"node:path";function BO(t){return Fye(t,Lye,zye)}function Uye(t,e){return{timestamp:new Date().toISOString(),head:va(t),spec_digest:CO(t),featureCount:e.featureCount,measured:e.measured,context:e.context,search:e.search,stability:e.stability}}function CH(t,e){try{let r=Uye(t,e);if(r.head===null)return{appended:!1,reason:"no_head"};let n=HO(t),i=n[n.length-1];if(i&&i.head===r.head&&i.spec_digest===r.spec_digest)return{appended:!1,reason:"deduped"};let o=BO(t),s=Mye(o);return qO(s)||jye(s,{recursive:!0}),Nye(o,`${JSON.stringify(r)} -`,"utf8"),{appended:!0,reason:"appended"}}catch{return{appended:!1,reason:"error"}}}function DH(t){let e=[];for(let r of t.split(` -`)){let n=r.trim();if(n.length!==0)try{let i=JSON.parse(n);i&&typeof i=="object"&&i.context&&i.search&&i.stability&&e.push(i)}catch{}}return e}function HO(t,e){let r=BO(t);if(!qO(r))return[];let n;try{n=PH(r,"utf8")}catch{return[]}let i=DH(n);return typeof e=="number"&&e>=0?i.slice(-e):i}function NH(t){let e=BO(t);if(!qO(e))return{snapshots:[],unreadable:!1};let r;try{r=PH(e,"utf8")}catch{return{snapshots:[],unreadable:!0}}let n=DH(r),i=r.trim().length>0;return{snapshots:n,unreadable:i&&n.length===0}}function Ff(t,e=0){let r=e>0?Math.round(t*10**e)/10**e:Math.round(t),n=r.toFixed(e);return r>0?`+${n}`:n}function jH(t,e=5){let r=Math.max(0,t.length-e),i=[`measure trend \xB7 last ${t.slice(r).length} of ${t.length} snapshot(s)`];for(let o=r;o0?t[o-1]:null,c=(d,f=0)=>a?` (${Ff(d(s)-d(a),f)})`:"",l=s.timestamp.slice(0,19),u=s.head?s.head.slice(0,7):"nogit";i.push(` ${l} ${u} \xB7 ${s.featureCount} feat \xB7 slice ${s.context.medianSliceTokens}${c(d=>d.context.medianSliceTokens)} \xB7 struct ${s.context.medianStructuralRatio.toFixed(2)}${c(d=>d.context.medianStructuralRatio,2)} \xB7 cov ${s.stability.medianCoverage.toFixed(2)}${c(d=>d.stability.medianCoverage,2)} \xB7 p95depth ${s.search.p95Depth}${c(d=>d.search.p95Depth)} \xB7 trunc ${s.context.truncatedCount}${c(d=>d.context.truncatedCount)}`)}return i.push(` ${pl}`),i.join(` -`)}var Lye,zye,Lf=y(()=>{"use strict";Mf();N_();Lye=".cladding",zye="measure.jsonl"});import{existsSync as qye}from"node:fs";import{join as Bye}from"node:path";function ml(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${Hye[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` -`)}function FH(t){let e=t.snapshot,r=["## Measured (this release)",""];if(!e||!e.head)return r.push("not measured at this commit \u2014 run clad measure before tagging"),r.join(` +`,c=Math.max(0,s-a.length);return{path:t,text:i.slice(0,c)+a,truncated:!0,bytes:o}}var mye,wH,hye,R_=y(()=>{"use strict";mye=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".rs",".go",".java",".kt",".kts",".cs",".rb",".php",".swift",".c",".h",".cpp",".hpp",".css",".scss",".sql",".sh",".yaml",".yml",".json",".md",".toml"]),wH=2e6,hye="\0"});function _ye(t){for(let i of yye)if(t.startsWith(i))return null;let e=t.indexOf("#"),n=(e>=0?t.slice(0,e):t).trim();return n.length>0?n:null}function jO(t,e,r){let n=t.get(e);n||(n=new Set,t.set(e,n)),n.add(r)}function bye(t){let e=new Map,r=new Map,n=new Map;for(let i of t.features??[]){let o=i.id;for(let s of i.depends_on??[])jO(e,s,o);for(let s of i.modules??[])jO(r,s,o);for(let s of i.acceptance_criteria??[])for(let a of s.test_refs??[]){let c=_ye(a);c&&jO(n,c,o)}}return{dependents:e,moduleOwners:r,testRefCitations:n}}function An(t){let e=$H.get(t);return e||(e=bye(t),$H.set(t,e)),e}var yye,$H,Sa=y(()=>{"use strict";yye=["derived:","fixture:","script:","self-dogfood:"];$H=new WeakMap});function MO(t,e,r=1/0){let n=new Set,i=new Set(t),o=[...i],s=0;for(;o.length>0&&sn.id===e)??r.find(n=>n.slug===e)??null}function vr(t,e,r={}){let n=r.depth??1/0,i=An(t),o=new Map((t.features??[]).map(_=>[_.id,_])),s=[],a,c=vye(t,e);if(c)s=[c];else{let _=i.moduleOwners.get(e);_&&_.size>0&&(a=e,s=[..._].map(S=>o.get(S)).filter(S=>!!S))}if(s.length===0)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/spec/load.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (run clad sync if missing); module paths live in each shard\u2019s modules:; if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let l=s.map(_=>_.id),u=MO(l,i.dependents,n),d=[...u].map(_=>o.get(_)).filter(_=>!!_).map(_=>({id:_.id,title:_.title,status:_.status})).sort((_,S)=>_.id.localeCompare(S.id)),f=new Set([...l,...u]),p=[...f].map(_=>o.get(_)).filter(_=>!!_),m=[...new Set(p.flatMap(_=>_.modules??[]))].sort(),h=(t.scenarios??[]).filter(_=>(_.features??[]).some(S=>f.has(S))).map(_=>({id:_.id,title:_.title})).sort((_,S)=>_.id.localeCompare(S.id)),g=[...new Set(p.flatMap(_=>(_.acceptance_criteria??[]).flatMap(S=>S.test_refs??[])))].sort();return{focus:a?{module:a,owners:[...l].sort()}:{id:s[0].id,title:s[0].title,status:s[0].status},impacted:d,impacted_modules:m,scenarios:h,test_refs:g,ledger:FO(i)}}var wa=y(()=>{"use strict";Sa()});function kH(t){return t.impacted.length}function P_(t,e,r={}){let n=r.initialDepth??I_.initialDepth,i=r.maxDepth??I_.maxDepth,o=r.coverageThreshold??I_.coverageThreshold,s=r.marginYieldThreshold??I_.marginYieldThreshold,a=An(t),c=new Map((t.features??[]).map(b=>[b.id,b])),l=[],u=(t.features??[]).find(b=>b.id===e||b.slug===e);if(u)l=[u.id];else{let b=a.moduleOwners.get(e);b&&b.size>0&&(l=[...b].filter(_=>c.has(_)))}if(l.length===0){let b=vr(t,e,{depth:1});return"not_found"in b,b}let d=MO(l,a.dependents,1/0).size;if(d===0){let b=vr(t,e,{depth:n});return"not_found"in b?b:{slice:b,depthUsed:n,stoppedBy:"no-known-dependents",analysis:{frontierExhausted:!0,coverage:null,marginalYields:[0],totalKnownDependents:0}}}let f=[],p=0,m=null;for(let b=n;b<=i;b++){let _=vr(t,e,{depth:b});if("not_found"in _)return _;m=_;let S=kH(_),x=S-p,w=S>0?x/S:0;f.push(w);let O=d>0?S/d:1,T=x===0&&b>n,A={frontierExhausted:T,coverage:O,marginalYields:[...f],totalKnownDependents:d};if(T)return{slice:_,depthUsed:b,stoppedBy:"exhaustion",analysis:A};if(O>=o)return{slice:_,depthUsed:b,stoppedBy:"coverage",analysis:A};if(f.length>=2&&f[f.length-1]0?g/d:1,marginalYields:[...f],totalKnownDependents:d}}}var I_,LO=y(()=>{"use strict";wa();Sa();I_={initialDepth:1,maxDepth:10,coverageThreshold:.9,marginYieldThreshold:.05}});function Sye(t,e){let r=new Set,n=[t];for(;n.length>0;){let i=n.pop();if(!i||r.has(i))continue;r.add(i);let o=e.get(i);for(let s of o?.depends_on??[])n.push(s)}return r}function EH(t,e){let r=new Map(t.features.map(a=>[a.id,a]));if(!r.has(e))return t;let n=Sye(e,r),i=t.features.filter(a=>n.has(a.id)),o=(t.scenarios??[]).filter(a=>(a.features??[]).some(c=>n.has(c)));return{...t,features:i,scenarios:o}}var AH=y(()=>{"use strict"});function wye(t,e){let r=t.features??[];return r.find(n=>n.id===e)??r.find(n=>n.slug===e)??r.find(n=>(n.modules??[]).includes(e))??null}function fl(t,e){let r=wye(t,e);if(!r)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/auth/login.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (id, slug, status; run clad sync if missing); if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let n=EH(t,r.id),i=(n.features??[]).filter(c=>c.id!==r.id).map(c=>({id:c.id,title:c.title,status:c.status})).sort((c,l)=>c.id.localeCompare(l.id)),o=(n.scenarios??[]).map(c=>({id:c.id,title:c.title})).sort((c,l)=>c.id.localeCompare(l.id)),s=(t.project?.ai_hints?.preferred_patterns??[]).map(c=>({when:c.when,prefer:c.prefer,...c.over!==void 0?{over:c.over}:{}})),a=[...new Set((r.acceptance_criteria??[]).flatMap(c=>c.test_refs??[]))].sort();return{focus:r,ancestors:i,scenarios:o,preferred_patterns:s,test_refs:a}}var C_=y(()=>{"use strict";AH()});import{existsSync as OH,readdirSync as xye,readFileSync as $ye}from"node:fs";import{join as UO}from"node:path";function qO(t,e=Eye){let r=t.trim().replace(/\s+/g," ");return r.length<=e?r:`${r.slice(0,e-1)}\u2026`}function Aye(t){let e=t.payload??{};if(t.type==="drift_detected"){let n=typeof e.gate=="string"&&e.gate?e.gate:"drift";return{detector:n,message:qO(`drift detected at gate ${n}`)}}let r=typeof e.worst=="number"?` (worst ${e.worst})`:"";return{detector:"done_attempted",message:qO(`done reverted \u2014 pre-push strict gate red${r}`)}}function TH(t){let e=Date.parse(t.timestamp);return Number.isFinite(e)?e:0}function Tye(t){let e=[];t.lastFailedGate&&e.push(`failed ${t.lastFailedGate}`),typeof t.retryCount=="number"&&e.push(`${t.retryCount} retries`);let r=e.length?` (${e.join(", ")})`:"",n=t.recovery?`recover: ${t.recovery}${r}`:`rolled back${r}`;return qO(n)}function Oye(t,e,r,n={}){let i=t.filter(m=>m&&m.payload&&m.payload.feature===r),o=e.filter(m=>m&&m.featureId===r).slice().sort((m,h)=>TH(m)-TH(h)),s=i.filter(m=>m.type==="drift_detected"||m.type==="done_attempted"&&m.payload.kept===!1),a=i.filter(m=>m.type==="feature_rolled_back");if(s.length===0&&a.length===0&&o.length===0)return;let c=o.length?o[o.length-1]:void 0,l;for(let m=s.length-1;m>=0;m--){let h=s[m].payload.gate;if(s[m].type==="drift_detected"&&typeof h=="string"&&h){l=h;break}}!l&&c?.lastFailedGate&&(l=c.lastFailedGate);let u=s.slice(-kye).map(Aye),d;for(let m=a.length-1;m>=0;m--){let h=a[m].payload.to_git_head;if(typeof h=="string"&&h){d=h;break}}let f=typeof c?.retryCount=="number"?c.retryCount:void 0,p=c?Tye(c):void 0;return{attempts:s.length,...l?{last_failed_gate:l}:{},...f!==void 0?{retry_count:f}:{},...u.length?{drift_history:u}:{},...d?{rolled_back_at:d}:{},...p?{recovery_hint:p}:{},...n.truncated?{truncated_history:!0}:{}}}function zO(t,e){let r=t.match(e);return r&&r[1]?r[1].trim():void 0}function Rye(t){let e=t.indexOf("## Recommended recovery");if(e<0)return;let r=t.slice(e).match(/```[^\n]*\n([\s\S]*?)```/);return r&&r[1].split(` +`).map(i=>i.trim()).find(i=>i.length>0)||void 0}function Iye(t,e,r){let n=zO(t,/_Rolled back at_\s*`([^`]+)`/),i=zO(t,/Last failed gate:\s*`([^`]+)`/),o=zO(t,/Retry attempts:\s*(\d+)/),s=Rye(t);return{featureId:e,timestamp:n??r,...i?{lastFailedGate:i}:{},...o?{retryCount:Number(o)}:{},...s?{recovery:s}:{}}}function Pye(t,e){let r=UO(t,".cladding","post-mortems");if(!OH(r))return[];let n=`post-mortem-${e}-`,i=[];for(let o of xye(r))if(!(!o.startsWith(n)||!o.endsWith(".md")))try{i.push(Iye($ye(UO(r,o),"utf8"),e,o))}catch{}return i}function RH(t,e){try{let r=E_(t),n=Pye(t,e),i=OH(UO(t,".cladding","events.log.1.jsonl"));return Oye(r,n,e,{truncated:i})}catch{return}}var kye,Eye,IH=y(()=>{"use strict";Nr();kye=5,Eye=120});function D_(t,e,r){return tn(JSON.stringify({...t,needs:e,must_edit:{...t.must_edit,code:r}}))}function xa(t,e,r={}){let n=r.cwd??".",i=r.maxTokens&&r.maxTokens>0?r.maxTokens:Cye,o=e,s,a=An(t).moduleOwners.get(e);if(a&&a.size>0){let se=[...a].sort();o=se[0],se.length>1&&(s=se)}let c=fl(t,o);if("not_found"in c)return c;let l=c.focus,u=RH(n,l.id),d=a&&a.size>0?e:l.id,f=P_(t,d),p="not_found"in f?null:f.slice,m=p?p.impacted:[],h=p?p.test_refs:[],g="not_found"in f?null:{depth:f.depthUsed,stopped_by:f.stoppedBy,coverage:f.analysis.coverage===null?null:Math.round(f.analysis.coverage*100)/100,total_known_dependents:f.analysis.totalKnownDependents},b=l.acceptance_criteria??[],_=b.filter(se=>se.ears==="unwanted"||se.ears==="state").map(se=>({id:se.id,ears:String(se.ears)})),S=[...new Set(b.flatMap(se=>se.oracle_refs??[]))].sort(),x=[],w={must_edit:{id:l.id,title:l.title,status:l.status,modules:l.modules??[],acceptance_criteria:b,code:[],...s?{co_owners:s}:{}},needs:c.ancestors,breaks_if_changed:{impacted:m,regression_tests:h,...g?{radius:g}:{}},verify:{scenarios:c.scenarios,test_refs:c.test_refs,oracle_refs:S,high_risk_acs:_},guidance:{preferred_patterns:c.preferred_patterns},budget:{max_tokens:i,used_tokens:0,truncated:x}},O=[...c.ancestors];for(;O.length>Dye&&D_(w,O,[])>i;)O.pop();O.lengthi){x.push(`code: omitted ${se} (budget)`);continue}A.push(Kt),Kt.truncated&&x.push(`code: clipped ${se}`)}T>i&&x.push("must-edit exceeds budget \u2014 retained in full (focus is never dropped)");let D=(se,Ce)=>({impacted:se,regression_tests:Ce,...g?{radius:g}:{},...p?.ledger?{ledger:p.ledger}:{}}),$=(se,Ce,Kt,dr)=>{let Xt=Kt+dr>0?[`breaks: omitted ${Kt} feature(s) / ${dr} test(s)`]:[],lo={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:D(se,Ce),budget:{...w.budget,truncated:[...x,...Xt]}};return tn(JSON.stringify(lo))>i},ie=m,K=h;if($(ie,K,0,0)){let se=vr(t,d,{depth:1}),Ce=new Set("not_found"in se?[]:se.impacted.map(de=>de.id)),Kt=new Set("not_found"in se?[]:se.test_refs),Xt=[...m.filter(de=>Ce.has(de.id)),...m.filter(de=>!Ce.has(de.id))],lo=0;for(;Xt.length>Ce.size&&$(Xt,K,lo,0);)Xt=Xt.slice(0,-1),lo++;let $i=[...h],Xr=0;for(;$(Xt,$i,lo,Xr);){let de=-1;for(let uo=$i.length-1;uo>=0;uo--)if(!Kt.has($i[uo])){de=uo;break}if(de<0)break;$i.splice(de,1),Xr++}ie=Xt,K=$i,lo+Xr>0&&x.push(`breaks: omitted ${lo} feature(s) / ${Xr} test(s)`),$(ie,K,0,0)&&x.push("breaks: direct set retained in full \u2014 exceeds budget")}let xe=D(ie,K),C={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:xe},P=C;if(u){let se={...C,prior_attempts:u};tn(JSON.stringify(se))<=i?P=se:x.push("prior_attempts: omitted (budget)")}let Ir=tn(JSON.stringify(P));return{...P,budget:{max_tokens:i,used_tokens:Ir,truncated:x}}}var Cye,Dye,N_=y(()=>{"use strict";R_();C_();LO();IH();wa();Sa();Cye=3e3,Dye=3});function Yn(t){if(t.length===0)return 0;let e=[...t].sort((n,i)=>n-i),r=Math.floor(e.length/2);return e.length%2?e[r]:(e[r-1]+e[r])/2}function Nye(t,e){if(t.length===0)return 0;let r=[...t].sort((n,i)=>n-i);return r[Math.min(r.length-1,Math.floor(e/100*r.length))]}function PH(t,e,r="."){let n=An(t),i=t.features??[],o=[];for(let f of i){let p=xa(t,f.id,{cwd:r,read:e});if("not_found"in p)continue;let m=xa(t,f.id,{cwd:r,read:e,maxTokens:Number.MAX_SAFE_INTEGER}),h=P_(t,f.id),g=!("not_found"in h),b=tn(JSON.stringify(p)),_="not_found"in m?b:tn(JSON.stringify(m)),S=tn(JSON.stringify(f));for(let O of f.modules??[]){let T=e(O);T&&(S+=tn(T))}let x=(f.depends_on??[]).length,w=n.dependents.get(f.id)?.size??0;o.push({id:f.id,sliceTokens:b,structuralTokens:_,naiveTokens:S,contextRatio:S>0?b/S:1,budgetSaturated:p.budget.truncated.length>0,searchDepth:g?h.depthUsed:1,edgesResolved:x+w,stoppedBy:g?h.stoppedBy:"n/a",coverage:g?h.analysis.coverage:1,regressionTests:p.breaks_if_changed.regression_tests.length})}o.sort((f,p)=>f.id.localeCompare(p.id));let s=o.map(f=>f.contextRatio),a=f=>f.filter(p=>p.sliceTokens>0).map(p=>p.naiveTokens/p.sliceTokens),c=o.filter(f=>!f.budgetSaturated),l=o.filter(f=>f.budgetSaturated),u=o.filter(f=>f.naiveTokens>0).map(f=>f.structuralTokens/f.naiveTokens),d={};for(let f of o)d[f.stoppedBy]=(d[f.stoppedBy]??0)+1;return{featureCount:i.length,measured:o.length,context:{medianContextRatio:Math.round(Yn(s)*1e3)/1e3,medianShrinkFactor:Math.round(Yn(a(o))*10)/10,fitsCount:c.length,truncatedCount:l.length,medianShrinkFit:Math.round(Yn(a(c))*10)/10,medianShrinkTruncated:Math.round(Yn(a(l))*10)/10,medianStructuralRatio:Math.round(Yn(u)*100)/100,medianSliceTokens:Math.round(Yn(o.map(f=>f.sliceTokens))),medianNaiveTokens:Math.round(Yn(o.map(f=>f.naiveTokens)))},search:{medianDepth:Yn(o.map(f=>f.searchDepth)),p95Depth:Nye(o.map(f=>f.searchDepth),95),medianEdges:Yn(o.map(f=>f.edgesResolved)),maxEdges:o.reduce((f,p)=>Math.max(f,p.edgesResolved),0)},stability:{byStopReason:d,medianCoverage:Math.round(Yn(o.map(f=>f.coverage).filter(f=>f!==null))*100)/100,medianRegressionTests:Yn(o.map(f=>f.regressionTests))},features:o}}var pl,j_=y(()=>{"use strict";R_();LO();N_();Sa();pl="(deterministic upper bound vs the shard+all-modules baseline \u2014 not an agent-adoption measurement)"});import{appendFileSync as jye,existsSync as BO,mkdirSync as Mye,readFileSync as CH}from"node:fs";import{dirname as Fye,join as Lye}from"node:path";function HO(t){return Lye(t,zye,Uye)}function qye(t,e){return{timestamp:new Date().toISOString(),head:va(t),spec_digest:DO(t),featureCount:e.featureCount,measured:e.measured,context:e.context,search:e.search,stability:e.stability}}function DH(t,e){try{let r=qye(t,e);if(r.head===null)return{appended:!1,reason:"no_head"};let n=GO(t),i=n[n.length-1];if(i&&i.head===r.head&&i.spec_digest===r.spec_digest)return{appended:!1,reason:"deduped"};let o=HO(t),s=Fye(o);return BO(s)||Mye(s,{recursive:!0}),jye(o,`${JSON.stringify(r)} +`,"utf8"),{appended:!0,reason:"appended"}}catch{return{appended:!1,reason:"error"}}}function NH(t){let e=[];for(let r of t.split(` +`)){let n=r.trim();if(n.length!==0)try{let i=JSON.parse(n);i&&typeof i=="object"&&i.context&&i.search&&i.stability&&e.push(i)}catch{}}return e}function GO(t,e){let r=HO(t);if(!BO(r))return[];let n;try{n=CH(r,"utf8")}catch{return[]}let i=NH(n);return typeof e=="number"&&e>=0?i.slice(-e):i}function jH(t){let e=HO(t);if(!BO(e))return{snapshots:[],unreadable:!1};let r;try{r=CH(e,"utf8")}catch{return{snapshots:[],unreadable:!0}}let n=NH(r),i=r.trim().length>0;return{snapshots:n,unreadable:i&&n.length===0}}function Ff(t,e=0){let r=e>0?Math.round(t*10**e)/10**e:Math.round(t),n=r.toFixed(e);return r>0?`+${n}`:n}function MH(t,e=5){let r=Math.max(0,t.length-e),i=[`measure trend \xB7 last ${t.slice(r).length} of ${t.length} snapshot(s)`];for(let o=r;o0?t[o-1]:null,c=(d,f=0)=>a?` (${Ff(d(s)-d(a),f)})`:"",l=s.timestamp.slice(0,19),u=s.head?s.head.slice(0,7):"nogit";i.push(` ${l} ${u} \xB7 ${s.featureCount} feat \xB7 slice ${s.context.medianSliceTokens}${c(d=>d.context.medianSliceTokens)} \xB7 struct ${s.context.medianStructuralRatio.toFixed(2)}${c(d=>d.context.medianStructuralRatio,2)} \xB7 cov ${s.stability.medianCoverage.toFixed(2)}${c(d=>d.stability.medianCoverage,2)} \xB7 p95depth ${s.search.p95Depth}${c(d=>d.search.p95Depth)} \xB7 trunc ${s.context.truncatedCount}${c(d=>d.context.truncatedCount)}`)}return i.push(` ${pl}`),i.join(` +`)}var zye,Uye,Lf=y(()=>{"use strict";Mf();j_();zye=".cladding",Uye="measure.jsonl"});import{existsSync as Bye}from"node:fs";import{join as Hye}from"node:path";function ml(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${Gye[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` +`)}function LH(t){let e=t.snapshot,r=["## Measured (this release)",""];if(!e||!e.head)return r.push("not measured at this commit \u2014 run clad measure before tagging"),r.join(` `);let n=e.context,i=e.stability;r.push(`- features measured: ${e.measured} of ${e.featureCount}`),r.push(`- median slice tokens: ${n.medianSliceTokens} vs ${n.medianNaiveTokens} naive`),r.push(`- median structural ratio: ${n.medianStructuralRatio.toFixed(2)}`),r.push(`- median coverage: ${i.medianCoverage.toFixed(2)}`),r.push(`- regression tests surfaced: ${i.medianRegressionTests}`);let o=t.sinceSnapshot;if(o){let s=t.sinceRef??(o.head?o.head.slice(0,7):"previous");r.push(`- since ${s}: slice ${Ff(n.medianSliceTokens-o.context.medianSliceTokens)} \xB7 struct ${Ff(n.medianStructuralRatio-o.context.medianStructuralRatio,2)} \xB7 cov ${Ff(i.medianCoverage-o.stability.medianCoverage,2)}`)}return r.push("",`head ${e.head.slice(0,7)} \xB7 spec_digest ${e.spec_digest}`,`reproduce: git checkout ${e.head} && clad measure`,"",pl),r.join(` -`)}function hl(t,e,r){let n=[`# Audit \u2014 shipped changes since ${t.since}`,"","| feature | AC | EARS | verification refs |","|---|---|---|---|"],i=new Map(e.features.map(o=>[o.id,o]));for(let o of t.groups)for(let s of o.features){let a=i.get(s.id);if(!a){n.push(`| ${s.id} | \u2014 | \u2014 | (removed from spec \u2014 see git history at ${t.since}) |`);continue}let c=a.acceptance_criteria??[];if(c.length===0){n.push(`| ${a.id} | \u2014 | \u2014 | (no acceptance criteria) |`);continue}for(let l of c)n.push(`| ${a.id} | ${l.id} | ${l.ears??"\u2014"} | ${Zye(l,r)} |`)}return n.join(` -`)}function Zye(t,e){let r=[...t.test_refs??[],...t.oracle_refs??[],...t.evidence_refs??[]];return r.length===0?"(none)":r.map(n=>{for(let[o,s]of Gye)if(n.startsWith(o))return`${n} (${s})`;let i=n.split("#",1)[0]??n;return`${qye(Bye(e,i))?"\u2713":"\u2717"} ${n}`}).join("
")}function gl(t){let e=[`# ${t.project.name} \u2014 capability catalog`,""],r=[...t.capabilities??[]].filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=new Map(t.features.map(s=>[s.id,s])),i=new Set;for(let s of r){e.push(`## ${s.title??s.id}`,""),s.summary&&e.push(s.summary,"");for(let a of s.features??[]){let c=n.get(a);!c||c.status==="archived"||(i.add(a),MH(e,c))}}let o=t.features.filter(s=>!i.has(s.id)&&s.status!=="archived").sort((s,a)=>s.id.localeCompare(a.id));if(o.length>0){e.push("## Uncategorized","");for(let s of o)MH(e,s)}for(;e[e.length-1]==="";)e.pop();return e.join(` -`)}function MH(t,e){t.push(`### ${e.title}`,"");for(let r of e.acceptance_criteria??[]){let n=AO(r);n&&t.push(`- ${n}`)}t.push("")}var Hye,Gye,j_=y(()=>{"use strict";Lf();N_();dl();Hye={"added-as-done":"new","flipped-to-done":"completed","modified-while-done":"updated",archived:"retired"};Gye=[["derived:","machine-suggested \u2014 not author-confirmed"],["self-dogfood:","verified by cladding running on itself"],["fixture:","conformance fixture"],["script:","npm script"]]});import{readFileSync as Vye}from"node:fs";function Oi(t="./spec.yaml"){let e=Vye(t,"utf8");return(0,LH.parse)(e)}var LH,M_=y(()=>{"use strict";LH=St(er(),1)});var is=v((jr,WO)=>{"use strict";var GO=jr.ValidationError=function(e,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+UH(l)},"instance")):i!==void 0&&(this.property=i),e&&(this.message=e),n){var a=n.$id||n.id;this.schema=a||n}r!==void 0&&(this.instance=r),this.name=o,this.argument=s,this.stack=this.toString()};GO.prototype.toString=function(){return this.property+" "+this.message};var F_=jr.ValidatorResult=function(e,r,n,i){this.instance=e,this.schema=r,this.options=n,this.path=i.path,this.propertyPath=i.propertyPath,this.errors=[],this.throwError=n&&n.throwError,this.throwFirst=n&&n.throwFirst,this.throwAll=n&&n.throwAll,this.disableFormat=n&&n.disableFormat===!0};F_.prototype.addError=function(e){var r;if(typeof e=="string")r=new GO(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");r=new GO(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new $a(this);if(this.throwError)throw r;return r};F_.prototype.importErrors=function(e){typeof e=="string"||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))};function Wye(t,e){return e+": "+t.toString()+` -`}F_.prototype.toString=function(e){return this.errors.map(Wye).join("")};Object.defineProperty(F_.prototype,"valid",{get:function(){return!this.errors.length}});WO.exports.ValidatorResultError=$a;function $a(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$a),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}$a.prototype=new Error;$a.prototype.constructor=$a;$a.prototype.name="Validation Error";var zH=jr.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};zH.prototype=Object.create(Error.prototype,{constructor:{value:zH,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var ZO=jr.SchemaContext=function(e,r,n,i,o){this.schema=e,this.options=r,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce(function(s,a){return s+UH(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};ZO.prototype.resolve=function(e){return qH(this.base,e)};ZO.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=qH(this.base,i||"");var s=new ZO(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var Xn=jr.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(t){return typeof t=="string"&&parseFloat(t)===parseInt(t,10)&&!isNaN(t)},regex:function(t){var e=!0;try{new RegExp(t)}catch{e=!1}return e},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};Xn.regexp=Xn.regex;Xn.pattern=Xn.regex;Xn.ipv4=Xn["ip-address"];jr.isFormat=function(e,r,n){if(typeof e=="string"&&Xn[r]!==void 0){if(Xn[r]instanceof RegExp)return Xn[r].test(e);if(typeof Xn[r]=="function")return Xn[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var UH=jr.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};jr.deepCompareStrict=function t(e,r){if(typeof e!=typeof r)return!1;if(Array.isArray(e))return!Array.isArray(r)||e.length!==r.length?!1:e.every(function(o,s){return t(e[s],r[s])});if(typeof e=="object"){if(!e||!r)return e===r;var n=Object.keys(e),i=Object.keys(r);return n.length!==i.length?!1:n.every(function(o){return t(e[o],r[o])})}return e===r};function Kye(t,e,r,n){typeof r=="object"?e[n]=VO(t[n],r):t.indexOf(r)===-1&&e.push(r)}function Jye(t,e,r){e[r]=t[r]}function Yye(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=VO(t[n],e[n]):r[n]=e[n]}function VO(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(Kye.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(Jye.bind(null,t,n)),Object.keys(e).forEach(Yye.bind(null,t,e,n))),n}WO.exports.deepMerge=VO;jr.objectGetPath=function(e,r){for(var n=r.split("/").slice(1),i;typeof(i=n.shift())=="string";){var o=decodeURIComponent(i.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in e))return;e=e[o]}return e};function Xye(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}jr.encodePath=function(e){return e.map(Xye).join("")};jr.getDecimalPlaces=function(e){var r=0;if(isNaN(e))return r;typeof e!="number"&&(e=Number(e));var n=e.toString().split("e");if(n.length===2){if(n[1][0]!=="-")return r;r=Number(n[1].slice(1))}var i=n[0].split(".");return i.length===2&&(r+=i[1].length),r};jr.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var qH=jr.resolveUrl=function(e,r){let n=new URL(r,new URL(e,"resolve://"));if(n.protocol==="resolve:"){let{pathname:i,search:o,hash:s}=n;return i+o+s}return n.toString()}});var ZH=v((d7e,GH)=>{"use strict";var rn=is(),Le=rn.ValidatorResult,os=rn.SchemaError,KO={};KO.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var ze=KO.validators={};ze.type=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=Array.isArray(r.type)?r.type:[r.type];if(!s.some(this.testType.bind(this,e,r,n,i))){var a=s.map(function(c){if(c){var l=c.$id||c.id;return l?"<"+l+">":c+""}});o.addError({name:"type",argument:a,message:"is not of a type(s) "+a})}return o};function JO(t,e,r,n,i){var o=e.throwError,s=e.throwAll;e.throwError=!1,e.throwAll=!1;var a=this.validateSchema(t,i,e,r);return e.throwError=o,e.throwAll=s,!a.valid&&n instanceof Function&&n(a),a.valid}ze.anyOf=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=new Le(e,r,n,i);if(!Array.isArray(r.anyOf))throw new os("anyOf must be an array");if(!r.anyOf.some(JO.bind(this,e,n,i,function(c){s.importErrors(c)}))){var a=r.anyOf.map(function(c,l){var u=c.$id||c.id;return u?"<"+u+">":c.title&&JSON.stringify(c.title)||c.$ref&&"<"+c.$ref+">"||"[subschema "+l+"]"});n.nestedErrors&&o.importErrors(s),o.addError({name:"anyOf",argument:a,message:"is not any of "+a.join(",")})}return o};ze.allOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.allOf))throw new os("allOf must be an array");var o=new Le(e,r,n,i),s=this;return r.allOf.forEach(function(a,c){var l=s.validateSchema(e,a,n,i);if(!l.valid){var u=a.$id||a.id,d=u||a.title&&JSON.stringify(a.title)||a.$ref&&"<"+a.$ref+">"||"[subschema "+c+"]";o.addError({name:"allOf",argument:{id:d,length:l.errors.length,valid:l},message:"does not match allOf schema "+d+" with "+l.errors.length+" error[s]:"}),o.importErrors(l)}}),o};ze.oneOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.oneOf))throw new os("oneOf must be an array");var o=new Le(e,r,n,i),s=new Le(e,r,n,i),a=r.oneOf.filter(JO.bind(this,e,n,i,function(l){s.importErrors(l)})).length,c=r.oneOf.map(function(l,u){var d=l.$id||l.id;return d||l.title&&JSON.stringify(l.title)||l.$ref&&"<"+l.$ref+">"||"[subschema "+u+"]"});return a!==1&&(n.nestedErrors&&o.importErrors(s),o.addError({name:"oneOf",argument:c,message:"is not exactly one from "+c.join(",")})),o};ze.if=function(e,r,n,i){if(e===void 0)return null;if(!rn.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=JO.call(this,e,n,i,null,r.if),s=new Le(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!rn.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(e,r.then,n,i.makeChild(r.then)),s.importErrors(a)}else{if(r.else===void 0)return;if(!rn.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(e,r.else,n,i.makeChild(r.else)),s.importErrors(a)}return s};function YO(t,e){if(Object.hasOwnProperty.call(t,e))return t[e];if(e in t){for(;t=Object.getPrototypeOf(t);)if(Object.propertyIsEnumerable.call(t,e))return t[e]}}ze.propertyNames=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!rn.isSchema(s))throw new os('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(YO(e,a)!==void 0){var c=this.validateSchema(a,s,n,i.makeChild(s));o.importErrors(c)}return o}};ze.properties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.properties||{};for(var a in s){var c=s[a];if(c!==void 0){if(c===null)throw new os('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=YO(e,a),u=this.validateSchema(l,c,n,i.makeChild(c,a));u.instance!==o.instance[a]&&(o.instance[a]=u.instance),o.importErrors(u)}}return o}};function BH(t,e,r,n,i,o){if(this.types.object(t)&&!(e.properties&&e.properties[i]!==void 0))if(e.additionalProperties===!1)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var s=e.additionalProperties||{};typeof r.preValidateProperty=="function"&&r.preValidateProperty(t,i,s,r,n);var a=this.validateSchema(t[i],s,r,n.makeChild(s,i));a.instance!==o.instance[i]&&(o.instance[i]=a.instance),o.importErrors(a)}}ze.patternProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.patternProperties||{};for(var a in e){var c=!0;for(var l in s){var u=s[l];if(u!==void 0){if(u===null)throw new os('Unexpected null, expected schema in "patternProperties"');try{var d=new RegExp(l,"u")}catch{d=new RegExp(l)}if(d.test(a)){c=!1,typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,u,n,i);var f=this.validateSchema(e[a],u,n,i.makeChild(u,a));f.instance!==o.instance[a]&&(o.instance[a]=f.instance),o.importErrors(f)}}}c&&BH.call(this,e,r,n,i,a,o)}return o}};ze.additionalProperties=function(e,r,n,i){if(this.types.object(e)){if(r.patternProperties)return null;var o=new Le(e,r,n,i);for(var s in e)BH.call(this,e,r,n,i,s,o);return o}};ze.minProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=Object.keys(e);return s.length>=r.minProperties||o.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),o}};ze.maxProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=Object.keys(e);return s.length<=r.maxProperties||o.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),o}};ze.items=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.items!==void 0){var s=new Le(e,r,n,i);return e.every(function(a,c){if(Array.isArray(r.items))var l=r.items[c]===void 0?r.additionalItems:r.items[c];else var l=r.items;if(l===void 0)return!0;if(l===!1)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=o.validateSchema(a,l,n,i.makeChild(l,c));return u.instance!==s.instance[c]&&(s.instance[c]=u.instance),s.importErrors(u),!0}),s}};ze.contains=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.contains!==void 0){if(!rn.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new Le(e,r,n,i),a=e.some(function(c,l){var u=o.validateSchema(c,r.contains,n,i.makeChild(r.contains,l));return u.errors.length===0});return a===!1&&s.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),s}};ze.minimum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(e,r,n,i);return r.exclusiveMinimum&&r.exclusiveMinimum===!0?e>r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):e>=r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),o}};ze.maximum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(e,r,n,i);return r.exclusiveMaximum&&r.exclusiveMaximum===!0?er.exclusiveMinimum;return s||o.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),o}};ze.exclusiveMaximum=function(e,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(e)){var o=new Le(e,r,n,i),s=e=r.minLength||o.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),o}};ze.maxLength=function(e,r,n,i){if(this.types.string(e)){var o=new Le(e,r,n,i),s=e.match(/[\uDC00-\uDFFF]/g),a=e.length-(s?s.length:0);return a<=r.maxLength||o.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),o}};ze.minItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(e,r,n,i);return e.length>=r.minItems||o.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),o}};ze.maxItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(e,r,n,i);return e.length<=r.maxItems||o.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),o}};function Qye(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var XO=is();QO.exports.SchemaScanResult=VH;function VH(t,e){this.id=t,this.ref=e}QO.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=XO.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=XO.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!XO.deepCompareStrict(s[f],l))throw new Error("Schema <"+f+"> already exists with different definition");return s[f]}s[f]=l,f[f.length-1]=="#"&&(s[f.substring(0,f.length-1)]=l)}i(f+"/items",Array.isArray(l.items)?l.items:[l.items]),i(f+"/extends",Array.isArray(l.extends)?l.extends:[l.extends]),n(f+"/additionalItems",l.additionalItems),o(f+"/properties",l.properties),n(f+"/additionalProperties",l.additionalProperties),o(f+"/definitions",l.definitions),o(f+"/patternProperties",l.patternProperties),o(f+"/dependencies",l.dependencies),i(f+"/disallow",l.disallow),i(f+"/allOf",l.allOf),i(f+"/anyOf",l.anyOf),i(f+"/oneOf",l.oneOf),n(f+"/not",l.not)}function i(c,l){if(Array.isArray(l))for(var u=0;u{"use strict";var WH=ZH(),ss=is(),KH=L_().scan,JH=ss.ValidatorResult,e_e=ss.ValidatorResultError,zf=ss.SchemaError,YH=ss.SchemaContext,t_e="/",Jt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(Ri),this.attributes=Object.create(WH.validators)};Jt.prototype.customFormats={};Jt.prototype.schemas=null;Jt.prototype.types=null;Jt.prototype.attributes=null;Jt.prototype.unresolvedRefs=null;Jt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=KH(r||t_e,e),o=r||e.$id||e.id;for(var s in i.id)this.schemas[s]=i.id[s];for(var s in i.ref)this.unresolvedRefs.push(s);return this.unresolvedRefs=this.unresolvedRefs.filter(function(a){return typeof n.schemas[a]>"u"}),this.schemas[o]};Jt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=ss.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new zf("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Jt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new zf('Unexpected null in "type" keyword');if(typeof this.types[o]=="function")return this.types[o].call(this,e);if(o&&typeof o=="object"){var s=this.validateSchema(e,o,n,i);return s===void 0||!(s&&s.errors.length)}return!0}};var Ri=Jt.prototype.types={};Ri.string=function(e){return typeof e=="string"};Ri.number=function(e){return typeof e=="number"&&isFinite(e)};Ri.integer=function(e){return typeof e=="number"&&e%1===0};Ri.boolean=function(e){return typeof e=="boolean"};Ri.array=function(e){return Array.isArray(e)};Ri.null=function(e){return e===null};Ri.date=function(e){return e instanceof Date};Ri.any=function(e){return!0};Ri.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};QH.exports=Jt});var tG=v((m7e,ho)=>{"use strict";var r_e=ho.exports.Validator=eG();ho.exports.ValidatorResult=is().ValidatorResult;ho.exports.ValidatorResultError=is().ValidatorResultError;ho.exports.ValidationError=is().ValidationError;ho.exports.SchemaError=is().SchemaError;ho.exports.SchemaScanResult=L_().SchemaScanResult;ho.exports.scan=L_().scan;ho.exports.validate=function(t,e,r){var n=new r_e;return n.validate(t,e,r)}});import{readFileSync as n_e}from"node:fs";import{dirname as i_e,join as o_e}from"node:path";import{fileURLToPath as s_e}from"node:url";function d_e(t){let e=u_e.validate(t,l_e);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function nG(t){let e=d_e(t);if(!e.valid)throw new Error(`spec.yaml invalid: +`)}function hl(t,e,r){let n=[`# Audit \u2014 shipped changes since ${t.since}`,"","| feature | AC | EARS | verification refs |","|---|---|---|---|"],i=new Map(e.features.map(o=>[o.id,o]));for(let o of t.groups)for(let s of o.features){let a=i.get(s.id);if(!a){n.push(`| ${s.id} | \u2014 | \u2014 | (removed from spec \u2014 see git history at ${t.since}) |`);continue}let c=a.acceptance_criteria??[];if(c.length===0){n.push(`| ${a.id} | \u2014 | \u2014 | (no acceptance criteria) |`);continue}for(let l of c)n.push(`| ${a.id} | ${l.id} | ${l.ears??"\u2014"} | ${Vye(l,r)} |`)}return n.join(` +`)}function Vye(t,e){let r=[...t.test_refs??[],...t.oracle_refs??[],...t.evidence_refs??[]];return r.length===0?"(none)":r.map(n=>{for(let[o,s]of Zye)if(n.startsWith(o))return`${n} (${s})`;let i=n.split("#",1)[0]??n;return`${Bye(Hye(e,i))?"\u2713":"\u2717"} ${n}`}).join("
")}function gl(t){let e=[`# ${t.project.name} \u2014 capability catalog`,""],r=[...t.capabilities??[]].filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=new Map(t.features.map(s=>[s.id,s])),i=new Set;for(let s of r){e.push(`## ${s.title??s.id}`,""),s.summary&&e.push(s.summary,"");for(let a of s.features??[]){let c=n.get(a);!c||c.status==="archived"||(i.add(a),FH(e,c))}}let o=t.features.filter(s=>!i.has(s.id)&&s.status!=="archived").sort((s,a)=>s.id.localeCompare(a.id));if(o.length>0){e.push("## Uncategorized","");for(let s of o)FH(e,s)}for(;e[e.length-1]==="";)e.pop();return e.join(` +`)}function FH(t,e){t.push(`### ${e.title}`,"");for(let r of e.acceptance_criteria??[]){let n=TO(r);n&&t.push(`- ${n}`)}t.push("")}var Gye,Zye,M_=y(()=>{"use strict";Lf();j_();dl();Gye={"added-as-done":"new","flipped-to-done":"completed","modified-while-done":"updated",archived:"retired"};Zye=[["derived:","machine-suggested \u2014 not author-confirmed"],["self-dogfood:","verified by cladding running on itself"],["fixture:","conformance fixture"],["script:","npm script"]]});import{readFileSync as Wye}from"node:fs";function Oi(t="./spec.yaml"){let e=Wye(t,"utf8");return(0,zH.parse)(e)}var zH,F_=y(()=>{"use strict";zH=St(er(),1)});var is=v((jr,KO)=>{"use strict";var ZO=jr.ValidationError=function(e,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+qH(l)},"instance")):i!==void 0&&(this.property=i),e&&(this.message=e),n){var a=n.$id||n.id;this.schema=a||n}r!==void 0&&(this.instance=r),this.name=o,this.argument=s,this.stack=this.toString()};ZO.prototype.toString=function(){return this.property+" "+this.message};var L_=jr.ValidatorResult=function(e,r,n,i){this.instance=e,this.schema=r,this.options=n,this.path=i.path,this.propertyPath=i.propertyPath,this.errors=[],this.throwError=n&&n.throwError,this.throwFirst=n&&n.throwFirst,this.throwAll=n&&n.throwAll,this.disableFormat=n&&n.disableFormat===!0};L_.prototype.addError=function(e){var r;if(typeof e=="string")r=new ZO(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");r=new ZO(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new $a(this);if(this.throwError)throw r;return r};L_.prototype.importErrors=function(e){typeof e=="string"||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))};function Kye(t,e){return e+": "+t.toString()+` +`}L_.prototype.toString=function(e){return this.errors.map(Kye).join("")};Object.defineProperty(L_.prototype,"valid",{get:function(){return!this.errors.length}});KO.exports.ValidatorResultError=$a;function $a(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,$a),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}$a.prototype=new Error;$a.prototype.constructor=$a;$a.prototype.name="Validation Error";var UH=jr.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};UH.prototype=Object.create(Error.prototype,{constructor:{value:UH,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var VO=jr.SchemaContext=function(e,r,n,i,o){this.schema=e,this.options=r,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce(function(s,a){return s+qH(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};VO.prototype.resolve=function(e){return BH(this.base,e)};VO.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=BH(this.base,i||"");var s=new VO(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var Xn=jr.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(t){return typeof t=="string"&&parseFloat(t)===parseInt(t,10)&&!isNaN(t)},regex:function(t){var e=!0;try{new RegExp(t)}catch{e=!1}return e},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};Xn.regexp=Xn.regex;Xn.pattern=Xn.regex;Xn.ipv4=Xn["ip-address"];jr.isFormat=function(e,r,n){if(typeof e=="string"&&Xn[r]!==void 0){if(Xn[r]instanceof RegExp)return Xn[r].test(e);if(typeof Xn[r]=="function")return Xn[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var qH=jr.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};jr.deepCompareStrict=function t(e,r){if(typeof e!=typeof r)return!1;if(Array.isArray(e))return!Array.isArray(r)||e.length!==r.length?!1:e.every(function(o,s){return t(e[s],r[s])});if(typeof e=="object"){if(!e||!r)return e===r;var n=Object.keys(e),i=Object.keys(r);return n.length!==i.length?!1:n.every(function(o){return t(e[o],r[o])})}return e===r};function Jye(t,e,r,n){typeof r=="object"?e[n]=WO(t[n],r):t.indexOf(r)===-1&&e.push(r)}function Yye(t,e,r){e[r]=t[r]}function Xye(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=WO(t[n],e[n]):r[n]=e[n]}function WO(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(Jye.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(Yye.bind(null,t,n)),Object.keys(e).forEach(Xye.bind(null,t,e,n))),n}KO.exports.deepMerge=WO;jr.objectGetPath=function(e,r){for(var n=r.split("/").slice(1),i;typeof(i=n.shift())=="string";){var o=decodeURIComponent(i.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in e))return;e=e[o]}return e};function Qye(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}jr.encodePath=function(e){return e.map(Qye).join("")};jr.getDecimalPlaces=function(e){var r=0;if(isNaN(e))return r;typeof e!="number"&&(e=Number(e));var n=e.toString().split("e");if(n.length===2){if(n[1][0]!=="-")return r;r=Number(n[1].slice(1))}var i=n[0].split(".");return i.length===2&&(r+=i[1].length),r};jr.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var BH=jr.resolveUrl=function(e,r){let n=new URL(r,new URL(e,"resolve://"));if(n.protocol==="resolve:"){let{pathname:i,search:o,hash:s}=n;return i+o+s}return n.toString()}});var VH=v((m7e,ZH)=>{"use strict";var rn=is(),Le=rn.ValidatorResult,os=rn.SchemaError,JO={};JO.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var ze=JO.validators={};ze.type=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=Array.isArray(r.type)?r.type:[r.type];if(!s.some(this.testType.bind(this,e,r,n,i))){var a=s.map(function(c){if(c){var l=c.$id||c.id;return l?"<"+l+">":c+""}});o.addError({name:"type",argument:a,message:"is not of a type(s) "+a})}return o};function YO(t,e,r,n,i){var o=e.throwError,s=e.throwAll;e.throwError=!1,e.throwAll=!1;var a=this.validateSchema(t,i,e,r);return e.throwError=o,e.throwAll=s,!a.valid&&n instanceof Function&&n(a),a.valid}ze.anyOf=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=new Le(e,r,n,i);if(!Array.isArray(r.anyOf))throw new os("anyOf must be an array");if(!r.anyOf.some(YO.bind(this,e,n,i,function(c){s.importErrors(c)}))){var a=r.anyOf.map(function(c,l){var u=c.$id||c.id;return u?"<"+u+">":c.title&&JSON.stringify(c.title)||c.$ref&&"<"+c.$ref+">"||"[subschema "+l+"]"});n.nestedErrors&&o.importErrors(s),o.addError({name:"anyOf",argument:a,message:"is not any of "+a.join(",")})}return o};ze.allOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.allOf))throw new os("allOf must be an array");var o=new Le(e,r,n,i),s=this;return r.allOf.forEach(function(a,c){var l=s.validateSchema(e,a,n,i);if(!l.valid){var u=a.$id||a.id,d=u||a.title&&JSON.stringify(a.title)||a.$ref&&"<"+a.$ref+">"||"[subschema "+c+"]";o.addError({name:"allOf",argument:{id:d,length:l.errors.length,valid:l},message:"does not match allOf schema "+d+" with "+l.errors.length+" error[s]:"}),o.importErrors(l)}}),o};ze.oneOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.oneOf))throw new os("oneOf must be an array");var o=new Le(e,r,n,i),s=new Le(e,r,n,i),a=r.oneOf.filter(YO.bind(this,e,n,i,function(l){s.importErrors(l)})).length,c=r.oneOf.map(function(l,u){var d=l.$id||l.id;return d||l.title&&JSON.stringify(l.title)||l.$ref&&"<"+l.$ref+">"||"[subschema "+u+"]"});return a!==1&&(n.nestedErrors&&o.importErrors(s),o.addError({name:"oneOf",argument:c,message:"is not exactly one from "+c.join(",")})),o};ze.if=function(e,r,n,i){if(e===void 0)return null;if(!rn.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=YO.call(this,e,n,i,null,r.if),s=new Le(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!rn.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(e,r.then,n,i.makeChild(r.then)),s.importErrors(a)}else{if(r.else===void 0)return;if(!rn.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(e,r.else,n,i.makeChild(r.else)),s.importErrors(a)}return s};function XO(t,e){if(Object.hasOwnProperty.call(t,e))return t[e];if(e in t){for(;t=Object.getPrototypeOf(t);)if(Object.propertyIsEnumerable.call(t,e))return t[e]}}ze.propertyNames=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!rn.isSchema(s))throw new os('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(XO(e,a)!==void 0){var c=this.validateSchema(a,s,n,i.makeChild(s));o.importErrors(c)}return o}};ze.properties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.properties||{};for(var a in s){var c=s[a];if(c!==void 0){if(c===null)throw new os('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=XO(e,a),u=this.validateSchema(l,c,n,i.makeChild(c,a));u.instance!==o.instance[a]&&(o.instance[a]=u.instance),o.importErrors(u)}}return o}};function HH(t,e,r,n,i,o){if(this.types.object(t)&&!(e.properties&&e.properties[i]!==void 0))if(e.additionalProperties===!1)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var s=e.additionalProperties||{};typeof r.preValidateProperty=="function"&&r.preValidateProperty(t,i,s,r,n);var a=this.validateSchema(t[i],s,r,n.makeChild(s,i));a.instance!==o.instance[i]&&(o.instance[i]=a.instance),o.importErrors(a)}}ze.patternProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.patternProperties||{};for(var a in e){var c=!0;for(var l in s){var u=s[l];if(u!==void 0){if(u===null)throw new os('Unexpected null, expected schema in "patternProperties"');try{var d=new RegExp(l,"u")}catch{d=new RegExp(l)}if(d.test(a)){c=!1,typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,u,n,i);var f=this.validateSchema(e[a],u,n,i.makeChild(u,a));f.instance!==o.instance[a]&&(o.instance[a]=f.instance),o.importErrors(f)}}}c&&HH.call(this,e,r,n,i,a,o)}return o}};ze.additionalProperties=function(e,r,n,i){if(this.types.object(e)){if(r.patternProperties)return null;var o=new Le(e,r,n,i);for(var s in e)HH.call(this,e,r,n,i,s,o);return o}};ze.minProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=Object.keys(e);return s.length>=r.minProperties||o.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),o}};ze.maxProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=Object.keys(e);return s.length<=r.maxProperties||o.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),o}};ze.items=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.items!==void 0){var s=new Le(e,r,n,i);return e.every(function(a,c){if(Array.isArray(r.items))var l=r.items[c]===void 0?r.additionalItems:r.items[c];else var l=r.items;if(l===void 0)return!0;if(l===!1)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=o.validateSchema(a,l,n,i.makeChild(l,c));return u.instance!==s.instance[c]&&(s.instance[c]=u.instance),s.importErrors(u),!0}),s}};ze.contains=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.contains!==void 0){if(!rn.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new Le(e,r,n,i),a=e.some(function(c,l){var u=o.validateSchema(c,r.contains,n,i.makeChild(r.contains,l));return u.errors.length===0});return a===!1&&s.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),s}};ze.minimum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(e,r,n,i);return r.exclusiveMinimum&&r.exclusiveMinimum===!0?e>r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):e>=r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),o}};ze.maximum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(e,r,n,i);return r.exclusiveMaximum&&r.exclusiveMaximum===!0?er.exclusiveMinimum;return s||o.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),o}};ze.exclusiveMaximum=function(e,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(e)){var o=new Le(e,r,n,i),s=e=r.minLength||o.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),o}};ze.maxLength=function(e,r,n,i){if(this.types.string(e)){var o=new Le(e,r,n,i),s=e.match(/[\uDC00-\uDFFF]/g),a=e.length-(s?s.length:0);return a<=r.maxLength||o.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),o}};ze.minItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(e,r,n,i);return e.length>=r.minItems||o.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),o}};ze.maxItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(e,r,n,i);return e.length<=r.maxItems||o.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),o}};function e_e(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var QO=is();eR.exports.SchemaScanResult=WH;function WH(t,e){this.id=t,this.ref=e}eR.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=QO.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=QO.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!QO.deepCompareStrict(s[f],l))throw new Error("Schema <"+f+"> already exists with different definition");return s[f]}s[f]=l,f[f.length-1]=="#"&&(s[f.substring(0,f.length-1)]=l)}i(f+"/items",Array.isArray(l.items)?l.items:[l.items]),i(f+"/extends",Array.isArray(l.extends)?l.extends:[l.extends]),n(f+"/additionalItems",l.additionalItems),o(f+"/properties",l.properties),n(f+"/additionalProperties",l.additionalProperties),o(f+"/definitions",l.definitions),o(f+"/patternProperties",l.patternProperties),o(f+"/dependencies",l.dependencies),i(f+"/disallow",l.disallow),i(f+"/allOf",l.allOf),i(f+"/anyOf",l.anyOf),i(f+"/oneOf",l.oneOf),n(f+"/not",l.not)}function i(c,l){if(Array.isArray(l))for(var u=0;u{"use strict";var KH=VH(),ss=is(),JH=z_().scan,YH=ss.ValidatorResult,t_e=ss.ValidatorResultError,zf=ss.SchemaError,XH=ss.SchemaContext,r_e="/",Jt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(Ri),this.attributes=Object.create(KH.validators)};Jt.prototype.customFormats={};Jt.prototype.schemas=null;Jt.prototype.types=null;Jt.prototype.attributes=null;Jt.prototype.unresolvedRefs=null;Jt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=JH(r||r_e,e),o=r||e.$id||e.id;for(var s in i.id)this.schemas[s]=i.id[s];for(var s in i.ref)this.unresolvedRefs.push(s);return this.unresolvedRefs=this.unresolvedRefs.filter(function(a){return typeof n.schemas[a]>"u"}),this.schemas[o]};Jt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=ss.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new zf("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Jt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new zf('Unexpected null in "type" keyword');if(typeof this.types[o]=="function")return this.types[o].call(this,e);if(o&&typeof o=="object"){var s=this.validateSchema(e,o,n,i);return s===void 0||!(s&&s.errors.length)}return!0}};var Ri=Jt.prototype.types={};Ri.string=function(e){return typeof e=="string"};Ri.number=function(e){return typeof e=="number"&&isFinite(e)};Ri.integer=function(e){return typeof e=="number"&&e%1===0};Ri.boolean=function(e){return typeof e=="boolean"};Ri.array=function(e){return Array.isArray(e)};Ri.null=function(e){return e===null};Ri.date=function(e){return e instanceof Date};Ri.any=function(e){return!0};Ri.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};eG.exports=Jt});var rG=v((y7e,ho)=>{"use strict";var n_e=ho.exports.Validator=tG();ho.exports.ValidatorResult=is().ValidatorResult;ho.exports.ValidatorResultError=is().ValidatorResultError;ho.exports.ValidationError=is().ValidationError;ho.exports.SchemaError=is().SchemaError;ho.exports.SchemaScanResult=z_().SchemaScanResult;ho.exports.scan=z_().scan;ho.exports.validate=function(t,e,r){var n=new n_e;return n.validate(t,e,r)}});import{readFileSync as i_e}from"node:fs";import{dirname as o_e,join as s_e}from"node:path";import{fileURLToPath as a_e}from"node:url";function f_e(t){let e=d_e.validate(t,u_e);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function iG(t){let e=f_e(t);if(!e.valid)throw new Error(`spec.yaml invalid: ${e.errors.join(` - `)}`)}var rG,a_e,c_e,l_e,u_e,iG=y(()=>{"use strict";rG=St(tG(),1),a_e=i_e(s_e(import.meta.url)),c_e=o_e(a_e,"schema.json"),l_e=JSON.parse(n_e(c_e,"utf8")),u_e=new rG.Validator});import{existsSync as eR,readdirSync as f_e}from"node:fs";import{dirname as p_e,join as ka,resolve as sG}from"node:path";function oG(t){return eR(t)?f_e(t).filter(r=>r.endsWith(".yaml")||r.endsWith(".yml")).map(r=>Oi(ka(t,r))):[]}function Ea(t,e){z_=e?{cwd:sG(t),spec:e}:null}function B(t=".",e="spec.yaml"){return z_&&e==="spec.yaml"&&sG(t)===z_.cwd?z_.spec:m_e(t,e)}function m_e(t,e){let r=ka(t,e),n=Oi(r),i=ka(t,p_e(e),"spec");if(!n.features||n.features.length===0){let o=oG(ka(i,"features"));o.length>0&&(n.features=o)}if(!n.scenarios||n.scenarios.length===0){let o=oG(ka(i,"scenarios"));o.length>0&&(n.scenarios=o)}if(!n.architecture){let o=ka(i,"architecture.yaml");eR(o)&&(n.architecture=Oi(o))}if(!n.capabilities||n.capabilities.length===0){let o=ka(i,"capabilities.yaml");if(eR(o)){let s=Oi(o);s&&Array.isArray(s.capabilities)&&(n.capabilities=s.capabilities)}}return nG(n),n}var z_,Ue=y(()=>{"use strict";M_();iG();z_=null});import yl from"node:process";function nR(){return!!yl.stdout.isTTY}function L(t,e,r=""){let n=aG[t],i=r?` ${r}`:"";nR()?yl.stdout.write(`${tR[t]}${n}${rR} ${e}${i} + `)}`)}var nG,c_e,l_e,u_e,d_e,oG=y(()=>{"use strict";nG=St(rG(),1),c_e=o_e(a_e(import.meta.url)),l_e=s_e(c_e,"schema.json"),u_e=JSON.parse(i_e(l_e,"utf8")),d_e=new nG.Validator});import{existsSync as tR,readdirSync as p_e}from"node:fs";import{dirname as m_e,join as ka,resolve as aG}from"node:path";function sG(t){return tR(t)?p_e(t).filter(r=>r.endsWith(".yaml")||r.endsWith(".yml")).map(r=>Oi(ka(t,r))):[]}function Ea(t,e){U_=e?{cwd:aG(t),spec:e}:null}function q(t=".",e="spec.yaml"){return U_&&e==="spec.yaml"&&aG(t)===U_.cwd?U_.spec:h_e(t,e)}function h_e(t,e){let r=ka(t,e),n=Oi(r),i=ka(t,m_e(e),"spec");if(!n.features||n.features.length===0){let o=sG(ka(i,"features"));o.length>0&&(n.features=o)}if(!n.scenarios||n.scenarios.length===0){let o=sG(ka(i,"scenarios"));o.length>0&&(n.scenarios=o)}if(!n.architecture){let o=ka(i,"architecture.yaml");tR(o)&&(n.architecture=Oi(o))}if(!n.capabilities||n.capabilities.length===0){let o=ka(i,"capabilities.yaml");if(tR(o)){let s=Oi(o);s&&Array.isArray(s.capabilities)&&(n.capabilities=s.capabilities)}}return iG(n),n}var U_,Ue=y(()=>{"use strict";F_();oG();U_=null});import yl from"node:process";function iR(){return!!yl.stdout.isTTY}function L(t,e,r=""){let n=cG[t],i=r?` ${r}`:"";iR()?yl.stdout.write(`${rR[t]}${n}${nR} ${e}${i} `):yl.stdout.write(`${n} ${e}${i} -`)}function Uf(t,e,r=""){if(!nR())return;let n=r?` ${r}`:"";yl.stdout.write(`${cG}${tR.start}\xB7${rR} ${t} \xB7 ${e}${n}`)}function Aa(t,e,r=""){let n=aG[t],i=r?` ${r}`:"";nR()?yl.stdout.write(`${cG}${tR[t]}${n}${rR} ${e}${i} +`)}function Uf(t,e,r=""){if(!iR())return;let n=r?` ${r}`:"";yl.stdout.write(`${lG}${rR.start}\xB7${nR} ${t} \xB7 ${e}${n}`)}function Aa(t,e,r=""){let n=cG[t],i=r?` ${r}`:"";iR()?yl.stdout.write(`${lG}${rR[t]}${n}${nR} ${e}${i} `):yl.stdout.write(`${n} ${e}${i} -`)}var aG,tR,rR,cG,Ii=y(()=>{"use strict";aG={start:"\xB7",pass:"\u2713",fail:"\u2717",skip:"\xB7",note:"\u2139"},tR={start:"\x1B[90m",pass:"\x1B[32m",fail:"\x1B[31m",skip:"\x1B[90m",note:"\x1B[36m"},rR="\x1B[0m",cG="\r\x1B[K"});import{createHash as OG}from"node:crypto";import{existsSync as Z_e,readFileSync as sR,writeFileSync as V_e}from"node:fs";import{join as U_}from"node:path";function W_e(t,e){let r=OG("sha256");for(let n of[...e].sort()){r.update(n),r.update("\0");try{r.update(sR(U_(t,n)))}catch{r.update("")}r.update("\0")}return r.digest("hex").slice(0,16)}function IG(t,e){let r=OG("sha256");try{r.update(sR(U_(t,e)))}catch{r.update("")}return r.digest("hex").slice(0,16)}function as(t){let e=U_(t,...RG);if(!Z_e(e))return null;let r;try{r=sR(e,"utf8")}catch{return null}let n=null,i=null,o=null,s="other";for(let a of r.split(` -`)){if(a==="attested:"){s="v1",n??=new Map;continue}if(a==="attested_modules:"){s="modules",i??=new Map;continue}if(a==="attested_features:"){s="features",o??=new Set;continue}if(!(a.startsWith("#")||a.trim()==="")){if(s==="v1"){let c=a.match(/^ {2}(F-[\w-]+): ([0-9a-f]{16})$/);c&&n.set(c[1],c[2])}else if(s==="modules"){let c=a.match(/^ {2}(.+): ([0-9a-f]{16})$/);c&&i.set(c[1],c[2])}else if(s==="features"){let c=a.match(/^ {2}(F-[\w-]+): ok$/);c&&o.add(c[1])}}}return{v1:n,modules:i,features:o}}function q_(t){return t.features?.size??t.v1?.size??0}function B_(t,e,r){let n=r.modules??[];if(t.modules!==null||t.features!==null){if(!t.features?.has(r.id))return{state:"unattested"};let o=t.modules??new Map;for(let s of[...n].sort())if(o.get(s)!==IG(e,s))return{state:"stale",module:s};return{state:"fresh"}}let i=t.v1?.get(r.id);return i===void 0?{state:"unattested"}:i===W_e(e,n)?{state:"fresh"}:{state:"stale"}}function PG(t,e){let r=(e.features??[]).filter(a=>a.status==="done"&&(a.modules??[]).length>0);if(r.length===0)return!1;let n=new Set;for(let a of r)for(let c of a.modules??[])n.add(c);let i=[...n].sort().map(a=>` ${a}: ${IG(t,a)}`),o=r.map(a=>` ${a.id}: ok`).sort(),s=K_e+`attested_modules: +`)}var cG,rR,nR,lG,Ii=y(()=>{"use strict";cG={start:"\xB7",pass:"\u2713",fail:"\u2717",skip:"\xB7",note:"\u2139"},rR={start:"\x1B[90m",pass:"\x1B[32m",fail:"\x1B[31m",skip:"\x1B[90m",note:"\x1B[36m"},nR="\x1B[0m",lG="\r\x1B[K"});import{createHash as RG}from"node:crypto";import{existsSync as V_e,readFileSync as aR,writeFileSync as W_e}from"node:fs";import{join as q_}from"node:path";function K_e(t,e){let r=RG("sha256");for(let n of[...e].sort()){r.update(n),r.update("\0");try{r.update(aR(q_(t,n)))}catch{r.update("")}r.update("\0")}return r.digest("hex").slice(0,16)}function PG(t,e){let r=RG("sha256");try{r.update(aR(q_(t,e)))}catch{r.update("")}return r.digest("hex").slice(0,16)}function as(t){let e=q_(t,...IG);if(!V_e(e))return null;let r;try{r=aR(e,"utf8")}catch{return null}let n=null,i=null,o=null,s="other";for(let a of r.split(` +`)){if(a==="attested:"){s="v1",n??=new Map;continue}if(a==="attested_modules:"){s="modules",i??=new Map;continue}if(a==="attested_features:"){s="features",o??=new Set;continue}if(!(a.startsWith("#")||a.trim()==="")){if(s==="v1"){let c=a.match(/^ {2}(F-[\w-]+): ([0-9a-f]{16})$/);c&&n.set(c[1],c[2])}else if(s==="modules"){let c=a.match(/^ {2}(.+): ([0-9a-f]{16})$/);c&&i.set(c[1],c[2])}else if(s==="features"){let c=a.match(/^ {2}(F-[\w-]+): ok$/);c&&o.add(c[1])}}}return{v1:n,modules:i,features:o}}function B_(t){return t.features?.size??t.v1?.size??0}function H_(t,e,r){let n=r.modules??[];if(t.modules!==null||t.features!==null){if(!t.features?.has(r.id))return{state:"unattested"};let o=t.modules??new Map;for(let s of[...n].sort())if(o.get(s)!==PG(e,s))return{state:"stale",module:s};return{state:"fresh"}}let i=t.v1?.get(r.id);return i===void 0?{state:"unattested"}:i===K_e(e,n)?{state:"fresh"}:{state:"stale"}}function CG(t,e){let r=(e.features??[]).filter(a=>a.status==="done"&&(a.modules??[]).length>0);if(r.length===0)return!1;let n=new Set;for(let a of r)for(let c of a.modules??[])n.add(c);let i=[...n].sort().map(a=>` ${a}: ${PG(t,a)}`),o=r.map(a=>` ${a.id}: ok`).sort(),s=J_e+`attested_modules: `+i.join(` `)+` attested_features: `+o.join(` `)+` -`;return V_e(U_(t,...RG),s,"utf8"),!0}var RG,K_e,vl=y(()=>{"use strict";RG=["spec","attestation.yaml"];K_e=`# Cladding \xB7 Tier C \u2014 verification attestation (v2). Written ONLY by a GREEN +`;return W_e(q_(t,...IG),s,"utf8"),!0}var IG,J_e,vl=y(()=>{"use strict";IG=["spec","attestation.yaml"];J_e=`# Cladding \xB7 Tier C \u2014 verification attestation (v2). Written ONLY by a GREEN # \`clad check --tier=pre-push --strict\` gate \u2014 the file's one honest author. # Do not edit by hand. # @@ -211,53 +211,53 @@ attested_features: # Merge conflict here? NEVER hand-resolve the hashes \u2014 keep either side and run # \`clad check --tier=pre-push --strict\`; the GREEN gate rewrites the truth. # Content-anchored: survives fresh clones and squash/rebase. -`});import{resolve as aR}from"node:path";function H_(t){cs={cwd:aR(t),results:new Map}}function CG(t,e,r){!cs||cs.cwd!==aR(e)||cs.results.set(t,r)}function G_(t,e){return!cs||cs.cwd!==aR(e)?null:cs.results.get(t)??null}function Z_(){cs=null}var cs,Sl=y(()=>{"use strict";cs=null});function Ot(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var yo=y(()=>{});import{fileURLToPath as J_e}from"node:url";var wl,Y_e,cR,lR,xl=y(()=>{wl=(t,e)=>{let r=lR(Y_e(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},Y_e=t=>cR(t)?t.toString():t,cR=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,lR=t=>t instanceof URL?J_e(t):t});var V_,uR=y(()=>{yo();xl();V_=(t,e=[],r={})=>{let n=wl(t,"First argument"),[i,o]=Ot(e)?[[],e]:[e,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let s=i.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!Ot(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,s,o]}});import{StringDecoder as X_e}from"node:string_decoder";var DG,NG,qt,_o,Q_e,jG,ebe,W_,MG,tbe,Bf,rbe,dR,nbe,nn=y(()=>{({toString:DG}=Object.prototype),NG=t=>DG.call(t)==="[object ArrayBuffer]",qt=t=>DG.call(t)==="[object Uint8Array]",_o=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Q_e=new TextEncoder,jG=t=>Q_e.encode(t),ebe=new TextDecoder,W_=t=>ebe.decode(t),MG=(t,e)=>tbe(t,e).join(""),tbe=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new X_e(e),n=t.map(o=>typeof o=="string"?jG(o):o).map(o=>r.write(o)),i=r.end();return i===""?n:[...n,i]},Bf=t=>t.length===1&&qt(t[0])?t[0]:dR(rbe(t)),rbe=t=>t.map(e=>typeof e=="string"?jG(e):e),dR=t=>{let e=new Uint8Array(nbe(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},nbe=t=>{let e=0;for(let r of t)e+=r.length;return e}});import{ChildProcess as ibe}from"node:child_process";var UG,qG,obe,sbe,FG,abe,LG,zG,cbe,BG=y(()=>{yo();nn();UG=t=>Array.isArray(t)&&Array.isArray(t.raw),qG=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=obe({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},obe=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=sbe(i,t.raw[n]),c=LG(r,o,s);if(n===e.length)return c;let l=e[n],u=Array.isArray(l)?l.map(d=>zG(d)):[zG(l)];return LG(c,u,a)},sbe=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=FG.has(e[0]);for(let s=0,a=0;sr||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],zG=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(Ot(t)&&("stdout"in t||"isMaxBuffer"in t))return cbe(t);throw t instanceof ibe||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},cbe=({stdout:t})=>{if(typeof t=="string")return t;if(qt(t))return W_(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)}});import fR from"node:process";var Qn,K_,Tn,J_,bo=y(()=>{Qn=t=>K_.includes(t),K_=[fR.stdin,fR.stdout,fR.stderr],Tn=["stdin","stdout","stderr"],J_=t=>Tn[t]??`stdio[${t}]`});import{debuglog as lbe}from"node:util";var GG,pR,ube,dbe,fbe,pbe,HG,mbe,mR,hbe,gbe,ybe,_be,hR,vo,So=y(()=>{yo();bo();GG=t=>{let e={...t};for(let r of hR)e[r]=pR(t,r);return e},pR=(t,e)=>{let r=Array.from({length:ube(t)+1}),n=dbe(t[e],r,e);return gbe(n,e)},ube=({stdio:t})=>Array.isArray(t)?Math.max(t.length,Tn.length):Tn.length,dbe=(t,e,r)=>Ot(t)?fbe(t,e,r):e.fill(t),fbe=(t,e,r)=>{for(let n of Object.keys(t).sort(pbe))for(let i of mbe(n,r,e))e[i]=t[n];return e},pbe=(t,e)=>HG(t)t==="stdout"||t==="stderr"?0:t==="all"?2:1,mbe=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=mR(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid. +`});import{resolve as cR}from"node:path";function G_(t){cs={cwd:cR(t),results:new Map}}function DG(t,e,r){!cs||cs.cwd!==cR(e)||cs.results.set(t,r)}function Z_(t,e){return!cs||cs.cwd!==cR(e)?null:cs.results.get(t)??null}function V_(){cs=null}var cs,Sl=y(()=>{"use strict";cs=null});function Ot(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var yo=y(()=>{});import{fileURLToPath as Y_e}from"node:url";var wl,X_e,lR,uR,xl=y(()=>{wl=(t,e)=>{let r=uR(X_e(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},X_e=t=>lR(t)?t.toString():t,lR=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,uR=t=>t instanceof URL?Y_e(t):t});var W_,dR=y(()=>{yo();xl();W_=(t,e=[],r={})=>{let n=wl(t,"First argument"),[i,o]=Ot(e)?[[],e]:[e,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let s=i.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!Ot(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,s,o]}});import{StringDecoder as Q_e}from"node:string_decoder";var NG,jG,qt,_o,ebe,MG,tbe,K_,FG,rbe,Bf,nbe,fR,ibe,nn=y(()=>{({toString:NG}=Object.prototype),jG=t=>NG.call(t)==="[object ArrayBuffer]",qt=t=>NG.call(t)==="[object Uint8Array]",_o=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),ebe=new TextEncoder,MG=t=>ebe.encode(t),tbe=new TextDecoder,K_=t=>tbe.decode(t),FG=(t,e)=>rbe(t,e).join(""),rbe=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new Q_e(e),n=t.map(o=>typeof o=="string"?MG(o):o).map(o=>r.write(o)),i=r.end();return i===""?n:[...n,i]},Bf=t=>t.length===1&&qt(t[0])?t[0]:fR(nbe(t)),nbe=t=>t.map(e=>typeof e=="string"?MG(e):e),fR=t=>{let e=new Uint8Array(ibe(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},ibe=t=>{let e=0;for(let r of t)e+=r.length;return e}});import{ChildProcess as obe}from"node:child_process";var qG,BG,sbe,abe,LG,cbe,zG,UG,lbe,HG=y(()=>{yo();nn();qG=t=>Array.isArray(t)&&Array.isArray(t.raw),BG=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=sbe({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},sbe=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=abe(i,t.raw[n]),c=zG(r,o,s);if(n===e.length)return c;let l=e[n],u=Array.isArray(l)?l.map(d=>UG(d)):[UG(l)];return zG(c,u,a)},abe=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=LG.has(e[0]);for(let s=0,a=0;sr||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],UG=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(Ot(t)&&("stdout"in t||"isMaxBuffer"in t))return lbe(t);throw t instanceof obe||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},lbe=({stdout:t})=>{if(typeof t=="string")return t;if(qt(t))return K_(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)}});import pR from"node:process";var Qn,J_,Tn,Y_,bo=y(()=>{Qn=t=>J_.includes(t),J_=[pR.stdin,pR.stdout,pR.stderr],Tn=["stdin","stdout","stderr"],Y_=t=>Tn[t]??`stdio[${t}]`});import{debuglog as ube}from"node:util";var ZG,mR,dbe,fbe,pbe,mbe,GG,hbe,hR,gbe,ybe,_be,bbe,gR,vo,So=y(()=>{yo();bo();ZG=t=>{let e={...t};for(let r of gR)e[r]=mR(t,r);return e},mR=(t,e)=>{let r=Array.from({length:dbe(t)+1}),n=fbe(t[e],r,e);return ybe(n,e)},dbe=({stdio:t})=>Array.isArray(t)?Math.max(t.length,Tn.length):Tn.length,fbe=(t,e,r)=>Ot(t)?pbe(t,e,r):e.fill(t),pbe=(t,e,r)=>{for(let n of Object.keys(t).sort(mbe))for(let i of hbe(n,r,e))e[i]=t[n];return e},mbe=(t,e)=>GG(t)t==="stdout"||t==="stderr"?0:t==="all"?2:1,hbe=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=hR(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid. It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist. -Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},mR=t=>{if(t==="all")return t;if(Tn.includes(t))return Tn.indexOf(t);let e=hbe.exec(t);if(e!==null)return Number(e[1])},hbe=/^fd(\d+)$/,gbe=(t,e)=>t.map(r=>r===void 0?_be[e]:r),ybe=lbe("execa").enabled?"full":"none",_be={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:ybe,stripFinalNewline:!0},hR=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],vo=(t,e)=>e==="ipc"?t.at(-1):t[e]});var $l,kl,ZG,gR,bbe,Y_,X_,ls=y(()=>{So();$l=({verbose:t},e)=>gR(t,e)!=="none",kl=({verbose:t},e)=>!["none","short"].includes(gR(t,e)),ZG=({verbose:t},e)=>{let r=gR(t,e);return Y_(r)?r:void 0},gR=(t,e)=>e===void 0?bbe(t):vo(t,e),bbe=t=>t.find(e=>Y_(e))??X_.findLast(e=>t.includes(e)),Y_=t=>typeof t=="function",X_=["none","short","full"]});import{platform as vbe}from"node:process";import{stripVTControlCharacters as Sbe}from"node:util";var VG,Hf,WG,wbe,xbe,$be,kbe,Ebe,Abe,Tbe,Q_=y(()=>{VG=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>Abe(WG(o))).join(" ");return{command:n,escapedCommand:i}},Hf=t=>Sbe(t).split(` -`).map(e=>WG(e)).join(` -`),WG=t=>t.replaceAll($be,e=>wbe(e)),wbe=t=>{let e=kbe[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=Ebe?`\\u${n.padStart(4,"0")}`:`\\U${n}`},xbe=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},$be=xbe(),kbe={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Ebe=65535,Abe=t=>Tbe.test(t)?t:vbe==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,Tbe=/^[\w./-]+$/});import KG from"node:process";function yR(){let{env:t}=KG,{TERM:e,TERM_PROGRAM:r}=t;return KG.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var JG=y(()=>{});var YG,XG,Obe,Rbe,Ibe,Pbe,Cbe,eb,_Qe,QG=y(()=>{JG();YG={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},XG={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Obe={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Rbe={...YG,...XG},Ibe={...YG,...Obe},Pbe=yR(),Cbe=Pbe?Rbe:Ibe,eb=Cbe,_Qe=Object.entries(XG)});import Dbe from"node:tty";var Nbe,be,SQe,eZ,wQe,xQe,$Qe,kQe,EQe,AQe,TQe,OQe,RQe,IQe,PQe,CQe,DQe,NQe,jQe,tb,MQe,FQe,LQe,zQe,UQe,qQe,BQe,HQe,GQe,tZ,ZQe,rZ,VQe,WQe,KQe,JQe,YQe,XQe,QQe,eet,tet,ret,net,_R=y(()=>{Nbe=Dbe?.WriteStream?.prototype?.hasColors?.()??!1,be=(t,e)=>{if(!Nbe)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,c=0,u=(e===22?n:"")+r;for(;s!==-1;)a+=o.slice(c,s)+u,c=s+n.length,s=o.indexOf(n,c);return a+=o.slice(c)+n,a}},SQe=be(0,0),eZ=be(1,22),wQe=be(2,22),xQe=be(3,23),$Qe=be(4,24),kQe=be(53,55),EQe=be(7,27),AQe=be(8,28),TQe=be(9,29),OQe=be(30,39),RQe=be(31,39),IQe=be(32,39),PQe=be(33,39),CQe=be(34,39),DQe=be(35,39),NQe=be(36,39),jQe=be(37,39),tb=be(90,39),MQe=be(40,49),FQe=be(41,49),LQe=be(42,49),zQe=be(43,49),UQe=be(44,49),qQe=be(45,49),BQe=be(46,49),HQe=be(47,49),GQe=be(100,49),tZ=be(91,39),ZQe=be(92,39),rZ=be(93,39),VQe=be(94,39),WQe=be(95,39),KQe=be(96,39),JQe=be(97,39),YQe=be(101,49),XQe=be(102,49),QQe=be(103,49),eet=be(104,49),tet=be(105,49),ret=be(106,49),net=be(107,49)});var nZ=y(()=>{_R();_R()});var sZ,Mbe,rb,iZ,Fbe,oZ,Lbe,aZ=y(()=>{QG();nZ();sZ=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=Mbe(r),c=Fbe[t]({failed:o,reject:s,piped:n}),l=Lbe[t]({reject:s});return`${tb(`[${a}]`)} ${tb(`[${i}]`)} ${l(c)} ${l(e)}`},Mbe=t=>`${rb(t.getHours(),2)}:${rb(t.getMinutes(),2)}:${rb(t.getSeconds(),2)}.${rb(t.getMilliseconds(),3)}`,rb=(t,e)=>String(t).padStart(e,"0"),iZ=({failed:t,reject:e})=>t?e?eb.cross:eb.warning:eb.tick,Fbe={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:iZ,duration:iZ},oZ=t=>t,Lbe={command:()=>eZ,output:()=>oZ,ipc:()=>oZ,error:({reject:t})=>t?tZ:rZ,duration:()=>tb}});var cZ,zbe,Ube,lZ=y(()=>{ls();cZ=(t,e,r)=>{let n=ZG(e,r);return t.map(({verboseLine:i,verboseObject:o})=>zbe(i,o,n)).filter(i=>i!==void 0).map(i=>Ube(i)).join("")},zbe=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},Ube=t=>t.endsWith(` +Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},hR=t=>{if(t==="all")return t;if(Tn.includes(t))return Tn.indexOf(t);let e=gbe.exec(t);if(e!==null)return Number(e[1])},gbe=/^fd(\d+)$/,ybe=(t,e)=>t.map(r=>r===void 0?bbe[e]:r),_be=ube("execa").enabled?"full":"none",bbe={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:_be,stripFinalNewline:!0},gR=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],vo=(t,e)=>e==="ipc"?t.at(-1):t[e]});var $l,kl,VG,yR,vbe,X_,Q_,ls=y(()=>{So();$l=({verbose:t},e)=>yR(t,e)!=="none",kl=({verbose:t},e)=>!["none","short"].includes(yR(t,e)),VG=({verbose:t},e)=>{let r=yR(t,e);return X_(r)?r:void 0},yR=(t,e)=>e===void 0?vbe(t):vo(t,e),vbe=t=>t.find(e=>X_(e))??Q_.findLast(e=>t.includes(e)),X_=t=>typeof t=="function",Q_=["none","short","full"]});import{platform as Sbe}from"node:process";import{stripVTControlCharacters as wbe}from"node:util";var WG,Hf,KG,xbe,$be,kbe,Ebe,Abe,Tbe,Obe,eb=y(()=>{WG=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>Tbe(KG(o))).join(" ");return{command:n,escapedCommand:i}},Hf=t=>wbe(t).split(` +`).map(e=>KG(e)).join(` +`),KG=t=>t.replaceAll(kbe,e=>xbe(e)),xbe=t=>{let e=Ebe[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=Abe?`\\u${n.padStart(4,"0")}`:`\\U${n}`},$be=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},kbe=$be(),Ebe={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Abe=65535,Tbe=t=>Obe.test(t)?t:Sbe==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,Obe=/^[\w./-]+$/});import JG from"node:process";function _R(){let{env:t}=JG,{TERM:e,TERM_PROGRAM:r}=t;return JG.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var YG=y(()=>{});var XG,QG,Rbe,Ibe,Pbe,Cbe,Dbe,tb,SQe,eZ=y(()=>{YG();XG={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},QG={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Rbe={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Ibe={...XG,...QG},Pbe={...XG,...Rbe},Cbe=_R(),Dbe=Cbe?Ibe:Pbe,tb=Dbe,SQe=Object.entries(QG)});import Nbe from"node:tty";var jbe,be,$Qe,tZ,kQe,EQe,AQe,TQe,OQe,RQe,IQe,PQe,CQe,DQe,NQe,jQe,MQe,FQe,LQe,rb,zQe,UQe,qQe,BQe,HQe,GQe,ZQe,VQe,WQe,rZ,KQe,nZ,JQe,YQe,XQe,QQe,eet,tet,ret,net,iet,oet,set,bR=y(()=>{jbe=Nbe?.WriteStream?.prototype?.hasColors?.()??!1,be=(t,e)=>{if(!jbe)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,c=0,u=(e===22?n:"")+r;for(;s!==-1;)a+=o.slice(c,s)+u,c=s+n.length,s=o.indexOf(n,c);return a+=o.slice(c)+n,a}},$Qe=be(0,0),tZ=be(1,22),kQe=be(2,22),EQe=be(3,23),AQe=be(4,24),TQe=be(53,55),OQe=be(7,27),RQe=be(8,28),IQe=be(9,29),PQe=be(30,39),CQe=be(31,39),DQe=be(32,39),NQe=be(33,39),jQe=be(34,39),MQe=be(35,39),FQe=be(36,39),LQe=be(37,39),rb=be(90,39),zQe=be(40,49),UQe=be(41,49),qQe=be(42,49),BQe=be(43,49),HQe=be(44,49),GQe=be(45,49),ZQe=be(46,49),VQe=be(47,49),WQe=be(100,49),rZ=be(91,39),KQe=be(92,39),nZ=be(93,39),JQe=be(94,39),YQe=be(95,39),XQe=be(96,39),QQe=be(97,39),eet=be(101,49),tet=be(102,49),ret=be(103,49),net=be(104,49),iet=be(105,49),oet=be(106,49),set=be(107,49)});var iZ=y(()=>{bR();bR()});var aZ,Fbe,nb,oZ,Lbe,sZ,zbe,cZ=y(()=>{eZ();iZ();aZ=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=Fbe(r),c=Lbe[t]({failed:o,reject:s,piped:n}),l=zbe[t]({reject:s});return`${rb(`[${a}]`)} ${rb(`[${i}]`)} ${l(c)} ${l(e)}`},Fbe=t=>`${nb(t.getHours(),2)}:${nb(t.getMinutes(),2)}:${nb(t.getSeconds(),2)}.${nb(t.getMilliseconds(),3)}`,nb=(t,e)=>String(t).padStart(e,"0"),oZ=({failed:t,reject:e})=>t?e?tb.cross:tb.warning:tb.tick,Lbe={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:oZ,duration:oZ},sZ=t=>t,zbe={command:()=>tZ,output:()=>sZ,ipc:()=>sZ,error:({reject:t})=>t?rZ:nZ,duration:()=>rb}});var lZ,Ube,qbe,uZ=y(()=>{ls();lZ=(t,e,r)=>{let n=VG(e,r);return t.map(({verboseLine:i,verboseObject:o})=>Ube(i,o,n)).filter(i=>i!==void 0).map(i=>qbe(i)).join("")},Ube=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},qbe=t=>t.endsWith(` `)?t:`${t} -`});import{inspect as qbe}from"node:util";var Pi,Bbe,Hbe,Gbe,nb,Zbe,El=y(()=>{Q_();aZ();lZ();Pi=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=Bbe({type:t,result:i,verboseInfo:n}),s=Hbe(e,o),a=cZ(s,n,r);a!==""&&console.warn(a.slice(0,-1))},Bbe=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:e,options:o}),Hbe=(t,e)=>t.split(` -`).map(r=>Gbe({...e,message:r})),Gbe=t=>({verboseLine:sZ(t),verboseObject:t}),nb=t=>{let e=typeof t=="string"?t:qbe(t);return Hf(e).replaceAll(" "," ".repeat(Zbe))},Zbe=2});var uZ,dZ=y(()=>{ls();El();uZ=(t,e)=>{$l(e)&&Pi({type:"command",verboseMessage:t,verboseInfo:e})}});var fZ,Vbe,Wbe,Kbe,pZ=y(()=>{ls();fZ=(t,e,r)=>{Kbe(t);let n=Vbe(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},Vbe=t=>$l({verbose:t})?Wbe++:void 0,Wbe=0n,Kbe=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!X_.includes(e)&&!Y_(e)){let r=X_.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as mZ}from"node:process";var ib,bR,ob=y(()=>{ib=()=>mZ.bigint(),bR=t=>Number(mZ.bigint()-t)/1e6});var sb,vR=y(()=>{dZ();pZ();ob();Q_();So();sb=(t,e,r)=>{let n=ib(),{command:i,escapedCommand:o}=VG(t,e),s=pR(r,"verbose"),a=fZ(s,o,{...r});return uZ(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var bZ=v((Iet,_Z)=>{_Z.exports=yZ;yZ.sync=Ybe;var hZ=Ge("fs");function Jbe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{xZ.exports=SZ;SZ.sync=Xbe;var vZ=Ge("fs");function SZ(t,e,r){vZ.stat(t,function(n,i){r(n,n?!1:wZ(i,e))})}function Xbe(t,e){return wZ(vZ.statSync(t),e)}function wZ(t,e){return t.isFile()&&Qbe(t,e)}function Qbe(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===s||r&a&&n===o||r&u&&o===0;return d}});var EZ=v((Det,kZ)=>{var Cet=Ge("fs"),ab;process.platform==="win32"||global.TESTING_WINDOWS?ab=bZ():ab=$Z();kZ.exports=SR;SR.sync=eve;function SR(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){SR(t,e||{},function(o,s){o?i(o):n(s)})})}ab(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function eve(t,e){try{return ab.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var CZ=v((Net,PZ)=>{var Al=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",AZ=Ge("path"),tve=Al?";":":",TZ=EZ(),OZ=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),RZ=(t,e)=>{let r=e.colon||tve,n=t.match(/\//)||Al&&t.match(/\\/)?[""]:[...Al?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=Al?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Al?i.split(r):[""];return Al&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},IZ=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=RZ(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(OZ(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=AZ.join(p,t),h=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;u(c(h,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let m=i[d];TZ(l+m,{pathExt:o},(h,g)=>{if(!h&&g)if(e.all)s.push(l+m);else return f(l+m);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},rve=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=RZ(t,e),o=[];for(let s=0;s{"use strict";var DZ=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};wR.exports=DZ;wR.exports.default=DZ});var LZ=v((Met,FZ)=>{"use strict";var jZ=Ge("path"),nve=CZ(),ive=NZ();function MZ(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=nve.sync(t.command,{path:r[ive({env:r})],pathExt:e?jZ.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=jZ.resolve(i?t.options.cwd:"",s)),s}function ove(t){return MZ(t)||MZ(t,!0)}FZ.exports=ove});var zZ=v((Fet,$R)=>{"use strict";var xR=/([()\][%!^"`<>&|;, *?])/g;function sve(t){return t=t.replace(xR,"^$1"),t}function ave(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(xR,"^$1"),e&&(t=t.replace(xR,"^$1")),t}$R.exports.command=sve;$R.exports.argument=ave});var qZ=v((Let,UZ)=>{"use strict";UZ.exports=/^#!(.*)/});var HZ=v((zet,BZ)=>{"use strict";var cve=qZ();BZ.exports=(t="")=>{let e=t.match(cve);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var ZZ=v((Uet,GZ)=>{"use strict";var kR=Ge("fs"),lve=HZ();function uve(t){let r=Buffer.alloc(150),n;try{n=kR.openSync(t,"r"),kR.readSync(n,r,0,150,0),kR.closeSync(n)}catch{}return lve(r.toString())}GZ.exports=uve});var JZ=v((qet,KZ)=>{"use strict";var dve=Ge("path"),VZ=LZ(),WZ=zZ(),fve=ZZ(),pve=process.platform==="win32",mve=/\.(?:com|exe)$/i,hve=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function gve(t){t.file=VZ(t);let e=t.file&&fve(t.file);return e?(t.args.unshift(t.file),t.command=e,VZ(t)):t.file}function yve(t){if(!pve)return t;let e=gve(t),r=!mve.test(e);if(t.options.forceShell||r){let n=hve.test(e);t.command=dve.normalize(t.command),t.command=WZ.command(t.command),t.args=t.args.map(o=>WZ.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function _ve(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:yve(n)}KZ.exports=_ve});var QZ=v((Bet,XZ)=>{"use strict";var ER=process.platform==="win32";function AR(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function bve(t,e){if(!ER)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=YZ(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function YZ(t,e){return ER&&t===1&&!e.file?AR(e.original,"spawn"):null}function vve(t,e){return ER&&t===1&&!e.file?AR(e.original,"spawnSync"):null}XZ.exports={hookChildProcess:bve,verifyENOENT:YZ,verifyENOENTSync:vve,notFoundError:AR}});var r9=v((Het,Tl)=>{"use strict";var e9=Ge("child_process"),TR=JZ(),OR=QZ();function t9(t,e,r){let n=TR(t,e,r),i=e9.spawn(n.command,n.args,n.options);return OR.hookChildProcess(i,n),i}function Sve(t,e,r){let n=TR(t,e,r),i=e9.spawnSync(n.command,n.args,n.options);return i.error=i.error||OR.verifyENOENTSync(i.status,n),i}Tl.exports=t9;Tl.exports.spawn=t9;Tl.exports.sync=Sve;Tl.exports._parse=TR;Tl.exports._enoent=OR});function cb(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}var n9=y(()=>{});var i9=y(()=>{});import{promisify as wve}from"node:util";import{execFile as xve,execFileSync as Ket}from"node:child_process";import o9 from"node:path";import{fileURLToPath as $ve}from"node:url";function lb(t){return t instanceof URL?$ve(t):t}function s9(t){return{*[Symbol.iterator](){let e=o9.resolve(lb(t)),r;for(;r!==e;)yield e,r=e,e=o9.resolve(e,"..")}}}var Xet,Qet,a9=y(()=>{i9();Xet=wve(xve);Qet=10*1024*1024});import ub from"node:process";import Oa from"node:path";var kve,Eve,Ave,c9,l9=y(()=>{n9();a9();kve=({cwd:t=ub.cwd(),path:e=ub.env[cb()],preferLocal:r=!0,execPath:n=ub.execPath,addExecPath:i=!0}={})=>{let o=Oa.resolve(lb(t)),s=[],a=e.split(Oa.delimiter);return r&&Eve(s,a,o),i&&Ave(s,a,n,o),e===""||e===Oa.delimiter?`${s.join(Oa.delimiter)}${e}`:[...s,e].join(Oa.delimiter)},Eve=(t,e,r)=>{for(let n of s9(r)){let i=Oa.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},Ave=(t,e,r,n)=>{let i=Oa.resolve(n,lb(r),"..");e.includes(i)||t.push(i)},c9=({env:t=ub.env,...e}={})=>{t={...t};let r=cb({env:t});return e.path=t[r],t[r]=kve(e),t}});var u9,ei,d9,f9,p9,db,Gf,Zf,Ra=y(()=>{u9=(t,e,r)=>{let n=r?Zf:Gf,i=t instanceof ei?{}:{cause:t};return new n(e,i)},ei=class extends Error{},d9=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,p9,{value:!0,writable:!1,enumerable:!1,configurable:!1})},f9=t=>db(t)&&p9 in t,p9=Symbol("isExecaError"),db=t=>Object.prototype.toString.call(t)==="[object Error]",Gf=class extends Error{};d9(Gf,Gf.name);Zf=class extends Error{};d9(Zf,Zf.name)});var m9,Tve,h9,g9,y9=y(()=>{m9=()=>{let t=g9-h9+1;return Array.from({length:t},Tve)},Tve=(t,e)=>({name:`SIGRT${e+1}`,number:h9+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),h9=34,g9=64});var _9,b9=y(()=>{_9=[{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:!0},{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:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{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"}]});import{constants as Ove}from"node:os";var RR,Rve,v9=y(()=>{b9();y9();RR=()=>{let t=m9();return[..._9,...t].map(Rve)},Rve=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=Ove,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as Ive}from"node:os";var Pve,Cve,S9,Dve,Nve,jve,gtt,w9=y(()=>{v9();Pve=()=>{let t=RR();return Object.fromEntries(t.map(Cve))},Cve=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],S9=Pve(),Dve=()=>{let t=RR(),e=65,r=Array.from({length:e},(n,i)=>Nve(i,t));return Object.assign({},...r)},Nve=(t,e)=>{let r=jve(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:c}}},jve=(t,e)=>{let r=e.find(({name:n})=>Ive.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},gtt=Dve()});import{constants as Vf}from"node:os";var $9,k9,E9,Mve,Fve,x9,Lve,IR,zve,Uve,fb,Wf=y(()=>{w9();$9=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return E9(t,e)},k9=t=>t===0?t:E9(t,"`subprocess.kill()`'s argument"),E9=(t,e)=>{if(Number.isInteger(t))return Mve(t,e);if(typeof t=="string")return Lve(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. -${IR()}`)},Mve=(t,e)=>{if(x9.has(t))return x9.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist. -${IR()}`)},Fve=()=>new Map(Object.entries(Vf.signals).reverse().map(([t,e])=>[e,t])),x9=Fve(),Lve=(t,e)=>{if(t in Vf.signals)return t;throw t.toUpperCase()in Vf.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist. -${IR()}`)},IR=()=>`Available signal names: ${zve()}. -Available signal numbers: ${Uve()}.`,zve=()=>Object.keys(Vf.signals).sort().map(t=>`'${t}'`).join(", "),Uve=()=>[...new Set(Object.values(Vf.signals).sort((t,e)=>t-e))].join(", "),fb=t=>S9[t].description});import{setTimeout as qve}from"node:timers/promises";var A9,Bve,T9,Hve,Gve,Zve,PR,pb=y(()=>{Ra();Wf();A9=t=>{if(t===!1)return t;if(t===!0)return Bve;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},Bve=1e3*5,T9=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:i,controller:o},s,a)=>{let{signal:c,error:l}=Hve(s,a,r);Gve(l,n);let u=t(c);return Zve({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:u,context:i,controller:o}),u},Hve=(t,e,r)=>{let[n=r,i]=db(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(i!==void 0&&!db(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:k9(n),error:i}},Gve=(t,e)=>{t!==void 0&&e.reject(t)},Zve=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:s})=>{e===n&&i&&PR({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal})},PR=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await qve(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}}});import{once as Vve}from"node:events";var mb,CR=y(()=>{mb=async(t,e)=>{t.aborted||await Vve(t,"abort",{signal:e})}});var O9,R9,Wve,DR=y(()=>{CR();O9=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},R9=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:i})=>e===void 0||r?[]:[Wve(t,e,n,i)],Wve=async(t,e,r,{signal:n})=>{throw await mb(e,n),r.terminationReason??="cancel",t.kill(),e.reason}});var Ol,Kve,NR,I9,P9,hb,C9,D9,N9,j9,M9,F9,Jve,Yve,Xve,ti,Qve,us,Rl,Il=y(()=>{Ol=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{Kve(t,e,r),NR(t,e,n)},Kve=(t,e,r)=>{if(!r)throw new Error(`${ti(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},NR=(t,e,r)=>{if(!r)throw new Error(`${ti(t,e)} cannot be used: the ${us(e)} has already exited or disconnected.`)},I9=t=>{throw new Error(`${ti("getOneMessage",t)} could not complete: the ${us(t)} exited or disconnected.`)},P9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} is sending a message too, instead of listening to incoming messages. +`});import{inspect as Bbe}from"node:util";var Pi,Hbe,Gbe,Zbe,ib,Vbe,El=y(()=>{eb();cZ();uZ();Pi=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=Hbe({type:t,result:i,verboseInfo:n}),s=Gbe(e,o),a=lZ(s,n,r);a!==""&&console.warn(a.slice(0,-1))},Hbe=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:e,options:o}),Gbe=(t,e)=>t.split(` +`).map(r=>Zbe({...e,message:r})),Zbe=t=>({verboseLine:aZ(t),verboseObject:t}),ib=t=>{let e=typeof t=="string"?t:Bbe(t);return Hf(e).replaceAll(" "," ".repeat(Vbe))},Vbe=2});var dZ,fZ=y(()=>{ls();El();dZ=(t,e)=>{$l(e)&&Pi({type:"command",verboseMessage:t,verboseInfo:e})}});var pZ,Wbe,Kbe,Jbe,mZ=y(()=>{ls();pZ=(t,e,r)=>{Jbe(t);let n=Wbe(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},Wbe=t=>$l({verbose:t})?Kbe++:void 0,Kbe=0n,Jbe=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Q_.includes(e)&&!X_(e)){let r=Q_.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as hZ}from"node:process";var ob,vR,sb=y(()=>{ob=()=>hZ.bigint(),vR=t=>Number(hZ.bigint()-t)/1e6});var ab,SR=y(()=>{fZ();mZ();sb();eb();So();ab=(t,e,r)=>{let n=ob(),{command:i,escapedCommand:o}=WG(t,e),s=mR(r,"verbose"),a=pZ(s,o,{...r});return dZ(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var vZ=v((Det,bZ)=>{bZ.exports=_Z;_Z.sync=Xbe;var gZ=Ge("fs");function Ybe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{$Z.exports=wZ;wZ.sync=Qbe;var SZ=Ge("fs");function wZ(t,e,r){SZ.stat(t,function(n,i){r(n,n?!1:xZ(i,e))})}function Qbe(t,e){return xZ(SZ.statSync(t),e)}function xZ(t,e){return t.isFile()&&eve(t,e)}function eve(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===s||r&a&&n===o||r&u&&o===0;return d}});var AZ=v((Met,EZ)=>{var jet=Ge("fs"),cb;process.platform==="win32"||global.TESTING_WINDOWS?cb=vZ():cb=kZ();EZ.exports=wR;wR.sync=tve;function wR(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){wR(t,e||{},function(o,s){o?i(o):n(s)})})}cb(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function tve(t,e){try{return cb.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var DZ=v((Fet,CZ)=>{var Al=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",TZ=Ge("path"),rve=Al?";":":",OZ=AZ(),RZ=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),IZ=(t,e)=>{let r=e.colon||rve,n=t.match(/\//)||Al&&t.match(/\\/)?[""]:[...Al?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=Al?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Al?i.split(r):[""];return Al&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},PZ=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=IZ(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(RZ(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=TZ.join(p,t),h=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;u(c(h,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let m=i[d];OZ(l+m,{pathExt:o},(h,g)=>{if(!h&&g)if(e.all)s.push(l+m);else return f(l+m);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},nve=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=IZ(t,e),o=[];for(let s=0;s{"use strict";var NZ=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};xR.exports=NZ;xR.exports.default=NZ});var zZ=v((zet,LZ)=>{"use strict";var MZ=Ge("path"),ive=DZ(),ove=jZ();function FZ(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=ive.sync(t.command,{path:r[ove({env:r})],pathExt:e?MZ.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=MZ.resolve(i?t.options.cwd:"",s)),s}function sve(t){return FZ(t)||FZ(t,!0)}LZ.exports=sve});var UZ=v((Uet,kR)=>{"use strict";var $R=/([()\][%!^"`<>&|;, *?])/g;function ave(t){return t=t.replace($R,"^$1"),t}function cve(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace($R,"^$1"),e&&(t=t.replace($R,"^$1")),t}kR.exports.command=ave;kR.exports.argument=cve});var BZ=v((qet,qZ)=>{"use strict";qZ.exports=/^#!(.*)/});var GZ=v((Bet,HZ)=>{"use strict";var lve=BZ();HZ.exports=(t="")=>{let e=t.match(lve);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var VZ=v((Het,ZZ)=>{"use strict";var ER=Ge("fs"),uve=GZ();function dve(t){let r=Buffer.alloc(150),n;try{n=ER.openSync(t,"r"),ER.readSync(n,r,0,150,0),ER.closeSync(n)}catch{}return uve(r.toString())}ZZ.exports=dve});var YZ=v((Get,JZ)=>{"use strict";var fve=Ge("path"),WZ=zZ(),KZ=UZ(),pve=VZ(),mve=process.platform==="win32",hve=/\.(?:com|exe)$/i,gve=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function yve(t){t.file=WZ(t);let e=t.file&&pve(t.file);return e?(t.args.unshift(t.file),t.command=e,WZ(t)):t.file}function _ve(t){if(!mve)return t;let e=yve(t),r=!hve.test(e);if(t.options.forceShell||r){let n=gve.test(e);t.command=fve.normalize(t.command),t.command=KZ.command(t.command),t.args=t.args.map(o=>KZ.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function bve(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:_ve(n)}JZ.exports=bve});var e9=v((Zet,QZ)=>{"use strict";var AR=process.platform==="win32";function TR(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function vve(t,e){if(!AR)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=XZ(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function XZ(t,e){return AR&&t===1&&!e.file?TR(e.original,"spawn"):null}function Sve(t,e){return AR&&t===1&&!e.file?TR(e.original,"spawnSync"):null}QZ.exports={hookChildProcess:vve,verifyENOENT:XZ,verifyENOENTSync:Sve,notFoundError:TR}});var n9=v((Vet,Tl)=>{"use strict";var t9=Ge("child_process"),OR=YZ(),RR=e9();function r9(t,e,r){let n=OR(t,e,r),i=t9.spawn(n.command,n.args,n.options);return RR.hookChildProcess(i,n),i}function wve(t,e,r){let n=OR(t,e,r),i=t9.spawnSync(n.command,n.args,n.options);return i.error=i.error||RR.verifyENOENTSync(i.status,n),i}Tl.exports=r9;Tl.exports.spawn=r9;Tl.exports.sync=wve;Tl.exports._parse=OR;Tl.exports._enoent=RR});function lb(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}var i9=y(()=>{});var o9=y(()=>{});import{promisify as xve}from"node:util";import{execFile as $ve,execFileSync as Xet}from"node:child_process";import s9 from"node:path";import{fileURLToPath as kve}from"node:url";function ub(t){return t instanceof URL?kve(t):t}function a9(t){return{*[Symbol.iterator](){let e=s9.resolve(ub(t)),r;for(;r!==e;)yield e,r=e,e=s9.resolve(e,"..")}}}var ttt,rtt,c9=y(()=>{o9();ttt=xve($ve);rtt=10*1024*1024});import db from"node:process";import Oa from"node:path";var Eve,Ave,Tve,l9,u9=y(()=>{i9();c9();Eve=({cwd:t=db.cwd(),path:e=db.env[lb()],preferLocal:r=!0,execPath:n=db.execPath,addExecPath:i=!0}={})=>{let o=Oa.resolve(ub(t)),s=[],a=e.split(Oa.delimiter);return r&&Ave(s,a,o),i&&Tve(s,a,n,o),e===""||e===Oa.delimiter?`${s.join(Oa.delimiter)}${e}`:[...s,e].join(Oa.delimiter)},Ave=(t,e,r)=>{for(let n of a9(r)){let i=Oa.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},Tve=(t,e,r,n)=>{let i=Oa.resolve(n,ub(r),"..");e.includes(i)||t.push(i)},l9=({env:t=db.env,...e}={})=>{t={...t};let r=lb({env:t});return e.path=t[r],t[r]=Eve(e),t}});var d9,ei,f9,p9,m9,fb,Gf,Zf,Ra=y(()=>{d9=(t,e,r)=>{let n=r?Zf:Gf,i=t instanceof ei?{}:{cause:t};return new n(e,i)},ei=class extends Error{},f9=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,m9,{value:!0,writable:!1,enumerable:!1,configurable:!1})},p9=t=>fb(t)&&m9 in t,m9=Symbol("isExecaError"),fb=t=>Object.prototype.toString.call(t)==="[object Error]",Gf=class extends Error{};f9(Gf,Gf.name);Zf=class extends Error{};f9(Zf,Zf.name)});var h9,Ove,g9,y9,_9=y(()=>{h9=()=>{let t=y9-g9+1;return Array.from({length:t},Ove)},Ove=(t,e)=>({name:`SIGRT${e+1}`,number:g9+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),g9=34,y9=64});var b9,v9=y(()=>{b9=[{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:!0},{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:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{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"}]});import{constants as Rve}from"node:os";var IR,Ive,S9=y(()=>{v9();_9();IR=()=>{let t=h9();return[...b9,...t].map(Ive)},Ive=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=Rve,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as Pve}from"node:os";var Cve,Dve,w9,Nve,jve,Mve,btt,x9=y(()=>{S9();Cve=()=>{let t=IR();return Object.fromEntries(t.map(Dve))},Dve=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],w9=Cve(),Nve=()=>{let t=IR(),e=65,r=Array.from({length:e},(n,i)=>jve(i,t));return Object.assign({},...r)},jve=(t,e)=>{let r=Mve(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:c}}},Mve=(t,e)=>{let r=e.find(({name:n})=>Pve.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},btt=Nve()});import{constants as Vf}from"node:os";var k9,E9,A9,Fve,Lve,$9,zve,PR,Uve,qve,pb,Wf=y(()=>{x9();k9=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return A9(t,e)},E9=t=>t===0?t:A9(t,"`subprocess.kill()`'s argument"),A9=(t,e)=>{if(Number.isInteger(t))return Fve(t,e);if(typeof t=="string")return zve(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. +${PR()}`)},Fve=(t,e)=>{if($9.has(t))return $9.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist. +${PR()}`)},Lve=()=>new Map(Object.entries(Vf.signals).reverse().map(([t,e])=>[e,t])),$9=Lve(),zve=(t,e)=>{if(t in Vf.signals)return t;throw t.toUpperCase()in Vf.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist. +${PR()}`)},PR=()=>`Available signal names: ${Uve()}. +Available signal numbers: ${qve()}.`,Uve=()=>Object.keys(Vf.signals).sort().map(t=>`'${t}'`).join(", "),qve=()=>[...new Set(Object.values(Vf.signals).sort((t,e)=>t-e))].join(", "),pb=t=>w9[t].description});import{setTimeout as Bve}from"node:timers/promises";var T9,Hve,O9,Gve,Zve,Vve,CR,mb=y(()=>{Ra();Wf();T9=t=>{if(t===!1)return t;if(t===!0)return Hve;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},Hve=1e3*5,O9=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:i,controller:o},s,a)=>{let{signal:c,error:l}=Gve(s,a,r);Zve(l,n);let u=t(c);return Vve({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:u,context:i,controller:o}),u},Gve=(t,e,r)=>{let[n=r,i]=fb(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(i!==void 0&&!fb(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:E9(n),error:i}},Zve=(t,e)=>{t!==void 0&&e.reject(t)},Vve=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:s})=>{e===n&&i&&CR({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal})},CR=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await Bve(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}}});import{once as Wve}from"node:events";var hb,DR=y(()=>{hb=async(t,e)=>{t.aborted||await Wve(t,"abort",{signal:e})}});var R9,I9,Kve,NR=y(()=>{DR();R9=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},I9=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:i})=>e===void 0||r?[]:[Kve(t,e,n,i)],Kve=async(t,e,r,{signal:n})=>{throw await hb(e,n),r.terminationReason??="cancel",t.kill(),e.reason}});var Ol,Jve,jR,P9,C9,gb,D9,N9,j9,M9,F9,L9,Yve,Xve,Qve,ti,eSe,us,Rl,Il=y(()=>{Ol=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{Jve(t,e,r),jR(t,e,n)},Jve=(t,e,r)=>{if(!r)throw new Error(`${ti(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},jR=(t,e,r)=>{if(!r)throw new Error(`${ti(t,e)} cannot be used: the ${us(e)} has already exited or disconnected.`)},P9=t=>{throw new Error(`${ti("getOneMessage",t)} could not complete: the ${us(t)} exited or disconnected.`)},C9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} is sending a message too, instead of listening to incoming messages. This can be fixed by both sending a message and listening to incoming messages at the same time: const [receivedMessage] = await Promise.all([ ${ti("getOneMessage",t)}, ${ti("sendMessage",t,"message, {strict: true}")}, -]);`)},hb=(t,e)=>new Error(`${ti("sendMessage",e)} failed when sending an acknowledgment response to the ${us(e)}.`,{cause:t}),C9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} is not listening to incoming messages.`)},D9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} exited without listening to incoming messages.`)},N9=()=>new Error(`\`cancelSignal\` aborted: the ${us(!0)} disconnected.`),j9=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},M9=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${ti(e,r)} cannot be used: the ${us(r)} is disconnecting.`,{cause:t})},F9=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(Jve(t))throw new Error(`${ti(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},Jve=({code:t,message:e})=>Yve.has(t)||Xve.some(r=>e.includes(r)),Yve=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Xve=["could not be cloned","circular structure","call stack size exceeded"],ti=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Qve(e)}${t}(${r})`,Qve=t=>t?"":"subprocess.",us=t=>t?"parent process":"subprocess",Rl=t=>{t.connected&&t.disconnect()}});var Ci,Pl=y(()=>{Ci=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)}});var yb,Cl,Di,L9,eSe,tSe,z9,rSe,U9,Kf,gb,ds=y(()=>{So();yb=(t,e="stdin")=>{let{options:n,fileDescriptors:i}=Di.get(t),o=L9(i,e,!0),s=t.stdio[o];if(s===null)throw new TypeError(z9(o,e,n,!0));return s},Cl=(t,e="stdout")=>{let{options:n,fileDescriptors:i}=Di.get(t),o=L9(i,e,!1),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(z9(o,e,n,!1));return s},Di=new WeakMap,L9=(t,e,r)=>{let n=eSe(e,r);return tSe(n,e,r,t),n},eSe=(t,e)=>{let r=mR(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Kf(e)}" must not be "${t}". +]);`)},gb=(t,e)=>new Error(`${ti("sendMessage",e)} failed when sending an acknowledgment response to the ${us(e)}.`,{cause:t}),D9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} is not listening to incoming messages.`)},N9=t=>{throw new Error(`${ti("sendMessage",t)} failed: the ${us(t)} exited without listening to incoming messages.`)},j9=()=>new Error(`\`cancelSignal\` aborted: the ${us(!0)} disconnected.`),M9=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},F9=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${ti(e,r)} cannot be used: the ${us(r)} is disconnecting.`,{cause:t})},L9=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(Yve(t))throw new Error(`${ti(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},Yve=({code:t,message:e})=>Xve.has(t)||Qve.some(r=>e.includes(r)),Xve=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Qve=["could not be cloned","circular structure","call stack size exceeded"],ti=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${eSe(e)}${t}(${r})`,eSe=t=>t?"":"subprocess.",us=t=>t?"parent process":"subprocess",Rl=t=>{t.connected&&t.disconnect()}});var Ci,Pl=y(()=>{Ci=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)}});var _b,Cl,Di,z9,tSe,rSe,U9,nSe,q9,Kf,yb,ds=y(()=>{So();_b=(t,e="stdin")=>{let{options:n,fileDescriptors:i}=Di.get(t),o=z9(i,e,!0),s=t.stdio[o];if(s===null)throw new TypeError(U9(o,e,n,!0));return s},Cl=(t,e="stdout")=>{let{options:n,fileDescriptors:i}=Di.get(t),o=z9(i,e,!1),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(U9(o,e,n,!1));return s},Di=new WeakMap,z9=(t,e,r)=>{let n=tSe(e,r);return rSe(n,e,r,t),n},tSe=(t,e)=>{let r=hR(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Kf(e)}" must not be "${t}". It must be ${n} or "fd3", "fd4" (and so on). -It is optional and defaults to "${i}".`)},tSe=(t,e,r,n)=>{let i=n[U9(t)];if(i===void 0)throw new TypeError(`"${Kf(r)}" must not be ${e}. That file descriptor does not exist. -Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!r)throw new TypeError(`"${Kf(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&r)throw new TypeError(`"${Kf(r)}" must not be ${e}. It must be a writable stream, not readable.`)},z9=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:o}=rSe(t,r);return`The "${i}: ${gb(o)}" option is incompatible with using "${Kf(n)}: ${gb(e)}". -Please set this option with "pipe" instead.`},rSe=(t,{stdin:e,stdout:r,stderr:n,stdio:i})=>{let o=U9(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},U9=t=>t==="all"?1:t,Kf=t=>t?"to":"from",gb=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream"});import{addAbortListener as nSe}from"node:events";var Ia,_b=y(()=>{Ia=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),nSe(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))}});var bb,jR,vb,MR,q9,B9,Jf=y(()=>{bb=(t,e)=>{e&&jR(t)},jR=t=>{t.refCounted()},vb=(t,e)=>{e&&MR(t)},MR=t=>{t.unrefCounted()},q9=(t,e)=>{e&&(MR(t),MR(t))},B9=(t,e)=>{e&&(jR(t),jR(t))}});import{once as iSe}from"node:events";import{scheduler as oSe}from"node:timers/promises";var H9,G9,Sb,Z9=y(()=>{xb();Jf();wb();$b();H9=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},i)=>{if(W9(i)||J9(i))return;Sb.has(t)||Sb.set(t,[]);let o=Sb.get(t);if(o.push(i),!(o.length>1))for(;o.length>0;){await K9(t,n,i),await oSe.yield();let s=await V9({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",s),n.emit("message:done")}},G9=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{FR();let o=Sb.get(t);for(;o?.length>0;)await iSe(n,"message:done");t.removeListener("message",i),B9(e,r),n.connected=!1,n.emit("disconnect")},Sb=new WeakMap});import{EventEmitter as sSe}from"node:events";var fs,kb,aSe,Eb,Yf=y(()=>{Z9();Jf();fs=(t,e,r)=>{if(kb.has(t))return kb.get(t);let n=new sSe;return n.connected=!0,kb.set(t,n),aSe({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},kb=new WeakMap,aSe=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let i=H9.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",i),e.once("disconnect",G9.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:i})),q9(r,n)},Eb=t=>{let e=kb.get(t);return e===void 0?t.channel!==null:e.connected}});import{once as cSe}from"node:events";var Y9,lSe,X9,V9,W9,Q9,Ab,uSe,Tb,eV,wb=y(()=>{Pl();_b();Ib();Il();Yf();xb();Y9=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:i})=>{if(!i)return n;let o=fs(t,e,r),s=Ob(t,o);return{id:lSe++,type:Tb,message:n,hasListeners:s}},lSe=0n,X9=(t,e)=>{if(!(e?.type!==Tb||e.hasListeners))for(let{id:r}of t)r!==void 0&&Ab[r].resolve({isDeadlock:!0,hasListeners:!1})},V9=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(t?.type!==Tb||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:eV,message:Ob(e,i)};try{await Rb({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return s},W9=t=>{if(t?.type!==eV)return!1;let{id:e,message:r}=t;return Ab[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},Q9=async(t,e,r)=>{if(t?.type!==Tb)return;let n=Ci();Ab[t.id]=n;let i=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([n,uSe(e,r,i)]);o&&P9(r),s||C9(r)}finally{i.abort(),delete Ab[t.id]}},Ab={},uSe=async(t,e,{signal:r})=>{Ia(t,1,r),await cSe(t,"disconnect",{signal:r}),D9(e)},Tb="execa:ipc:request",eV="execa:ipc:response"});var tV,rV,K9,Xf,Ob,dSe,xb=y(()=>{Pl();So();ds();wb();tV=(t,e,r)=>{Xf.has(t)||Xf.set(t,new Set);let n=Xf.get(t),i=Ci(),o=r?e.id:void 0,s={onMessageSent:i,id:o};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},rV=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},K9=async(t,e,r)=>{for(;!Ob(t,e)&&Xf.get(t)?.size>0;){let n=[...Xf.get(t)];X9(n,r),await Promise.all(n.map(({onMessageSent:i})=>i))}},Xf=new WeakMap,Ob=(t,e)=>e.listenerCount("message")>dSe(t),dSe=t=>Di.has(t)&&!vo(Di.get(t).options.buffer,"ipc")?1:0});import{promisify as fSe}from"node:util";var Rb,pSe,zR,mSe,LR,Ib=y(()=>{Il();xb();wb();Rb=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},i,{strict:o=!1}={})=>{let s="sendMessage";return Ol({methodName:s,isSubprocess:r,ipc:n,isConnected:t.connected}),pSe({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:i,strict:o})},pSe=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:i,strict:o})=>{let s=Y9({anyProcess:t,channel:e,isSubprocess:n,message:i,strict:o}),a=tV(t,s,o);try{await zR({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:s,message:i})}catch(c){throw Rl(t),c}finally{rV(a)}},zR=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:i})=>{let o=mSe(t);try{await Promise.all([Q9(n,t,r),o(n)])}catch(s){throw M9({error:s,methodName:e,isSubprocess:r}),F9({error:s,methodName:e,isSubprocess:r,message:i}),s}},mSe=t=>{if(LR.has(t))return LR.get(t);let e=fSe(t.send.bind(t));return LR.set(t,e),e},LR=new WeakMap});import{scheduler as hSe}from"node:timers/promises";var iV,oV,gSe,nV,J9,sV,FR,UR,$b=y(()=>{Ib();Yf();Il();iV=(t,e)=>{let r="cancelSignal";return NR(r,!1,t.connected),zR({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:sV,message:e},message:e})},oV=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await gSe({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),UR.signal),gSe=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!nV){if(nV=!0,!n){j9();return}if(e===null){FR();return}fs(t,e,r),await hSe.yield()}},nV=!1,J9=t=>t?.type!==sV?!1:(UR.abort(t.message),!0),sV="execa:ipc:cancel",FR=()=>{UR.abort(N9())},UR=new AbortController});var aV,cV,ySe,_Se,qR=y(()=>{CR();$b();pb();aV=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},cV=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[ySe({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:i,controller:o})]:[],ySe=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:i}})=>{await mb(e,i);let o=_Se(e);throw await iV(t,o),PR({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:i}),n.terminationReason??="gracefulCancel",e.reason},_Se=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e}});import{setTimeout as bSe}from"node:timers/promises";var lV,uV,vSe,BR=y(()=>{Ra();lV=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},uV=(t,e,r,n)=>e===0||e===void 0?[]:[vSe(t,e,r,n)],vSe=async(t,e,r,{signal:n})=>{throw await bSe(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new ei}});import{execPath as SSe,execArgv as wSe}from"node:process";import dV from"node:path";var fV,pV,HR=y(()=>{xl();fV=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},pV=(t,e,{node:r=!1,nodePath:n=SSe,nodeOptions:i=wSe.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=wl(n,'The "nodePath" option'),l=dV.resolve(o,c),u={...a,nodePath:l,node:r,cwd:o};if(!r)return[t,e,u];if(dV.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...i,t,...e],{ipc:!0,...u,shell:!1}]}});import{serialize as xSe}from"node:v8";var mV,$Se,kSe,ESe,hV,GR=y(()=>{mV=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");ESe[r](t)}},$Se=t=>{try{xSe(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},kSe=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},ESe={advanced:$Se,json:kSe},hV=async(t,e)=>{e!==void 0&&await t.sendMessage(e)}});var yV,ASe,on,ZR,TSe,gV,Pb,Pa=y(()=>{yV=({encoding:t})=>{if(ZR.has(t))return;let e=TSe(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Pb(t)}\`. -Please rename it to ${Pb(e)}.`);let r=[...ZR].map(n=>Pb(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Pb(t)}\`. -Please rename it to one of: ${r}.`)},ASe=new Set(["utf8","utf16le"]),on=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),ZR=new Set([...ASe,...on]),TSe=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in gV)return gV[e];if(ZR.has(e))return e},gV={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Pb=t=>typeof t=="string"?`"${t}"`:String(t)});import{statSync as OSe}from"node:fs";import RSe from"node:path";import ISe from"node:process";var _V,bV,vV,VR=y(()=>{xl();_V=(t=bV())=>{let e=wl(t,'The "cwd" option');return RSe.resolve(e)},bV=()=>{try{return ISe.cwd()}catch(t){throw t.message=`The current directory does not exist. -${t.message}`,t}},vV=(t,e)=>{if(e===bV())return t;let r;try{r=OSe(e)}catch(n){return`The "cwd" option is invalid: ${e}. +It is optional and defaults to "${i}".`)},rSe=(t,e,r,n)=>{let i=n[q9(t)];if(i===void 0)throw new TypeError(`"${Kf(r)}" must not be ${e}. That file descriptor does not exist. +Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!r)throw new TypeError(`"${Kf(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&r)throw new TypeError(`"${Kf(r)}" must not be ${e}. It must be a writable stream, not readable.`)},U9=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:o}=nSe(t,r);return`The "${i}: ${yb(o)}" option is incompatible with using "${Kf(n)}: ${yb(e)}". +Please set this option with "pipe" instead.`},nSe=(t,{stdin:e,stdout:r,stderr:n,stdio:i})=>{let o=q9(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},q9=t=>t==="all"?1:t,Kf=t=>t?"to":"from",yb=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream"});import{addAbortListener as iSe}from"node:events";var Ia,bb=y(()=>{Ia=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),iSe(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))}});var vb,MR,Sb,FR,B9,H9,Jf=y(()=>{vb=(t,e)=>{e&&MR(t)},MR=t=>{t.refCounted()},Sb=(t,e)=>{e&&FR(t)},FR=t=>{t.unrefCounted()},B9=(t,e)=>{e&&(FR(t),FR(t))},H9=(t,e)=>{e&&(MR(t),MR(t))}});import{once as oSe}from"node:events";import{scheduler as sSe}from"node:timers/promises";var G9,Z9,wb,V9=y(()=>{$b();Jf();xb();kb();G9=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},i)=>{if(K9(i)||Y9(i))return;wb.has(t)||wb.set(t,[]);let o=wb.get(t);if(o.push(i),!(o.length>1))for(;o.length>0;){await J9(t,n,i),await sSe.yield();let s=await W9({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",s),n.emit("message:done")}},Z9=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{LR();let o=wb.get(t);for(;o?.length>0;)await oSe(n,"message:done");t.removeListener("message",i),H9(e,r),n.connected=!1,n.emit("disconnect")},wb=new WeakMap});import{EventEmitter as aSe}from"node:events";var fs,Eb,cSe,Ab,Yf=y(()=>{V9();Jf();fs=(t,e,r)=>{if(Eb.has(t))return Eb.get(t);let n=new aSe;return n.connected=!0,Eb.set(t,n),cSe({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},Eb=new WeakMap,cSe=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let i=G9.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",i),e.once("disconnect",Z9.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:i})),B9(r,n)},Ab=t=>{let e=Eb.get(t);return e===void 0?t.channel!==null:e.connected}});import{once as lSe}from"node:events";var X9,uSe,Q9,W9,K9,eV,Tb,dSe,Ob,tV,xb=y(()=>{Pl();bb();Pb();Il();Yf();$b();X9=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:i})=>{if(!i)return n;let o=fs(t,e,r),s=Rb(t,o);return{id:uSe++,type:Ob,message:n,hasListeners:s}},uSe=0n,Q9=(t,e)=>{if(!(e?.type!==Ob||e.hasListeners))for(let{id:r}of t)r!==void 0&&Tb[r].resolve({isDeadlock:!0,hasListeners:!1})},W9=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(t?.type!==Ob||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:tV,message:Rb(e,i)};try{await Ib({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return s},K9=t=>{if(t?.type!==tV)return!1;let{id:e,message:r}=t;return Tb[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},eV=async(t,e,r)=>{if(t?.type!==Ob)return;let n=Ci();Tb[t.id]=n;let i=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([n,dSe(e,r,i)]);o&&C9(r),s||D9(r)}finally{i.abort(),delete Tb[t.id]}},Tb={},dSe=async(t,e,{signal:r})=>{Ia(t,1,r),await lSe(t,"disconnect",{signal:r}),N9(e)},Ob="execa:ipc:request",tV="execa:ipc:response"});var rV,nV,J9,Xf,Rb,fSe,$b=y(()=>{Pl();So();ds();xb();rV=(t,e,r)=>{Xf.has(t)||Xf.set(t,new Set);let n=Xf.get(t),i=Ci(),o=r?e.id:void 0,s={onMessageSent:i,id:o};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},nV=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},J9=async(t,e,r)=>{for(;!Rb(t,e)&&Xf.get(t)?.size>0;){let n=[...Xf.get(t)];Q9(n,r),await Promise.all(n.map(({onMessageSent:i})=>i))}},Xf=new WeakMap,Rb=(t,e)=>e.listenerCount("message")>fSe(t),fSe=t=>Di.has(t)&&!vo(Di.get(t).options.buffer,"ipc")?1:0});import{promisify as pSe}from"node:util";var Ib,mSe,UR,hSe,zR,Pb=y(()=>{Il();$b();xb();Ib=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},i,{strict:o=!1}={})=>{let s="sendMessage";return Ol({methodName:s,isSubprocess:r,ipc:n,isConnected:t.connected}),mSe({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:i,strict:o})},mSe=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:i,strict:o})=>{let s=X9({anyProcess:t,channel:e,isSubprocess:n,message:i,strict:o}),a=rV(t,s,o);try{await UR({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:s,message:i})}catch(c){throw Rl(t),c}finally{nV(a)}},UR=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:i})=>{let o=hSe(t);try{await Promise.all([eV(n,t,r),o(n)])}catch(s){throw F9({error:s,methodName:e,isSubprocess:r}),L9({error:s,methodName:e,isSubprocess:r,message:i}),s}},hSe=t=>{if(zR.has(t))return zR.get(t);let e=pSe(t.send.bind(t));return zR.set(t,e),e},zR=new WeakMap});import{scheduler as gSe}from"node:timers/promises";var oV,sV,ySe,iV,Y9,aV,LR,qR,kb=y(()=>{Pb();Yf();Il();oV=(t,e)=>{let r="cancelSignal";return jR(r,!1,t.connected),UR({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:aV,message:e},message:e})},sV=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await ySe({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),qR.signal),ySe=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!iV){if(iV=!0,!n){M9();return}if(e===null){LR();return}fs(t,e,r),await gSe.yield()}},iV=!1,Y9=t=>t?.type!==aV?!1:(qR.abort(t.message),!0),aV="execa:ipc:cancel",LR=()=>{qR.abort(j9())},qR=new AbortController});var cV,lV,_Se,bSe,BR=y(()=>{DR();kb();mb();cV=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},lV=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[_Se({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:i,controller:o})]:[],_Se=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:i}})=>{await hb(e,i);let o=bSe(e);throw await oV(t,o),CR({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:i}),n.terminationReason??="gracefulCancel",e.reason},bSe=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e}});import{setTimeout as vSe}from"node:timers/promises";var uV,dV,SSe,HR=y(()=>{Ra();uV=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},dV=(t,e,r,n)=>e===0||e===void 0?[]:[SSe(t,e,r,n)],SSe=async(t,e,r,{signal:n})=>{throw await vSe(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new ei}});import{execPath as wSe,execArgv as xSe}from"node:process";import fV from"node:path";var pV,mV,GR=y(()=>{xl();pV=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},mV=(t,e,{node:r=!1,nodePath:n=wSe,nodeOptions:i=xSe.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=wl(n,'The "nodePath" option'),l=fV.resolve(o,c),u={...a,nodePath:l,node:r,cwd:o};if(!r)return[t,e,u];if(fV.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...i,t,...e],{ipc:!0,...u,shell:!1}]}});import{serialize as $Se}from"node:v8";var hV,kSe,ESe,ASe,gV,ZR=y(()=>{hV=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");ASe[r](t)}},kSe=t=>{try{$Se(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},ESe=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},ASe={advanced:kSe,json:ESe},gV=async(t,e)=>{e!==void 0&&await t.sendMessage(e)}});var _V,TSe,on,VR,OSe,yV,Cb,Pa=y(()=>{_V=({encoding:t})=>{if(VR.has(t))return;let e=OSe(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Cb(t)}\`. +Please rename it to ${Cb(e)}.`);let r=[...VR].map(n=>Cb(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Cb(t)}\`. +Please rename it to one of: ${r}.`)},TSe=new Set(["utf8","utf16le"]),on=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),VR=new Set([...TSe,...on]),OSe=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in yV)return yV[e];if(VR.has(e))return e},yV={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Cb=t=>typeof t=="string"?`"${t}"`:String(t)});import{statSync as RSe}from"node:fs";import ISe from"node:path";import PSe from"node:process";var bV,vV,SV,WR=y(()=>{xl();bV=(t=vV())=>{let e=wl(t,'The "cwd" option');return ISe.resolve(e)},vV=()=>{try{return PSe.cwd()}catch(t){throw t.message=`The current directory does not exist. +${t.message}`,t}},SV=(t,e)=>{if(e===vV())return t;let r;try{r=RSe(e)}catch(n){return`The "cwd" option is invalid: ${e}. ${n.message} ${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}. -${t}`}});import PSe from"node:path";import SV from"node:process";var wV,Cb,CSe,DSe,WR=y(()=>{wV=St(r9(),1);l9();pb();Wf();DR();qR();BR();HR();GR();Pa();VR();xl();So();Cb=(t,e,r)=>{r.cwd=_V(r.cwd);let[n,i,o]=pV(t,e,r),{command:s,args:a,options:c}=wV.default._parse(n,i,o),l=GG(c),u=CSe(l);return lV(u),yV(u),mV(u),O9(u),aV(u),u.shell=lR(u.shell),u.env=DSe(u),u.killSignal=$9(u.killSignal),u.forceKillAfterDelay=A9(u.forceKillAfterDelay),u.lines=u.lines.map((d,f)=>d&&!on.has(u.encoding)&&u.buffer[f]),SV.platform==="win32"&&PSe.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},CSe=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m="advanced",...h})=>({...h,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),DSe=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...SV.env,...t}:t;return r||n?c9({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s}});var Db,KR=y(()=>{Db=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r]});function Dl(t){if(typeof t=="string")return NSe(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return jSe(t)}var NSe,jSe,xV,MSe,$V,FSe,JR=y(()=>{NSe=t=>t.at(-1)===xV?t.slice(0,t.at(-2)===$V?-2:-1):t,jSe=t=>t.at(-1)===MSe?t.subarray(0,t.at(-2)===FSe?-2:-1):t,xV=` -`,MSe=xV.codePointAt(0),$V="\r",FSe=$V.codePointAt(0)});function ri(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function YR(t,{checkOpen:e=!0}={}){return ri(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Ca(t,{checkOpen:e=!0}={}){return ri(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function XR(t,e){return YR(t,e)&&Ca(t,e)}var Da=y(()=>{});function kV(){return this[eI].next()}function EV(t){return this[eI].return(t)}function tI({preventCancel:t=!1}={}){let e=this.getReader(),r=new QR(e,t),n=Object.create(zSe);return n[eI]=r,n}var LSe,QR,eI,zSe,AV=y(()=>{LSe=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),QR=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#i(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},eI=Symbol();Object.defineProperty(kV,"name",{value:"next"});Object.defineProperty(EV,"name",{value:"return"});zSe=Object.create(LSe,{next:{enumerable:!0,configurable:!0,writable:!0,value:kV},return:{enumerable:!0,configurable:!0,writable:!0,value:EV}})});var TV=y(()=>{});var OV=y(()=>{AV();TV()});var RV,USe,qSe,BSe,Qf,rI=y(()=>{Da();OV();RV=t=>{if(Ca(t,{checkOpen:!1})&&Qf.on!==void 0)return qSe(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(USe.call(t)==="[object ReadableStream]")return tI.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:USe}=Object.prototype,qSe=async function*(t){let e=new AbortController,r={};BSe(t,e,r);try{for await(let[n]of Qf.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},BSe=async(t,e,r)=>{try{await Qf.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},Qf={}});var Nl,HSe,CV,IV,GSe,PV,Ni,ep=y(()=>{rI();Nl=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let l=RV(t),u=e();u.length=0;try{for await(let d of l){let f=GSe(d),p=r[f](d,u);CV({convertedChunk:p,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:c})}return HSe({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(u)}catch(d){let f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(u),f}},HSe=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let s=i(t);s!==void 0&&CV({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:o})},CV=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){IV(t,e,i,a);return}let c=n(t,o-e.length);throw c!==void 0&&IV(c,e,i,o),new Ni},IV=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},GSe=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=PV.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&PV.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:PV}=Object.prototype,Ni=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var wo,tp,Nb,jb,Mb,Fb=y(()=>{wo=t=>t,tp=()=>{},Nb=({contents:t})=>t,jb=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},Mb=t=>t.length});async function Lb(t,e){return Nl(t,KSe,e)}var ZSe,VSe,WSe,KSe,DV=y(()=>{ep();Fb();ZSe=()=>({contents:[]}),VSe=()=>1,WSe=(t,{contents:e})=>(e.push(t),e),KSe={init:ZSe,convertChunk:{string:wo,buffer:wo,arrayBuffer:wo,dataView:wo,typedArray:wo,others:wo},getSize:VSe,truncateChunk:tp,addChunk:WSe,getFinalChunk:tp,finalize:Nb}});async function zb(t,e){return Nl(t,iwe,e)}var JSe,YSe,XSe,NV,jV,QSe,ewe,twe,rwe,FV,MV,nwe,LV,iwe,zV=y(()=>{ep();Fb();JSe=()=>({contents:new ArrayBuffer(0)}),YSe=t=>XSe.encode(t),XSe=new TextEncoder,NV=t=>new Uint8Array(t),jV=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),QSe=(t,e)=>t.slice(0,e),ewe=(t,{contents:e,length:r},n)=>{let i=LV()?rwe(e,n):twe(e,n);return new Uint8Array(i).set(t,r),i},twe=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(FV(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},rwe=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:FV(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},FV=t=>MV**Math.ceil(Math.log(t)/Math.log(MV)),MV=2,nwe=({contents:t,length:e})=>LV()?t:t.slice(0,e),LV=()=>"resize"in ArrayBuffer.prototype,iwe={init:JSe,convertChunk:{string:YSe,buffer:NV,arrayBuffer:NV,dataView:jV,typedArray:jV,others:jb},getSize:Mb,truncateChunk:QSe,addChunk:ewe,getFinalChunk:tp,finalize:nwe}});async function qb(t,e){return Nl(t,lwe,e)}var owe,Ub,swe,awe,cwe,lwe,UV=y(()=>{ep();Fb();owe=()=>({contents:"",textDecoder:new TextDecoder}),Ub=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),swe=(t,{contents:e})=>e+t,awe=(t,e)=>t.slice(0,e),cwe=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},lwe={init:owe,convertChunk:{string:wo,buffer:Ub,arrayBuffer:Ub,dataView:Ub,typedArray:Ub,others:jb},getSize:Mb,truncateChunk:awe,addChunk:swe,getFinalChunk:cwe,finalize:Nb}});var qV=y(()=>{DV();zV();UV();ep()});import{on as uwe}from"node:events";import{finished as dwe}from"node:stream/promises";var Bb=y(()=>{rI();qV();Object.assign(Qf,{on:uwe,finished:dwe})});var BV,fwe,HV,GV,pwe,ZV,VV,Hb,Na=y(()=>{Bb();bo();So();BV=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{if(!(t instanceof Ni))throw t;if(o==="all")return t;let s=fwe(r,n,i);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},fwe=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",HV=(t,e,r)=>{if(e.length!==r)return;let n=new Ni;throw n.maxBufferInfo={fdNumber:"ipc"},n},GV=(t,e)=>{let{streamName:r,threshold:n,unit:i}=pwe(t,e);return`Command's ${r} was larger than ${n} ${i}`},pwe=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let i=vo(e,r);return r==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:J_(r),threshold:i,unit:n}},ZV=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>Hb(r)),VV=(t,e,r)=>{if(!e)return t;let n=Hb(r);return t.length>n?t.slice(0,n):t},Hb=([,t])=>t});import{inspect as mwe}from"node:util";var KV,hwe,gwe,ywe,_we,bwe,WV,JV=y(()=>{JR();nn();VR();Q_();Na();Wf();Ra();KV=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:b})=>{let _=n?.code,S=hwe({originalError:n,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:_,signal:i,signalDescription:o,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),x=ywe(n,b),w=x===void 0?"":` -${x}`,O=`${S}: ${a}${w}`,T=e===void 0?[t[2],t[1]]:[e],A=[O,...T,...t.slice(3),r.map(D=>_we(D)).join(` -`)].map(D=>Hf(Dl(bwe(D)))).filter(Boolean).join(` - -`);return{originalMessage:x,shortMessage:O,message:A}},hwe=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=gwe(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${GV(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${fb(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},gwe=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",ywe=(t,e)=>{if(t instanceof ei)return;let r=f9(t)?t.originalMessage:String(t?.message??t),n=Hf(vV(r,e));return n===""?void 0:n},_we=t=>typeof t=="string"?t:mwe(t),bwe=t=>Array.isArray(t)?t.map(e=>Dl(WV(e))).filter(Boolean).join(` -`):WV(t),WV=t=>typeof t=="string"?t:qt(t)?W_(t):""});var Gb,jl,rp,vwe,YV,Swe,np=y(()=>{Wf();ob();Ra();JV();Gb=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>YV({command:t,escapedCommand:e,cwd:o,durationMs:bR(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),jl=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>rp({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),rp=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:S},isSync:x})=>{let{exitCode:w,signal:O,signalDescription:T}=Swe(l,u),{originalMessage:A,shortMessage:D,message:$}=KV({stdio:d,all:f,ipcOutput:p,originalError:t,signal:O,signalDescription:T,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:S,timeout:h,cwd:_}),ie=u9(t,$,x);return Object.assign(ie,vwe({error:ie,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:O,signalDescription:T,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:A,shortMessage:D})),ie},vwe=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>YV({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:bR(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),YV=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Swe=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:fb(e);return{exitCode:r,signal:n,signalDescription:i}}});function wwe(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(XV(t*1e3)%1e3),nanoseconds:Math.trunc(XV(t*1e6)%1e3)}}function xwe(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function nI(t){switch(typeof t){case"number":{if(Number.isFinite(t))return wwe(t);break}case"bigint":return xwe(t)}throw new TypeError("Expected a finite number or bigint")}var XV,QV=y(()=>{XV=t=>Number.isFinite(t)?t:0});function iI(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+Ewe);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&$we(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+kwe(d,u):f;i.push(p)}},a=nI(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%Awe):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var $we,kwe,Ewe,Awe,eW=y(()=>{QV();$we=t=>t===0||t===0n,kwe=(t,e)=>e===1||e===1n?t:`${t}s`,Ewe=1e-7,Awe=24n*60n*60n*1000n});var tW,rW=y(()=>{El();tW=(t,e)=>{t.failed&&Pi({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var nW,Twe,iW=y(()=>{eW();ls();El();rW();nW=(t,e)=>{$l(e)&&(tW(t,e),Twe(t,e))},Twe=(t,e)=>{let r=`(done in ${iI(t.durationMs)})`;Pi({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Ml,Zb=y(()=>{iW();Ml=(t,e,{reject:r})=>{if(nW(t,e),t.failed&&r)throw t;return t}});var aW,Owe,Rwe,cW,lW,oW,Iwe,oI,sW,ja,uW,Pwe,Vb,dW,Cwe,Dwe,sI,fW,Nwe,pW,Wb,jwe,aI,Mwe,Fwe,mW,On,Kb,cI,hW,gW,ps,Sr=y(()=>{Da();yo();nn();aW=(t,e)=>ja(t)?"asyncGenerator":uW(t)?"generator":Vb(t)?"fileUrl":Cwe(t)?"filePath":jwe(t)?"webStream":ri(t,{checkOpen:!1})?"native":qt(t)?"uint8Array":Mwe(t)?"asyncIterable":Fwe(t)?"iterable":aI(t)?cW({transform:t},e):Pwe(t)?Owe(t,e):"native",Owe=(t,e)=>XR(t.transform,{checkOpen:!1})?Rwe(t,e):aI(t.transform)?cW(t,e):Iwe(t,e),Rwe=(t,e)=>(lW(t,e,"Duplex stream"),"duplex"),cW=(t,e)=>(lW(t,e,"web TransformStream"),"webTransform"),lW=({final:t,binary:e,objectMode:r},n,i)=>{oW(t,`${n}.final`,i),oW(e,`${n}.binary`,i),oI(r,`${n}.objectMode`)},oW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},Iwe=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!sW(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(XR(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(aI(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!sW(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return oI(r,`${i}.binary`),oI(n,`${i}.objectMode`),ja(t)||ja(e)?"asyncGenerator":"generator"},oI=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},sW=t=>ja(t)||uW(t),ja=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",uW=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",Pwe=t=>Ot(t)&&(t.transform!==void 0||t.final!==void 0),Vb=t=>Object.prototype.toString.call(t)==="[object URL]",dW=t=>Vb(t)&&t.protocol!=="file:",Cwe=t=>Ot(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Dwe.has(e))&&sI(t.file),Dwe=new Set(["file","append"]),sI=t=>typeof t=="string",fW=(t,e)=>t==="native"&&typeof e=="string"&&!Nwe.has(e),Nwe=new Set(["ipc","ignore","inherit","overlapped","pipe"]),pW=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Wb=t=>Object.prototype.toString.call(t)==="[object WritableStream]",jwe=t=>pW(t)||Wb(t),aI=t=>pW(t?.readable)&&Wb(t?.writable),Mwe=t=>mW(t)&&typeof t[Symbol.asyncIterator]=="function",Fwe=t=>mW(t)&&typeof t[Symbol.iterator]=="function",mW=t=>typeof t=="object"&&t!==null,On=new Set(["generator","asyncGenerator","duplex","webTransform"]),Kb=new Set(["fileUrl","filePath","fileNumber"]),cI=new Set(["fileUrl","filePath"]),hW=new Set([...cI,"webStream","nodeStream"]),gW=new Set(["webTransform","duplex"]),ps={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var lI,Lwe,zwe,yW,uI=y(()=>{Sr();lI=(t,e,r,n)=>n==="output"?Lwe(t,e,r):zwe(t,e,r),Lwe=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},zwe=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},yW=(t,e)=>{let r=t.findLast(({type:n})=>On.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var _W,Uwe,qwe,Bwe,Hwe,Gwe,Zwe,bW=y(()=>{yo();Pa();Sr();uI();_W=(t,e,r,n)=>[...t.filter(({type:i})=>!On.has(i)),...Uwe(t,e,r,n)],Uwe=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>On.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=qwe({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return Zwe(o,r)},qwe=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?Bwe({stdioItem:t,optionName:i}):e==="webTransform"?Hwe({stdioItem:t,index:r,newTransforms:n,direction:o}):Gwe({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),Bwe=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Hwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=Ot(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=lI(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},Gwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Ot(e)?e:{transform:e},d=c||on.has(o),{writableObjectMode:f,readableObjectMode:p}=lI(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Zwe=(t,e)=>e==="input"?t.reverse():t});import dI from"node:process";var vW,Vwe,Wwe,Fl,fI,SW,Kwe,Jwe,wW=y(()=>{Da();Sr();vW=(t,e,r)=>{let n=t.map(i=>Vwe(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Jwe},Vwe=({type:t,value:e},r)=>Wwe[r]??SW[t](e),Wwe=["input","output","output"],Fl=()=>{},fI=()=>"input",SW={generator:Fl,asyncGenerator:Fl,fileUrl:Fl,filePath:Fl,iterable:fI,asyncIterable:fI,uint8Array:fI,webStream:t=>Wb(t)?"output":"input",nodeStream(t){return Ca(t,{checkOpen:!1})?YR(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Fl,duplex:Fl,native(t){let e=Kwe(t);if(e!==void 0)return e;if(ri(t,{checkOpen:!1}))return SW.nodeStream(t)}},Kwe=t=>{if([0,dI.stdin].includes(t))return"input";if([1,2,dI.stdout,dI.stderr].includes(t))return"output"},Jwe="output"});var xW,$W=y(()=>{xW=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var kW,Ywe,Xwe,EW,Qwe,exe,AW=y(()=>{bo();$W();ls();kW=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Ywe(t,n).map((a,c)=>EW(a,c));return o?Qwe(s,r,i):xW(s,e)},Ywe=(t,e)=>{if(t===void 0)return Tn.map(n=>e[n]);if(Xwe(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Tn.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,Tn.length);return Array.from({length:r},(n,i)=>t[i])},Xwe=t=>Tn.some(e=>t[e]!==void 0),EW=(t,e)=>Array.isArray(t)?t.map(r=>EW(r,e)):t??(e>=Tn.length?"ignore":"pipe"),Qwe=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!kl(r,i)&&exe(n)?"ignore":n),exe=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as txe}from"node:fs";import rxe from"node:tty";var OW,nxe,ixe,oxe,sxe,TW,RW=y(()=>{Da();bo();nn();ds();OW=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?nxe({stdioItem:t,fdNumber:n,direction:i}):sxe({stdioItem:t,fdNumber:n}),nxe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=ixe({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(ri(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},ixe=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=oxe(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(rxe.isatty(i))throw new TypeError(`The \`${e}: ${gb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:_o(txe(i)),optionName:e}}},oxe=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=K_.indexOf(t);if(r!==-1)return r},sxe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:TW(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:TW(e,e,r),optionName:r}:ri(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,TW=(t,e,r)=>{let n=K_[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var IW,axe,cxe,lxe,uxe,PW=y(()=>{Da();nn();Sr();IW=({input:t,inputFile:e},r)=>r===0?[...axe(t),...lxe(e)]:[],axe=t=>t===void 0?[]:[{type:cxe(t),value:t,optionName:"input"}],cxe=t=>{if(Ca(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(qt(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},lxe=t=>t===void 0?[]:[{...uxe(t),optionName:"inputFile"}],uxe=t=>{if(Vb(t))return{type:"fileUrl",value:t};if(sI(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var CW,DW,dxe,fxe,NW,pxe,mxe,jW,MW=y(()=>{Sr();CW=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),DW=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=dxe(i,t);if(s.length!==0){if(o){fxe({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(hW.has(t))return NW({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});gW.has(t)&&mxe({otherStdioItems:s,type:t,value:e,optionName:r})}},dxe=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),fxe=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{cI.has(e)&&NW({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},NW=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>pxe(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return jW(s,n,e),i==="output"?o[0].stream:void 0},pxe=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,mxe=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);jW(i,n,e)},jW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${ps[r]} that is the same.`)}});var Jb,hxe,gxe,yxe,_xe,bxe,vxe,Sxe,wxe,xxe,$xe,kxe,pI,Exe,Yb=y(()=>{bo();bW();uI();Sr();wW();AW();RW();PW();MW();Jb=(t,e,r,n)=>{let o=kW(e,r,n).map((a,c)=>hxe({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=xxe({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>Exe(a)),s},hxe=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=J_(e),{stdioItems:o,isStdioArray:s}=gxe({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=vW(o,e,i),c=o.map(d=>OW({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=_W(c,i,a,r),u=yW(l,a);return wxe(l,u),{direction:a,objectMode:u,stdioItems:l}},gxe=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>yxe(c,n)),...IW(r,e)],s=CW(o),a=s.length>1;return _xe(s,a,n),vxe(s),{stdioItems:s,isStdioArray:a}},yxe=(t,e)=>({type:aW(t,e),value:t,optionName:e}),_xe=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(bxe.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},bxe=new Set(["ignore","ipc"]),vxe=t=>{for(let e of t)Sxe(e)},Sxe=({type:t,value:e,optionName:r})=>{if(dW(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. -For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(fW(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},wxe=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>Kb.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},xxe=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push($xe({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw pI(i),o}},$xe=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>kxe({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},kxe=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=DW({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},pI=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Qn(r)&&r.destroy()},Exe=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as FW}from"node:fs";var zW,ji,Axe,UW,LW,Txe,qW=y(()=>{nn();Yb();Sr();zW=(t,e)=>Jb(Txe,t,e,!0),ji=({type:t,optionName:e})=>{UW(e,ps[t])},Axe=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&UW(t,`"${e}"`),{}),UW=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},LW={generator(){},asyncGenerator:ji,webStream:ji,nodeStream:ji,webTransform:ji,duplex:ji,asyncIterable:ji,native:Axe},Txe={input:{...LW,fileUrl:({value:t})=>({contents:[_o(FW(t))]}),filePath:({value:{file:t}})=>({contents:[_o(FW(t))]}),fileNumber:ji,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...LW,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:ji,string:ji,uint8Array:ji}}});var xo,mI,ip=y(()=>{JR();xo=(t,{stripFinalNewline:e},r)=>mI(e,r)&&t!==void 0&&!Array.isArray(t)?Dl(t):t,mI=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var Xb,gI,BW,HW,Oxe,Rxe,Ixe,GW,Pxe,hI,Cxe,Dxe,Nxe,Qb=y(()=>{Xb=(t,e,r,n)=>t||r?void 0:HW(e,n),gI=(t,e,r)=>r?t.flatMap(n=>BW(n,e)):BW(t,e),BW=(t,e)=>{let{transform:r,final:n}=HW(e,{});return[...r(t),...n()]},HW=(t,e)=>(e.previousChunks="",{transform:Oxe.bind(void 0,e,t),final:Ixe.bind(void 0,e)}),Oxe=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o0&&(a=hI(n,a),n=""),yield a,i=o}i!==r.length-1&&(n=hI(n,r.slice(i+1))),t.previousChunks=n},Rxe=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),Ixe=function*({previousChunks:t}){t.length>0&&(yield t)},GW=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:Pxe.bind(void 0,n)},Pxe=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}=typeof e=="string"?Cxe:Nxe;if(e.at(-1)===i){yield e;return}yield o(e,t?n:r)},hI=(t,e)=>`${t}${e}`,Cxe={windowsNewline:`\r +${t}`}});import CSe from"node:path";import wV from"node:process";var xV,Db,DSe,NSe,KR=y(()=>{xV=St(n9(),1);u9();mb();Wf();NR();BR();HR();GR();ZR();Pa();WR();xl();So();Db=(t,e,r)=>{r.cwd=bV(r.cwd);let[n,i,o]=mV(t,e,r),{command:s,args:a,options:c}=xV.default._parse(n,i,o),l=ZG(c),u=DSe(l);return uV(u),_V(u),hV(u),R9(u),cV(u),u.shell=uR(u.shell),u.env=NSe(u),u.killSignal=k9(u.killSignal),u.forceKillAfterDelay=T9(u.forceKillAfterDelay),u.lines=u.lines.map((d,f)=>d&&!on.has(u.encoding)&&u.buffer[f]),wV.platform==="win32"&&CSe.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},DSe=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m="advanced",...h})=>({...h,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),NSe=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...wV.env,...t}:t;return r||n?l9({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s}});var Nb,JR=y(()=>{Nb=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r]});function Dl(t){if(typeof t=="string")return jSe(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return MSe(t)}var jSe,MSe,$V,FSe,kV,LSe,YR=y(()=>{jSe=t=>t.at(-1)===$V?t.slice(0,t.at(-2)===kV?-2:-1):t,MSe=t=>t.at(-1)===FSe?t.subarray(0,t.at(-2)===LSe?-2:-1):t,$V=` +`,FSe=$V.codePointAt(0),kV="\r",LSe=kV.codePointAt(0)});function ri(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function XR(t,{checkOpen:e=!0}={}){return ri(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Ca(t,{checkOpen:e=!0}={}){return ri(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function QR(t,e){return XR(t,e)&&Ca(t,e)}var Da=y(()=>{});function EV(){return this[tI].next()}function AV(t){return this[tI].return(t)}function rI({preventCancel:t=!1}={}){let e=this.getReader(),r=new eI(e,t),n=Object.create(USe);return n[tI]=r,n}var zSe,eI,tI,USe,TV=y(()=>{zSe=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),eI=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#i(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},tI=Symbol();Object.defineProperty(EV,"name",{value:"next"});Object.defineProperty(AV,"name",{value:"return"});USe=Object.create(zSe,{next:{enumerable:!0,configurable:!0,writable:!0,value:EV},return:{enumerable:!0,configurable:!0,writable:!0,value:AV}})});var OV=y(()=>{});var RV=y(()=>{TV();OV()});var IV,qSe,BSe,HSe,Qf,nI=y(()=>{Da();RV();IV=t=>{if(Ca(t,{checkOpen:!1})&&Qf.on!==void 0)return BSe(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(qSe.call(t)==="[object ReadableStream]")return rI.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:qSe}=Object.prototype,BSe=async function*(t){let e=new AbortController,r={};HSe(t,e,r);try{for await(let[n]of Qf.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},HSe=async(t,e,r)=>{try{await Qf.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},Qf={}});var Nl,GSe,DV,PV,ZSe,CV,Ni,ep=y(()=>{nI();Nl=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let l=IV(t),u=e();u.length=0;try{for await(let d of l){let f=ZSe(d),p=r[f](d,u);DV({convertedChunk:p,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:c})}return GSe({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(u)}catch(d){let f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(u),f}},GSe=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let s=i(t);s!==void 0&&DV({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:o})},DV=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){PV(t,e,i,a);return}let c=n(t,o-e.length);throw c!==void 0&&PV(c,e,i,o),new Ni},PV=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},ZSe=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=CV.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&CV.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:CV}=Object.prototype,Ni=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var wo,tp,jb,Mb,Fb,Lb=y(()=>{wo=t=>t,tp=()=>{},jb=({contents:t})=>t,Mb=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},Fb=t=>t.length});async function zb(t,e){return Nl(t,JSe,e)}var VSe,WSe,KSe,JSe,NV=y(()=>{ep();Lb();VSe=()=>({contents:[]}),WSe=()=>1,KSe=(t,{contents:e})=>(e.push(t),e),JSe={init:VSe,convertChunk:{string:wo,buffer:wo,arrayBuffer:wo,dataView:wo,typedArray:wo,others:wo},getSize:WSe,truncateChunk:tp,addChunk:KSe,getFinalChunk:tp,finalize:jb}});async function Ub(t,e){return Nl(t,owe,e)}var YSe,XSe,QSe,jV,MV,ewe,twe,rwe,nwe,LV,FV,iwe,zV,owe,UV=y(()=>{ep();Lb();YSe=()=>({contents:new ArrayBuffer(0)}),XSe=t=>QSe.encode(t),QSe=new TextEncoder,jV=t=>new Uint8Array(t),MV=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),ewe=(t,e)=>t.slice(0,e),twe=(t,{contents:e,length:r},n)=>{let i=zV()?nwe(e,n):rwe(e,n);return new Uint8Array(i).set(t,r),i},rwe=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(LV(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},nwe=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:LV(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},LV=t=>FV**Math.ceil(Math.log(t)/Math.log(FV)),FV=2,iwe=({contents:t,length:e})=>zV()?t:t.slice(0,e),zV=()=>"resize"in ArrayBuffer.prototype,owe={init:YSe,convertChunk:{string:XSe,buffer:jV,arrayBuffer:jV,dataView:MV,typedArray:MV,others:Mb},getSize:Fb,truncateChunk:ewe,addChunk:twe,getFinalChunk:tp,finalize:iwe}});async function Bb(t,e){return Nl(t,uwe,e)}var swe,qb,awe,cwe,lwe,uwe,qV=y(()=>{ep();Lb();swe=()=>({contents:"",textDecoder:new TextDecoder}),qb=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),awe=(t,{contents:e})=>e+t,cwe=(t,e)=>t.slice(0,e),lwe=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},uwe={init:swe,convertChunk:{string:wo,buffer:qb,arrayBuffer:qb,dataView:qb,typedArray:qb,others:Mb},getSize:Fb,truncateChunk:cwe,addChunk:awe,getFinalChunk:lwe,finalize:jb}});var BV=y(()=>{NV();UV();qV();ep()});import{on as dwe}from"node:events";import{finished as fwe}from"node:stream/promises";var Hb=y(()=>{nI();BV();Object.assign(Qf,{on:dwe,finished:fwe})});var HV,pwe,GV,ZV,mwe,VV,WV,Gb,Na=y(()=>{Hb();bo();So();HV=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{if(!(t instanceof Ni))throw t;if(o==="all")return t;let s=pwe(r,n,i);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},pwe=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",GV=(t,e,r)=>{if(e.length!==r)return;let n=new Ni;throw n.maxBufferInfo={fdNumber:"ipc"},n},ZV=(t,e)=>{let{streamName:r,threshold:n,unit:i}=mwe(t,e);return`Command's ${r} was larger than ${n} ${i}`},mwe=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let i=vo(e,r);return r==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:Y_(r),threshold:i,unit:n}},VV=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>Gb(r)),WV=(t,e,r)=>{if(!e)return t;let n=Gb(r);return t.length>n?t.slice(0,n):t},Gb=([,t])=>t});import{inspect as hwe}from"node:util";var JV,gwe,ywe,_we,bwe,vwe,KV,YV=y(()=>{YR();nn();WR();eb();Na();Wf();Ra();JV=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:b})=>{let _=n?.code,S=gwe({originalError:n,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:_,signal:i,signalDescription:o,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),x=_we(n,b),w=x===void 0?"":` +${x}`,O=`${S}: ${a}${w}`,T=e===void 0?[t[2],t[1]]:[e],A=[O,...T,...t.slice(3),r.map(D=>bwe(D)).join(` +`)].map(D=>Hf(Dl(vwe(D)))).filter(Boolean).join(` + +`);return{originalMessage:x,shortMessage:O,message:A}},gwe=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=ywe(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${ZV(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${pb(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},ywe=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",_we=(t,e)=>{if(t instanceof ei)return;let r=p9(t)?t.originalMessage:String(t?.message??t),n=Hf(SV(r,e));return n===""?void 0:n},bwe=t=>typeof t=="string"?t:hwe(t),vwe=t=>Array.isArray(t)?t.map(e=>Dl(KV(e))).filter(Boolean).join(` +`):KV(t),KV=t=>typeof t=="string"?t:qt(t)?K_(t):""});var Zb,jl,rp,Swe,XV,wwe,np=y(()=>{Wf();sb();Ra();YV();Zb=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>XV({command:t,escapedCommand:e,cwd:o,durationMs:vR(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),jl=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>rp({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),rp=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:S},isSync:x})=>{let{exitCode:w,signal:O,signalDescription:T}=wwe(l,u),{originalMessage:A,shortMessage:D,message:$}=JV({stdio:d,all:f,ipcOutput:p,originalError:t,signal:O,signalDescription:T,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:S,timeout:h,cwd:_}),ie=d9(t,$,x);return Object.assign(ie,Swe({error:ie,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:O,signalDescription:T,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:A,shortMessage:D})),ie},Swe=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>XV({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:vR(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),XV=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),wwe=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:pb(e);return{exitCode:r,signal:n,signalDescription:i}}});function xwe(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(QV(t*1e3)%1e3),nanoseconds:Math.trunc(QV(t*1e6)%1e3)}}function $we(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function iI(t){switch(typeof t){case"number":{if(Number.isFinite(t))return xwe(t);break}case"bigint":return $we(t)}throw new TypeError("Expected a finite number or bigint")}var QV,eW=y(()=>{QV=t=>Number.isFinite(t)?t:0});function oI(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+Awe);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&kwe(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+Ewe(d,u):f;i.push(p)}},a=iI(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%Twe):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var kwe,Ewe,Awe,Twe,tW=y(()=>{eW();kwe=t=>t===0||t===0n,Ewe=(t,e)=>e===1||e===1n?t:`${t}s`,Awe=1e-7,Twe=24n*60n*60n*1000n});var rW,nW=y(()=>{El();rW=(t,e)=>{t.failed&&Pi({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var iW,Owe,oW=y(()=>{tW();ls();El();nW();iW=(t,e)=>{$l(e)&&(rW(t,e),Owe(t,e))},Owe=(t,e)=>{let r=`(done in ${oI(t.durationMs)})`;Pi({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Ml,Vb=y(()=>{oW();Ml=(t,e,{reject:r})=>{if(iW(t,e),t.failed&&r)throw t;return t}});var cW,Rwe,Iwe,lW,uW,sW,Pwe,sI,aW,ja,dW,Cwe,Wb,fW,Dwe,Nwe,aI,pW,jwe,mW,Kb,Mwe,cI,Fwe,Lwe,hW,On,Jb,lI,gW,yW,ps,Sr=y(()=>{Da();yo();nn();cW=(t,e)=>ja(t)?"asyncGenerator":dW(t)?"generator":Wb(t)?"fileUrl":Dwe(t)?"filePath":Mwe(t)?"webStream":ri(t,{checkOpen:!1})?"native":qt(t)?"uint8Array":Fwe(t)?"asyncIterable":Lwe(t)?"iterable":cI(t)?lW({transform:t},e):Cwe(t)?Rwe(t,e):"native",Rwe=(t,e)=>QR(t.transform,{checkOpen:!1})?Iwe(t,e):cI(t.transform)?lW(t,e):Pwe(t,e),Iwe=(t,e)=>(uW(t,e,"Duplex stream"),"duplex"),lW=(t,e)=>(uW(t,e,"web TransformStream"),"webTransform"),uW=({final:t,binary:e,objectMode:r},n,i)=>{sW(t,`${n}.final`,i),sW(e,`${n}.binary`,i),sI(r,`${n}.objectMode`)},sW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},Pwe=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!aW(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(QR(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(cI(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!aW(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return sI(r,`${i}.binary`),sI(n,`${i}.objectMode`),ja(t)||ja(e)?"asyncGenerator":"generator"},sI=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},aW=t=>ja(t)||dW(t),ja=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",dW=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",Cwe=t=>Ot(t)&&(t.transform!==void 0||t.final!==void 0),Wb=t=>Object.prototype.toString.call(t)==="[object URL]",fW=t=>Wb(t)&&t.protocol!=="file:",Dwe=t=>Ot(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Nwe.has(e))&&aI(t.file),Nwe=new Set(["file","append"]),aI=t=>typeof t=="string",pW=(t,e)=>t==="native"&&typeof e=="string"&&!jwe.has(e),jwe=new Set(["ipc","ignore","inherit","overlapped","pipe"]),mW=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Kb=t=>Object.prototype.toString.call(t)==="[object WritableStream]",Mwe=t=>mW(t)||Kb(t),cI=t=>mW(t?.readable)&&Kb(t?.writable),Fwe=t=>hW(t)&&typeof t[Symbol.asyncIterator]=="function",Lwe=t=>hW(t)&&typeof t[Symbol.iterator]=="function",hW=t=>typeof t=="object"&&t!==null,On=new Set(["generator","asyncGenerator","duplex","webTransform"]),Jb=new Set(["fileUrl","filePath","fileNumber"]),lI=new Set(["fileUrl","filePath"]),gW=new Set([...lI,"webStream","nodeStream"]),yW=new Set(["webTransform","duplex"]),ps={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var uI,zwe,Uwe,_W,dI=y(()=>{Sr();uI=(t,e,r,n)=>n==="output"?zwe(t,e,r):Uwe(t,e,r),zwe=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},Uwe=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},_W=(t,e)=>{let r=t.findLast(({type:n})=>On.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var bW,qwe,Bwe,Hwe,Gwe,Zwe,Vwe,vW=y(()=>{yo();Pa();Sr();dI();bW=(t,e,r,n)=>[...t.filter(({type:i})=>!On.has(i)),...qwe(t,e,r,n)],qwe=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>On.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=Bwe({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return Vwe(o,r)},Bwe=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?Hwe({stdioItem:t,optionName:i}):e==="webTransform"?Gwe({stdioItem:t,index:r,newTransforms:n,direction:o}):Zwe({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),Hwe=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Gwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=Ot(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=uI(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},Zwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Ot(e)?e:{transform:e},d=c||on.has(o),{writableObjectMode:f,readableObjectMode:p}=uI(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Vwe=(t,e)=>e==="input"?t.reverse():t});import fI from"node:process";var SW,Wwe,Kwe,Fl,pI,wW,Jwe,Ywe,xW=y(()=>{Da();Sr();SW=(t,e,r)=>{let n=t.map(i=>Wwe(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Ywe},Wwe=({type:t,value:e},r)=>Kwe[r]??wW[t](e),Kwe=["input","output","output"],Fl=()=>{},pI=()=>"input",wW={generator:Fl,asyncGenerator:Fl,fileUrl:Fl,filePath:Fl,iterable:pI,asyncIterable:pI,uint8Array:pI,webStream:t=>Kb(t)?"output":"input",nodeStream(t){return Ca(t,{checkOpen:!1})?XR(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Fl,duplex:Fl,native(t){let e=Jwe(t);if(e!==void 0)return e;if(ri(t,{checkOpen:!1}))return wW.nodeStream(t)}},Jwe=t=>{if([0,fI.stdin].includes(t))return"input";if([1,2,fI.stdout,fI.stderr].includes(t))return"output"},Ywe="output"});var $W,kW=y(()=>{$W=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var EW,Xwe,Qwe,AW,exe,txe,TW=y(()=>{bo();kW();ls();EW=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Xwe(t,n).map((a,c)=>AW(a,c));return o?exe(s,r,i):$W(s,e)},Xwe=(t,e)=>{if(t===void 0)return Tn.map(n=>e[n]);if(Qwe(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Tn.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,Tn.length);return Array.from({length:r},(n,i)=>t[i])},Qwe=t=>Tn.some(e=>t[e]!==void 0),AW=(t,e)=>Array.isArray(t)?t.map(r=>AW(r,e)):t??(e>=Tn.length?"ignore":"pipe"),exe=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!kl(r,i)&&txe(n)?"ignore":n),txe=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as rxe}from"node:fs";import nxe from"node:tty";var RW,ixe,oxe,sxe,axe,OW,IW=y(()=>{Da();bo();nn();ds();RW=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?ixe({stdioItem:t,fdNumber:n,direction:i}):axe({stdioItem:t,fdNumber:n}),ixe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=oxe({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(ri(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},oxe=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=sxe(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(nxe.isatty(i))throw new TypeError(`The \`${e}: ${yb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:_o(rxe(i)),optionName:e}}},sxe=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=J_.indexOf(t);if(r!==-1)return r},axe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:OW(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:OW(e,e,r),optionName:r}:ri(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,OW=(t,e,r)=>{let n=J_[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var PW,cxe,lxe,uxe,dxe,CW=y(()=>{Da();nn();Sr();PW=({input:t,inputFile:e},r)=>r===0?[...cxe(t),...uxe(e)]:[],cxe=t=>t===void 0?[]:[{type:lxe(t),value:t,optionName:"input"}],lxe=t=>{if(Ca(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(qt(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},uxe=t=>t===void 0?[]:[{...dxe(t),optionName:"inputFile"}],dxe=t=>{if(Wb(t))return{type:"fileUrl",value:t};if(aI(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var DW,NW,fxe,pxe,jW,mxe,hxe,MW,FW=y(()=>{Sr();DW=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),NW=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=fxe(i,t);if(s.length!==0){if(o){pxe({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(gW.has(t))return jW({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});yW.has(t)&&hxe({otherStdioItems:s,type:t,value:e,optionName:r})}},fxe=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),pxe=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{lI.has(e)&&jW({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},jW=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>mxe(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return MW(s,n,e),i==="output"?o[0].stream:void 0},mxe=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,hxe=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);MW(i,n,e)},MW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${ps[r]} that is the same.`)}});var Yb,gxe,yxe,_xe,bxe,vxe,Sxe,wxe,xxe,$xe,kxe,Exe,mI,Axe,Xb=y(()=>{bo();vW();dI();Sr();xW();TW();IW();CW();FW();Yb=(t,e,r,n)=>{let o=EW(e,r,n).map((a,c)=>gxe({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=$xe({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>Axe(a)),s},gxe=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=Y_(e),{stdioItems:o,isStdioArray:s}=yxe({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=SW(o,e,i),c=o.map(d=>RW({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=bW(c,i,a,r),u=_W(l,a);return xxe(l,u),{direction:a,objectMode:u,stdioItems:l}},yxe=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>_xe(c,n)),...PW(r,e)],s=DW(o),a=s.length>1;return bxe(s,a,n),Sxe(s),{stdioItems:s,isStdioArray:a}},_xe=(t,e)=>({type:cW(t,e),value:t,optionName:e}),bxe=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(vxe.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},vxe=new Set(["ignore","ipc"]),Sxe=t=>{for(let e of t)wxe(e)},wxe=({type:t,value:e,optionName:r})=>{if(fW(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. +For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(pW(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},xxe=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>Jb.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},$xe=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push(kxe({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw mI(i),o}},kxe=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>Exe({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},Exe=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=NW({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},mI=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Qn(r)&&r.destroy()},Axe=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as LW}from"node:fs";var UW,ji,Txe,qW,zW,Oxe,BW=y(()=>{nn();Xb();Sr();UW=(t,e)=>Yb(Oxe,t,e,!0),ji=({type:t,optionName:e})=>{qW(e,ps[t])},Txe=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&qW(t,`"${e}"`),{}),qW=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},zW={generator(){},asyncGenerator:ji,webStream:ji,nodeStream:ji,webTransform:ji,duplex:ji,asyncIterable:ji,native:Txe},Oxe={input:{...zW,fileUrl:({value:t})=>({contents:[_o(LW(t))]}),filePath:({value:{file:t}})=>({contents:[_o(LW(t))]}),fileNumber:ji,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...zW,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:ji,string:ji,uint8Array:ji}}});var xo,hI,ip=y(()=>{YR();xo=(t,{stripFinalNewline:e},r)=>hI(e,r)&&t!==void 0&&!Array.isArray(t)?Dl(t):t,hI=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var Qb,yI,HW,GW,Rxe,Ixe,Pxe,ZW,Cxe,gI,Dxe,Nxe,jxe,ev=y(()=>{Qb=(t,e,r,n)=>t||r?void 0:GW(e,n),yI=(t,e,r)=>r?t.flatMap(n=>HW(n,e)):HW(t,e),HW=(t,e)=>{let{transform:r,final:n}=GW(e,{});return[...r(t),...n()]},GW=(t,e)=>(e.previousChunks="",{transform:Rxe.bind(void 0,e,t),final:Pxe.bind(void 0,e)}),Rxe=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o0&&(a=gI(n,a),n=""),yield a,i=o}i!==r.length-1&&(n=gI(n,r.slice(i+1))),t.previousChunks=n},Ixe=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),Pxe=function*({previousChunks:t}){t.length>0&&(yield t)},ZW=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:Cxe.bind(void 0,n)},Cxe=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}=typeof e=="string"?Dxe:jxe;if(e.at(-1)===i){yield e;return}yield o(e,t?n:r)},gI=(t,e)=>`${t}${e}`,Dxe={windowsNewline:`\r `,unixNewline:` `,LF:` -`,concatBytes:hI},Dxe=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},Nxe={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Dxe}});import{Buffer as jxe}from"node:buffer";var ZW,Mxe,VW,Fxe,Lxe,WW,KW=y(()=>{nn();ZW=(t,e)=>t?void 0:Mxe.bind(void 0,e),Mxe=function*(t,e){if(typeof e!="string"&&!qt(e)&&!jxe.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},VW=(t,e)=>t?Fxe.bind(void 0,e):Lxe.bind(void 0,e),Fxe=function*(t,e){WW(t,e),yield e},Lxe=function*(t,e){if(WW(t,e),typeof e!="string"&&!qt(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},WW=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`. +`,concatBytes:gI},Nxe=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},jxe={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Nxe}});import{Buffer as Mxe}from"node:buffer";var VW,Fxe,WW,Lxe,zxe,KW,JW=y(()=>{nn();VW=(t,e)=>t?void 0:Fxe.bind(void 0,e),Fxe=function*(t,e){if(typeof e!="string"&&!qt(e)&&!Mxe.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},WW=(t,e)=>t?Lxe.bind(void 0,e):zxe.bind(void 0,e),Lxe=function*(t,e){KW(t,e),yield e},zxe=function*(t,e){if(KW(t,e),typeof e!="string"&&!qt(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},KW=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`. Instead, \`yield\` should either be called with a value, or not be called at all. For example: - if (condition) { yield value; }`)}});import{Buffer as zxe}from"node:buffer";import{StringDecoder as Uxe}from"node:string_decoder";var ev,qxe,Bxe,Hxe,yI=y(()=>{nn();ev=(t,e,r)=>{if(r)return;if(t)return{transform:qxe.bind(void 0,new TextEncoder)};let n=new Uxe(e);return{transform:Bxe.bind(void 0,n),final:Hxe.bind(void 0,n)}},qxe=function*(t,e){zxe.isBuffer(e)?yield _o(e):typeof e=="string"?yield t.encode(e):yield e},Bxe=function*(t,e){yield qt(e)?t.write(e):e},Hxe=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as JW}from"node:util";var _I,tv,YW,Gxe,XW,Zxe,QW=y(()=>{_I=JW(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),tv=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Zxe}=e[r];for await(let i of n(t))yield*tv(i,e,r+1)},YW=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Gxe(r,Number(e),t)},Gxe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*tv(n,r,e+1)},XW=JW(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Zxe=function*(t){yield t}});var bI,e3,Ma,op,Vxe,Wxe,vI=y(()=>{bI=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},e3=(t,e)=>[...e.flatMap(r=>[...Ma(r,t,0)]),...op(t)],Ma=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Wxe}=e[r];for(let i of n(t))yield*Ma(i,e,r+1)},op=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Vxe(r,Number(e),t)},Vxe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ma(n,r,e+1)},Wxe=function*(t){yield t}});import{Transform as Kxe,getDefaultHighWaterMark as t3}from"node:stream";var SI,rv,r3,nv=y(()=>{Sr();Qb();KW();yI();QW();vI();SI=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=r3(t,s,o),l=ja(e),u=ja(r),d=l?_I.bind(void 0,tv,a):bI.bind(void 0,Ma),f=l||u?_I.bind(void 0,YW,a):bI.bind(void 0,op),p=l||u?XW.bind(void 0,a):void 0;return{stream:new Kxe({writableObjectMode:n,writableHighWaterMark:t3(n),readableObjectMode:i,readableHighWaterMark:t3(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},rv=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=r3(s,r,a);t=e3(c,t)}return t},r3=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:ZW(n,a)},ev(r,s,n),Xb(r,o,n,c),{transform:t,final:e},{transform:VW(i,a)},GW({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var n3,Jxe,Yxe,Xxe,Qxe,i3=y(()=>{nv();nn();Sr();n3=(t,e)=>{for(let r of Jxe(t))Yxe(t,r,e)},Jxe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Yxe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ps[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>Xxe(a,n));r.input=Bf(s)},Xxe=(t,e)=>{let r=rv(t,e,"utf8",!0);return Qxe(r),Bf(r)},Qxe=t=>{let e=t.find(r=>typeof r!="string"&&!qt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var iv,e0e,t0e,o3,s3,r0e,a3,wI=y(()=>{Pa();Sr();El();ls();iv=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&kl(r,n)&&!on.has(e)&&e0e(n)&&(t.some(({type:i,value:o})=>i==="native"&&t0e.has(o))||t.every(({type:i})=>On.has(i))),e0e=t=>t===1||t===2,t0e=new Set(["pipe","overlapped"]),o3=async(t,e,r,n)=>{for await(let i of t)r0e(e)||a3(i,r,n)},s3=(t,e,r)=>{for(let n of t)a3(n,e,r)},r0e=t=>t._readableState.pipes.length>0,a3=(t,e,r)=>{let n=nb(t);Pi({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as n0e,appendFileSync as i0e}from"node:fs";var c3,o0e,s0e,a0e,c0e,l0e,l3=y(()=>{wI();nv();Qb();nn();Sr();Na();c3=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>o0e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},o0e=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=VV(t,o,d),p=_o(f),{stdioItems:m,objectMode:h}=e[r],g=s0e([p],m,c,n),{serializedResult:b,finalResult:_=b}=a0e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});c0e({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&l0e(b,m,i),S}catch(x){return n.error=x,S}},s0e=(t,e,r,n)=>{try{return rv(t,e,r,!1)}catch(i){return n.error=i,t}},a0e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Bf(t)};let s=MG(t,r);return n[o]?{serializedResult:s,finalResult:gI(s,!i[o],e)}:{serializedResult:s}},c0e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!iv({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=gI(t,!1,s);try{s3(a,e,n)}catch(c){r.error??=c}},l0e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>Kb.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?i0e(n,t):(r.add(o),n0e(n,t))}}});var u3,d3=y(()=>{nn();ip();u3=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,xo(e,r,"all")]:Array.isArray(e)?[xo(t,r,"all"),...e]:qt(t)&&qt(e)?dR([t,e]):`${t}${e}`}});import{once as xI}from"node:events";var f3,u0e,p3,m3,d0e,$I,kI=y(()=>{Ra();f3=async(t,e)=>{let[r,n]=await u0e(t);return e.isForcefullyTerminated??=!1,[r,n]},u0e=async t=>{let[e,r]=await Promise.allSettled([xI(t,"spawn"),xI(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?p3(t):r.value},p3=async t=>{try{return await xI(t,"exit")}catch{return p3(t)}},m3=async t=>{let[e,r]=await t;if(!d0e(e,r)&&$I(e,r))throw new ei;return[e,r]},d0e=(t,e)=>t===void 0&&e===void 0,$I=(t,e)=>t!==0||e!==null});var h3,f0e,g3=y(()=>{Ra();Na();kI();h3=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=f0e(t,e,r),s=o?.code==="ETIMEDOUT",a=ZV(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},f0e=(t,e,r)=>t!==void 0?t:$I(e,r)?new ei:void 0});import{spawnSync as p0e}from"node:child_process";var y3,m0e,h0e,g0e,ov,y0e,_0e,b0e,v0e,_3=y(()=>{vR();WR();KR();np();Zb();qW();ip();i3();l3();Na();d3();g3();y3=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=m0e(t,e,r),d=y0e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Ml(d,c,l)},m0e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=sb(t,e,r),a=h0e(r),{file:c,commandArguments:l,options:u}=Cb(t,e,a);g0e(u);let d=zW(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},h0e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,g0e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&ov("ipcInput"),t&&ov("ipc: true"),r&&ov("detached: true"),n&&ov("cancelSignal")},ov=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},y0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=_0e({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=h3(c,r),{output:m,error:h=l}=c3({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>xo(_,r,S)),b=xo(u3(m,r),r,"all");return v0e({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},_0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{n3(o,r);let a=b0e(r);return p0e(...Db(t,e,a))}catch(a){return jl({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},b0e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Hb(e)}),v0e=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?Gb({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):rp({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as EI,on as S0e}from"node:events";var b3,w0e,x0e,$0e,k0e,v3=y(()=>{Il();Yf();Jf();b3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(Ol({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Eb(t)}),w0e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),w0e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{bb(e,i);let o=fs(t,e,r),s=new AbortController;try{return await Promise.race([x0e(o,n,s),$0e(o,r,s),k0e(o,r,s)])}catch(a){throw Rl(t),a}finally{s.abort(),vb(e,i)}},x0e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await EI(t,"message",{signal:r});return n}for await(let[n]of S0e(t,"message",{signal:r}))if(e(n))return n},$0e=async(t,e,{signal:r})=>{await EI(t,"disconnect",{signal:r}),I9(e)},k0e=async(t,e,{signal:r})=>{let[n]=await EI(t,"strict:error",{signal:r});throw hb(n,e)}});import{once as w3,on as E0e}from"node:events";var x3,AI,A0e,T0e,O0e,S3,TI=y(()=>{Il();Yf();Jf();x3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>AI({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),AI=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{Ol({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Eb(t)}),bb(e,o);let s=fs(t,e,r),a=new AbortController,c={};return A0e(t,s,a),T0e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),O0e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},A0e=async(t,e,r)=>{try{await w3(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},T0e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await w3(t,"strict:error",{signal:r.signal});n.error=hb(i,e),r.abort()}catch{}},O0e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of E0e(r,"message",{signal:o.signal}))S3(s),yield c}catch{S3(s)}finally{o.abort(),vb(e,a),n||Rl(t),i&&await t}},S3=({error:t})=>{if(t)throw t}});import $3 from"node:process";var k3,E3,A3,OI=y(()=>{Ib();v3();TI();$b();k3=(t,{ipc:e})=>{Object.assign(t,A3(t,!1,e))},E3=()=>{let t=$3,e=!0,r=$3.channel!==void 0;return{...A3(t,e,r),getCancelSignal:oV.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},A3=(t,e,r)=>({sendMessage:Rb.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:b3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:x3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as R0e}from"node:child_process";import{PassThrough as I0e,Readable as P0e,Writable as C0e,Duplex as D0e}from"node:stream";var T3,N0e,sp,j0e,M0e,F0e,L0e,O3=y(()=>{Yb();np();Zb();T3=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{pI(n);let a=new R0e;N0e(a,n),Object.assign(a,{readable:j0e,writable:M0e,duplex:F0e});let c=jl({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=L0e(c,s,i);return{subprocess:a,promise:l}},N0e=(t,e)=>{let r=sp(),n=sp(),i=sp(),o=Array.from({length:e.length-3},sp),s=sp(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},sp=()=>{let t=new I0e;return t.end(),t},j0e=()=>new P0e({read(){}}),M0e=()=>new C0e({write(){}}),F0e=()=>new D0e({read(){},write(){}}),L0e=async(t,e,r)=>Ml(t,e,r)});import{createReadStream as R3,createWriteStream as I3}from"node:fs";import{Buffer as z0e}from"node:buffer";import{Readable as ap,Writable as U0e,Duplex as q0e}from"node:stream";var C3,cp,P3,B0e,D3=y(()=>{nv();Yb();Sr();C3=(t,e)=>Jb(B0e,t,e,!1),cp=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ps[t]}.`)},P3={fileNumber:cp,generator:SI,asyncGenerator:SI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:q0e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},B0e={input:{...P3,fileUrl:({value:t})=>({stream:R3(t)}),filePath:({value:{file:t}})=>({stream:R3(t)}),webStream:({value:t})=>({stream:ap.fromWeb(t)}),iterable:({value:t})=>({stream:ap.from(t)}),asyncIterable:({value:t})=>({stream:ap.from(t)}),string:({value:t})=>({stream:ap.from(t)}),uint8Array:({value:t})=>({stream:ap.from(z0e.from(t))})},output:{...P3,fileUrl:({value:t})=>({stream:I3(t)}),filePath:({value:{file:t,append:e}})=>({stream:I3(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:U0e.fromWeb(t)}),iterable:cp,asyncIterable:cp,string:cp,uint8Array:cp}}});import{on as H0e,once as N3}from"node:events";import{PassThrough as G0e,getDefaultHighWaterMark as Z0e}from"node:stream";import{finished as F3}from"node:stream/promises";function Fa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)II(i);let e=t.some(({readableObjectMode:i})=>i),r=V0e(t,e),n=new RI({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var V0e,RI,W0e,K0e,J0e,II,Y0e,X0e,Q0e,e$e,t$e,L3,z3,PI,U3,r$e,sv,j3,M3,av=y(()=>{V0e=(t,e)=>{if(t.length===0)return Z0e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},RI=class extends G0e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(II(e),this.#t.has(e))return;this.#t.add(e),this.#n??=W0e(this,this.#t,this.#o);let r=Y0e({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(II(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},W0e=async(t,e,r)=>{sv(t,j3);let n=new AbortController;try{await Promise.race([K0e(t,n),J0e(t,e,r,n)])}finally{n.abort(),sv(t,-j3)}},K0e=async(t,{signal:e})=>{try{await F3(t,{signal:e,cleanup:!0})}catch(r){throw L3(t,r),r}},J0e=async(t,e,r,{signal:n})=>{for await(let[i]of H0e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},II=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Y0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{sv(t,M3);let a=new AbortController;try{await Promise.race([X0e(o,e,a),Q0e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),e$e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),sv(t,-M3)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?PI(t):t$e(t))},X0e=async(t,e,{signal:r})=>{try{await t,r.aborted||PI(e)}catch(n){r.aborted||L3(e,n)}},Q0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await F3(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;z3(s)?i.add(e):U3(t,s)}},e$e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await N3(t,i,{signal:o}),!t.readable)return N3(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},t$e=t=>{t.writable&&t.end()},L3=(t,e)=>{z3(e)?PI(t):U3(t,e)},z3=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",PI=t=>{(t.readable||t.writable)&&t.destroy()},U3=(t,e)=>{t.destroyed||(t.once("error",r$e),t.destroy(e))},r$e=()=>{},sv=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},j3=2,M3=1});import{finished as q3}from"node:stream/promises";var Ll,n$e,CI,i$e,DI,cv=y(()=>{bo();Ll=(t,e)=>{t.pipe(e),n$e(t,e),i$e(t,e)},n$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await q3(t,{cleanup:!0,readable:!0,writable:!1})}catch{}CI(e)}},CI=t=>{t.writable&&t.end()},i$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await q3(e,{cleanup:!0,readable:!1,writable:!0})}catch{}DI(t)}},DI=t=>{t.readable&&t.destroy()}});var B3,o$e,s$e,a$e,c$e,l$e,H3=y(()=>{av();bo();_b();Sr();cv();B3=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>On.has(c)))o$e(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!On.has(c)))a$e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Fa(o);Ll(s,i)}},o$e=(t,e,r,n)=>{r==="output"?Ll(t.stdio[n],e):Ll(e,t.stdio[n]);let i=s$e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},s$e=["stdin","stdout","stderr"],a$e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;c$e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},c$e=(t,{signal:e})=>{Qn(t)&&Ia(t,l$e,e)},l$e=2});var La,G3=y(()=>{La=[];La.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&La.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&La.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var lv,NI,jI,u$e,MI,uv,d$e,FI,LI,zI,Z3,Qst,eat,V3=y(()=>{G3();lv=t=>!!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",NI=Symbol.for("signal-exit emitter"),jI=globalThis,u$e=Object.defineProperty.bind(Object),MI=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(jI[NI])return jI[NI];u$e(jI,NI,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},uv=class{},d$e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),FI=class extends uv{onExit(){return()=>{}}load(){}unload(){}},LI=class extends uv{#t=zI.platform==="win32"?"SIGINT":"SIGHUP";#r=new MI;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of La)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!lv(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of La)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,La.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return lv(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&lv(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},zI=globalThis.process,{onExit:Z3,load:Qst,unload:eat}=d$e(lv(zI)?new LI(zI):new FI)});import{addAbortListener as f$e}from"node:events";var W3,K3=y(()=>{V3();W3=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=Z3(()=>{t.kill()});f$e(n,()=>{i()})}});var Y3,p$e,m$e,J3,h$e,X3=y(()=>{uR();ob();ds();xl();Y3=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=ib(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=p$e(r,n,i),{sourceStream:d,sourceError:f}=h$e(t,l),{options:p,fileDescriptors:m}=Di.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},p$e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=m$e(t,e,...r),a=yb(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},m$e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(J3,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||cR(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=V_(r,...n);return{destination:e(J3)(i,o,s),pipeOptions:s}}if(Di.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},J3=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),h$e=(t,e)=>{try{return{sourceStream:Cl(t,e)}}catch(r){return{sourceError:r}}}});var eK,g$e,UI,Q3,qI=y(()=>{np();cv();eK=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=g$e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw UI({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},g$e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return DI(t),n;if(e!==void 0)return CI(r),e},UI=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>jl({error:t,command:Q3,escapedCommand:Q3,fileDescriptors:e,options:r,startTime:n,isSync:!1}),Q3="source.pipe(destination)"});var tK,rK=y(()=>{tK=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as y$e}from"node:stream/promises";var nK,_$e,b$e,v$e,dv,S$e,w$e,iK=y(()=>{av();_b();cv();nK=(t,e,r)=>{let n=dv.has(e)?b$e(t,e):_$e(t,e);return Ia(t,S$e,r.signal),Ia(e,w$e,r.signal),v$e(e),n},_$e=(t,e)=>{let r=Fa([t]);return Ll(r,e),dv.set(e,r),r},b$e=(t,e)=>{let r=dv.get(e);return r.add(t),r},v$e=async t=>{try{await y$e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}dv.delete(t)},dv=new WeakMap,S$e=2,w$e=1});import{aborted as x$e}from"node:util";var oK,$$e,sK=y(()=>{qI();oK=(t,e)=>t===void 0?[]:[$$e(t,e)],$$e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await x$e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw UI({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var fv,k$e,E$e,aK=y(()=>{yo();X3();qI();rK();iK();sK();fv=(t,...e)=>{if(Ot(e[0]))return fv.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Y3(t,...e),i=k$e({...n,destination:r});return i.pipe=fv.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},k$e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=E$e(t,i);eK({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=nK(e,o,d);return await Promise.race([tK(u),...oK(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},E$e=(t,e)=>Promise.allSettled([t,e])});import{on as A$e}from"node:events";import{getDefaultHighWaterMark as T$e}from"node:stream";var pv,O$e,BI,R$e,lK,HI,cK,I$e,P$e,mv=y(()=>{yI();Qb();vI();pv=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return O$e(e,s),lK({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},O$e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},BI=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;R$e(e,s,t);let a=t.readableObjectMode&&!o;return lK({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},R$e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},lK=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=A$e(t,"data",{signal:e.signal,highWaterMark:cK,highWatermark:cK});return I$e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},HI=T$e(!0),cK=HI,I$e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=P$e({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ma(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*op(a)}},P$e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[ev(t,r,!e),Xb(t,i,!n,{})].filter(Boolean)});import{setImmediate as C$e}from"node:timers/promises";var uK,D$e,N$e,j$e,GI,dK,ZI=y(()=>{Bb();nn();wI();mv();Na();ip();uK=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=D$e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([N$e(t),d]);return}let f=mI(c,r),p=BI({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([j$e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},D$e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!iv({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=BI({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await o3(a,t,r,o)},N$e=async t=>{await C$e(),t.readableFlowing===null&&t.resume()},j$e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await Lb(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await zb(r,{maxBuffer:o})):await qb(r,{maxBuffer:o})}catch(a){return dK(BV({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},GI=async t=>{try{return await t}catch(e){return dK(e)}},dK=({bufferedData:t})=>NG(t)?new Uint8Array(t):t});import{finished as M$e}from"node:stream/promises";var lp,F$e,L$e,z$e,U$e,q$e,VI,hv,fK,gv=y(()=>{lp=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=F$e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],M$e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||U$e(a,e,r,n)}finally{s.abort()}},F$e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&L$e(t,r,n),n},L$e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{z$e(e,r),n.call(t,...i)}},z$e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},U$e=(t,e,r,n)=>{if(!q$e(t,e,r,n))throw t},q$e=(t,e,r,n=!0)=>r.propagating?fK(t)||hv(t):(r.propagating=!0,VI(r,e)===n?fK(t):hv(t)),VI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",hv=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",fK=t=>t?.code==="EPIPE"});var pK,WI,KI=y(()=>{ZI();gv();pK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>WI({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),WI=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=lp(t,e,l);if(VI(l,e)){await u;return}let[d]=await Promise.all([uK({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var mK,hK,B$e,H$e,JI=y(()=>{av();KI();mK=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Fa([t,e].filter(Boolean)):void 0,hK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>WI({...B$e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:H$e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),B$e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},H$e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var gK,yK,_K=y(()=>{El();ls();gK=t=>kl(t,"ipc"),yK=(t,e)=>{let r=nb(t);Pi({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var bK,vK,SK=y(()=>{Na();_K();So();TI();bK=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=gK(o),a=vo(e,"ipc"),c=vo(r,"ipc");for await(let l of AI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(HV(t,i,c),i.push(l)),s&&yK(l,o);return i},vK=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as G$e}from"node:events";var wK,Z$e,V$e,W$e,xK=y(()=>{Da();BR();DR();qR();bo();Sr();ZI();SK();GR();JI();KI();kI();gv();wK=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:b})=>{let _=f3(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=pK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=hK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),O=[],T=bK({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),A=Z$e(h,t,S),D=V$e(m,S);try{return await Promise.race([Promise.all([{},m3(_),Promise.all(x),w,T,hV(t,d),...A,...D]),g,W$e(t,b),...uV(t,o,f,b),...R9({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...cV({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch($){return f.terminationReason??="other",Promise.all([{error:$},_,Promise.all(x.map(ie=>GI(ie))),GI(w),vK(T,O),Promise.allSettled(A),Promise.allSettled(D)])}},Z$e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:lp(n,i,r)),V$e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>ri(o,{checkOpen:!1})&&!Qn(o)).map(({type:i,value:o,stream:s=o})=>lp(s,n,e,{isSameDirection:On.has(i),stopOnExit:i==="native"}))),W$e=async(t,{signal:e})=>{let[r]=await G$e(t,"error",{signal:e});throw r}});var $K,up,zl,yv=y(()=>{Pl();$K=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),up=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Ci();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},zl=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as kK}from"node:stream/promises";var YI,EK,XI,QI,_v,bv,eP=y(()=>{gv();YI=async t=>{if(t!==void 0)try{await XI(t)}catch{}},EK=async t=>{if(t!==void 0)try{await QI(t)}catch{}},XI=async t=>{await kK(t,{cleanup:!0,readable:!1,writable:!0})},QI=async t=>{await kK(t,{cleanup:!0,readable:!0,writable:!1})},_v=async(t,e)=>{if(await t,e)throw e},bv=(t,e,r)=>{r&&!hv(r)?t.destroy(r):e&&t.destroy()}});import{Readable as K$e}from"node:stream";import{callbackify as J$e}from"node:util";var AK,tP,rP,nP,Y$e,iP,oP,TK,sP=y(()=>{Pa();ds();mv();Pl();yv();eP();AK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||on.has(r),{subprocessStdout:a,waitReadableDestroy:c}=tP(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=rP(a,s),{read:f,onStdoutDataDone:p}=nP({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new K$e({read:f,destroy:J$e(oP.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return iP({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},tP=(t,e,r)=>{let n=Cl(t,e),i=up(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},rP=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:HI},nP=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Ci(),s=pv({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){Y$e(this,s,o)},onStdoutDataDone:o}},Y$e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},iP=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await QI(t),await n,await YI(i),await e,r.readable&&r.push(null)}catch(o){await YI(i),TK(r,o)}},oP=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await zl(r,e)&&(TK(t,n),await _v(e,n))},TK=(t,e)=>{bv(t,t.readable,e)}});import{Writable as X$e}from"node:stream";import{callbackify as OK}from"node:util";var RK,aP,cP,Q$e,eke,lP,uP,IK,dP=y(()=>{ds();yv();eP();RK=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=aP(t,r,e),s=new X$e({...cP(n,t,i),destroy:OK(uP.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return lP(n,s),s},aP=(t,e,r)=>{let n=yb(t,e),i=up(r,n,"writableFinal"),o=up(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},cP=(t,e,r)=>({write:Q$e.bind(void 0,t),final:OK(eke.bind(void 0,t,e,r))}),Q$e=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},eke=async(t,e,r)=>{await zl(r,e)&&(t.writable&&t.end(),await e)},lP=async(t,e,r)=>{try{await XI(t),e.writable&&e.end()}catch(n){await EK(r),IK(e,n)}},uP=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await zl(r,e),await zl(n,e)&&(IK(t,i),await _v(e,i))},IK=(t,e)=>{bv(t,t.writable,e)}});import{Duplex as tke}from"node:stream";import{callbackify as rke}from"node:util";var PK,nke,CK=y(()=>{Pa();sP();dP();PK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||on.has(r),{subprocessStdout:c,waitReadableDestroy:l}=tP(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=aP(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=rP(c,a),{read:g,onStdoutDataDone:b}=nP({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new tke({read:g,...cP(u,t,d),destroy:rke(nke.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return iP({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),lP(u,_,c),_},nke=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([oP({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),uP({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var fP,ike,DK=y(()=>{Pa();ds();mv();fP=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||on.has(e),s=Cl(t,r),a=pv({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return ike(a,s,t)},ike=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var NK,jK=y(()=>{yv();sP();dP();CK();DK();NK=(t,{encoding:e})=>{let r=$K();t.readable=AK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=RK.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=PK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=fP.bind(void 0,t,e),t[Symbol.asyncIterator]=fP.bind(void 0,t,e,{})}});var MK,oke,ske,FK=y(()=>{MK=(t,e)=>{for(let[r,n]of ske){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},oke=(async()=>{})().constructor.prototype,ske=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(oke,t)])});import{setMaxListeners as ake}from"node:events";import{spawn as cke}from"node:child_process";var LK,lke,uke,dke,fke,pke,zK=y(()=>{Bb();vR();WR();ds();KR();OI();np();Zb();O3();D3();ip();H3();pb();K3();aK();JI();xK();jK();Pl();FK();LK=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=lke(t,e,r),{subprocess:f,promise:p}=dke({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=fv.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),MK(f,p),Di.set(f,{options:u,fileDescriptors:d}),f},lke=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=sb(t,e,r),{file:a,commandArguments:c,options:l}=Cb(t,e,r),u=uke(l),d=C3(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},uke=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},dke=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=cke(...Db(t,e,r))}catch(m){return T3({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;ake(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];B3(c,a,l),W3(c,r,l);let d={},f=Ci();c.kill=T9.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=mK(c,r),NK(c,r),k3(c,r);let p=fke({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},fke=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await wK({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map((x,w)=>xo(x,e,w)),_=xo(h,e,"all"),S=pke({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Ml(S,n,e)},pke=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?rp({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Ni,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):Gb({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var vv,mke,hke,UK=y(()=>{yo();So();vv=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,mke(n,t[n],i)]));return{...t,...r}},mke=(t,e,r)=>hke.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,hke=new Set(["env",...hR])});var ms,gke,yke,qK=y(()=>{yo();uR();BG();_3();zK();UK();ms=(t,e,r,n)=>{let i=(s,a,c)=>ms(s,a,r,c),o=(...s)=>gke({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},gke=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Ot(o))return i(t,vv(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=yke({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?y3(a,c,l):LK(a,c,l,i)},yke=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=UG(e)?qG(e,r):[e,...r],[s,a,c]=V_(...o),l=vv(vv(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var BK,HK,GK,_ke,bke,ZK=y(()=>{BK=({file:t,commandArguments:e})=>GK(t,e),HK=({file:t,commandArguments:e})=>({...GK(t,e),isSync:!0}),GK=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=_ke(t);return{file:r,commandArguments:n}},_ke=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(bke)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},bke=/ +/g});var VK,WK,vke,KK,Ske,JK,YK=y(()=>{VK=(t,e,r)=>{t.sync=e(vke,r),t.s=t.sync},WK=({options:t})=>KK(t),vke=({options:t})=>({...KK(t),isSync:!0}),KK=t=>({options:{...Ske(t),...t}}),Ske=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},JK={preferLocal:!0}});var Blt,We,Hlt,Glt,Zlt,Vlt,Wlt,Klt,Jlt,Ylt,Mr=y(()=>{qK();ZK();HR();YK();OI();Blt=ms(()=>({})),We=ms(()=>({isSync:!0})),Hlt=ms(BK),Glt=ms(HK),Zlt=ms(fV),Vlt=ms(WK,{},JK,VK),{sendMessage:Wlt,getOneMessage:Klt,getEachMessage:Jlt,getCancelSignal:Ylt}=E3()});import{existsSync as Sv,statSync as wke}from"node:fs";import{dirname as pP,extname as xke,isAbsolute as XK,join as mP,relative as hP,resolve as wv,sep as $ke}from"node:path";function xv(t){return t==="./gradlew"||t==="gradle"}function kke(t){return(Sv(mP(t,"build.gradle.kts"))||Sv(mP(t,"build.gradle")))&&Sv(mP(t,"gradle.properties"))}function Eke(t,e){let n=hP(t,e).split($ke).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function hs(t,e){return t===":"?`:${e}`:`${t}:${e}`}function Ake(t,e){let r=wv(t,e),n=r;Sv(r)?wke(r).isFile()&&(n=pP(r)):xke(r)!==""&&(n=pP(r));let i=hP(t,n);if(i.startsWith("..")||XK(i))return null;let o=n;for(;;){if(kke(o))return o;if(wv(o)===wv(t))return null;let s=pP(o);if(s===o)return null;let a=hP(t,s);if(a.startsWith("..")||XK(a))return null;o=s}}function $v(t,e){let r=wv(t),n=new Map,i=[];for(let o of e){let s=Ake(r,o);if(!s){i.push(o);continue}let a=Eke(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var kv=y(()=>{"use strict"});import{existsSync as yP,readFileSync as Tke}from"node:fs";import{join as Ul}from"node:path";function ql(t="."){let e=Ul(t,".cladding","config.yaml");if(!yP(e))return gP;try{let n=(0,QK.parse)(Tke(e,"utf8"))?.gate;if(!n)return gP;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of Oke){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return gP}}function eJ(t="."){let e=ql(t).testReport,r=e?[e,..._P]:_P;return[...new Set(r.map(n=>Ul(t,n)))]}function tJ(t="."){let e=ql(t).testReport;if(e){let r=Ul(t,e);return yP(r)?r:null}return _P.map(r=>Ul(t,r)).find(r=>yP(r))??null}function rJ(t,e){let r=[],n=!1;for(let i of t){let o=Rke.exec(i);if(o){n=!0;for(let s of e)r.push(hs(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var QK,Oke,gP,_P,Rke,dp=y(()=>{"use strict";QK=St(er(),1);kv();Oke=["type","lint","test","coverage"],gP={scope:"feature"},_P=["test-report.junit.xml",Ul("coverage","junit.xml"),Ul(".cladding","test-report.junit.xml")];Rke=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as vP,readFileSync as nJ,readdirSync as Ike,statSync as Pke}from"node:fs";import{join as Ev}from"node:path";function xP(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=Ev(t,e);if(vP(r))try{if(iJ.test(nJ(r,"utf8")))return!0}catch{}}return!1}function oJ(t){try{return vP(t)&&iJ.test(nJ(t,"utf8"))}catch{return!1}}function sJ(t,e=0){if(e>4||!vP(t))return!1;let r;try{r=Ike(t)}catch{return!1}for(let n of r){let i=Ev(t,n),o=!1;try{o=Pke(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(sJ(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&oJ(i))return!0}return!1}function Nke(t){if(xP(t))return!0;for(let e of Cke)if(oJ(Ev(t,e)))return!0;for(let e of Dke)if(sJ(Ev(t,e)))return!0;return!1}function aJ(t="."){let e=ql(t).coverage;return e||(Nke(t)?"kover":"jacoco")}function cJ(t="."){return SP[aJ(t)]}function lJ(t="."){return bP[aJ(t)]}var SP,bP,wP,iJ,Cke,Dke,Av=y(()=>{"use strict";dp();SP={kover:"koverXmlReport",jacoco:"jacocoTestReport"},bP={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},wP=[bP.kover,bP.jacoco],iJ=/kover/i;Cke=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],Dke=["buildSrc","build-logic"]});import{existsSync as pp,readFileSync as dJ,readdirSync as fJ}from"node:fs";import{join as gs}from"node:path";function kP(t){return pp(gs(t,"gradlew"))?"./gradlew":"gradle"}function jke(t){let e=kP(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[cJ(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function Mke(t){let e=!1;try{e=/(^|\n)\s*flutter\s*:|sdk:\s*flutter/.test(dJ(gs(t,"pubspec.yaml"),"utf8"))}catch{}let r={cmd:"dart",args:["format","--output=none","--set-exit-if-changed","."]},n={cmd:"gitleaks",args:["detect","--no-banner"]};return e?{type:{cmd:"flutter",args:["analyze"]},lint:r,test:{cmd:"flutter",args:["test"]},coverage:{cmd:"flutter",args:["test","--coverage"]},secret:n}:{type:{cmd:"dart",args:["analyze"]},lint:r,test:{cmd:"dart",args:["test"]},coverage:{cmd:"dart",args:["test","--coverage=coverage"]},secret:n}}function Lke(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function qke(t,e){for(let r of e)if(pp(gs(t,r)))return r}function Bke(t,e){try{return fJ(t).find(n=>n.endsWith(e))}catch{return}}function Zke(t){try{return JSON.parse(dJ(gs(t,"package.json"),"utf8"))}catch{return{}}}function fp(t,e){let r=t.scripts?.[e];return typeof r=="string"&&r.trim().length>0?r.trim():void 0}function uJ(t,e){return[t.dependencies,t.devDependencies,t.optionalDependencies,t.peerDependencies].some(r=>r?.[e]!==void 0)}function Vke(t,e,r){if(fp(r,"lint"))return{cmd:"npm",args:["run","--silent","lint"]};for(let n of Hke)if(n.configs.some(i=>pp(gs(t,i))))return n.gate;if(Gke.some(n=>pp(gs(t,n)))||r.eslintConfig!==void 0)return e}function Kke(t,e){return Wke.some(r=>pp(gs(t,r)))?!0:e.jest!==void 0}function Jke(t){if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?vitest(?:\s+run)?$/i.test(t))return"vitest";if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?jest$/i.test(t))return"jest"}function $P(t,e){let r={...t};return e==="lint"?delete r.lint:delete r.coverage,r}function Yke(t,e){let r=Zke(t),n=e.lint?Vke(t,e.lint,r):void 0,i=n?{...e,lint:n}:$P(e,"lint"),o=fp(r,"test"),s=o?Jke(o):void 0;return o&&!s?(i=$P(i,"coverage"),{...i,test:{cmd:"npm",args:["test"]},...fp(r,"coverage")?{coverage:{cmd:"npm",args:["run","--silent","coverage"]}}:{}}):s==="jest"||!o&&Kke(t,r)?{...i,test:{cmd:"npx",args:[...Mi,"jest"]},coverage:{cmd:"npx",args:[...Mi,"jest","--coverage"]}}:(s==="vitest"&&!fp(r,"coverage")&&!uJ(r,"@vitest/coverage-v8")&&!uJ(r,"@vitest/coverage-istanbul")?i=$P(i,"coverage"):s==="vitest"&&fp(r,"coverage")&&(i={...i,coverage:{cmd:"npm",args:["run","--silent","coverage"]}}),i)}function dt(t="."){for(let e of zke){let r;for(let o of e.manifests)if(o.startsWith(".")?r=Bke(t,o):r=qke(t,[o]),r)break;if(!r||e.requiresSource&&!Lke(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"?Yke(t,n):n;return{language:e.language,manifest:r,gates:i}}return Uke}var Mi,Fke,zke,Uke,Hke,Gke,Wke,sn=y(()=>{"use strict";Av();Mi=["--offline","--no-install"];Fke=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);zke=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:[...Mi,"tsc","--noEmit"]},lint:{cmd:"npx",args:[...Mi,"eslint","."]},test:{cmd:"npx",args:[...Mi,"vitest","run"]},coverage:{cmd:"npx",args:[...Mi,"vitest","run","--coverage"]},secret:{cmd:"npx",args:[...Mi,"secretlint","**/*"]},arch:{cmd:"npx",args:[...Mi,"madge","--circular","--extensions","ts,tsx,js,jsx","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:jke},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"swift",manifests:["Package.swift"],gates:{type:{cmd:"swift",args:["build"]},lint:{cmd:"swiftlint",args:["lint"]},test:{cmd:"swift",args:["test"]},coverage:{cmd:"swift",args:["test","--enable-code-coverage"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dart",manifests:["pubspec.yaml"],gates:Mke}],Uke={language:"unknown",manifest:"",gates:{}};Hke=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:[...Mi,"biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:[...Mi,"oxlint"]}}],Gke=["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts",".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"];Wke=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs","jest.config.json"]});import{existsSync as Xke,readFileSync as Qke}from"node:fs";import{join as eEe}from"node:path";function za(t){return t.code==="ENOENT"}function Tv(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return pJ.test(o)||pJ.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function Nt(t,e,r,n=[]){if(za(r))return{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`};let i=`${String(r.stderr??"")} -${String(r.stdout??"")}`,o=/ENOTCACHED|ENOTFOUND|EAI_AGAIN|canceled due to missing packages|could not determine executable/i.test(i),a=n.find(l=>l!=="--"&&!l.startsWith("-"))?.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=r.exitCode===127&&a!==void 0&&new RegExp(`(?:^|[\\s:])${a}: (?:command )?not found\\b`,"i").test(i);return e==="npx"&&(o||c)?{stage:t,pass:!1,exitCode:2,stderr:"setup gap: 'npx' could not resolve the configured tool without installing it; the inferred tool is not installed or unavailable offline"}:null}function Yt(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Bl(t,e){let r=eEe(t,"package.json");if(!Xke(r))return!1;try{return!!JSON.parse(Qke(r,"utf8")).scripts?.[e]}catch{return!1}}var pJ,Rn=y(()=>{"use strict";pJ=/config (is |file )?not found|no such file|ENOENT|ENOTCACHED|ENOTFOUND|EAI_AGAIN|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function tEe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.arch;if(!n)return[{detector:Ov,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=We(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Ov,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:Tv(i,Ov,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var Ov,Ua,Rv=y(()=>{"use strict";Mr();sn();Rn();Ov="ARCHITECTURE_VIOLATION";Ua={name:Ov,subprocess:!0,run:tEe}});function rEe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.secret;if(!n)return[{detector:Iv,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=We(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Iv,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:Tv(i,Iv,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var Iv,qa,Pv=y(()=>{"use strict";Mr();sn();Rn();Iv="HARDCODED_SECRET";qa={name:Iv,subprocess:!0,run:rEe}});import{existsSync as EP,readdirSync as mJ}from"node:fs";import{join as Cv}from"node:path";function iEe(t,e){let r=Cv(t,e.path);if(!EP(r))return!0;if(e.isDirectory)try{return mJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function oEe(t){let{cwd:e="."}=t,r=[];for(let i of nEe)iEe(e,i)&&r.push({detector:mp,severity:i.severity,path:i.path,message:`${i.path} is absent \u2014 cladding scaffold incomplete (${i.purpose}). Run \`clad init --intent ""\` to populate it.`});let n=Cv(e,"spec.yaml");if(EP(n)){let i=cEe(n),o=i?null:sEe(e);if(i)r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present but unreadable (${i}) \u2014 cladding is governing nothing. Fix the SSoT root, then \`clad sync\` to validate.`});else if(o)r.push({detector:mp,severity:"error",path:o.path,message:`spec shard '${o.path}' is present but unparseable (${o.reason}) \u2014 loadSpec throws on it, so every spec-gated detector silently passes. Fix it, then \`clad sync\`.`});else{let s=aEe(e);s&&r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present and parses, but the assembled spec does not load (${s}) \u2014 every spec-gated detector then degrades to non-blocking info, so the gate would pass GREEN on an unloadable SSoT. Fix it, then \`clad sync\` to validate.`})}}return r}function sEe(t){for(let e of["spec/features","spec/scenarios"]){let r=Cv(t,e);if(!EP(r))continue;let n;try{n=mJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{Oi(Cv(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function aEe(t){try{return B(t),null}catch(e){return e.message}}function cEe(t){let e;try{e=Oi(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var mp,nEe,hJ,gJ=y(()=>{"use strict";Ue();M_();mp="ABSENCE_OF_GOVERNANCE",nEe=[{path:"spec.yaml",severity:"error",purpose:"SSoT root \u2014 every spec-gated detector needs it"},{path:"spec/architecture.yaml",severity:"warn",purpose:"architecture invariants (layers + forbidden_imports)"},{path:"spec/capabilities.yaml",severity:"warn",purpose:"capability \u2194 feature traceability"},{path:"docs/project-context.md",severity:"warn",purpose:"intent narrative + decision history"},{path:"docs/conventions.md",severity:"info",purpose:"project style guide (recommended)"},{path:"spec/scenarios",severity:"info",purpose:"user-journey scenarios (recommended)",isDirectory:!0}];hJ={name:mp,run:oEe}});function Dv(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function AP(t,e){let r=e?.trim()??"";if(!t)return r.length>0?"condition is present but ears pattern is not declared":null;if(t==="ubiquitous")return r.length>0?`ears='ubiquitous' but condition is present ('${r.slice(0,40)}\u2026')`:null;if(t==="complex"){if(r.length===0)return"ears='complex' requires a 'while' precondition and a 'when' trigger \u2014 empty";let i=Dv(r)==="while",o=uEe.test(r);return i?o?null:"ears='complex' requires a 'when' trigger clause after the 'while' precondition \u2014 none found":`ears='complex' requires the condition to start with 'while' (precondition) \u2014 got '${Dv(r)}'`}let n=lEe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:Dv(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${Dv(r)}'`:null}function dEe(t,e){let r=AP(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function yJ(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...dEe(r,n));return e}var lEe,uEe,TP=y(()=>{"use strict";lEe={event:"when",state:"while",optional:"where",unwanted:"if"},uEe=/\bwhen\b/i});function ge(t,e,r){let n;try{n=B(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var wt=y(()=>{"use strict";Ue()});function fEe(t){let{cwd:e="."}=t;return ge(e,Nv,pEe)}function pEe(t){let e=[];for(let r of t.features)for(let n of r.acceptance_criteria??[]){let i=!!n.text?.trim(),o=!!(n.condition?.trim()||n.action?.trim()||n.response?.trim());!i&&!o&&e.push({detector:Nv,severity:"error",message:`${r.id}.${n.id} has neither rendered text nor any EARS field (condition/action/response) \u2014 structurally empty AC`})}for(let r of yJ(t.features))e.push({detector:Nv,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var Nv,_J,bJ=y(()=>{"use strict";TP();wt();Nv="AC_DRIFT";_J={name:Nv,run:fEe}});function Fi(t=".",e){let n=(e??"").trim().toLowerCase()||dt(t).language;return SJ[n]??vJ}var mEe,hEe,gEe,vJ,yEe,_Ee,SJ,bEe,wJ,Ba=y(()=>{"use strict";sn();mEe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,hEe=/^[ \t]*import\s+([\w.]+)/gm,gEe=/^[ \t]*(?:from|import)\s+([\w.]+)/gm,vJ={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:mEe,importStyle:"relative"},yEe={ext:"kt",extensions:[".kt",".kts"],sourceRoots:["src/main/kotlin","src/test/kotlin"],mainRoot:"src/main/kotlin",testGlobs:["src/test/kotlin/**/*Test.kt","src/test/kotlin/**/*Tests.kt"],coverageSummary:"build/reports/jacoco/test/jacocoTestReport.xml",coverageFormat:"jacoco-xml",importMatcher:hEe,importStyle:"dotted"},_Ee={ext:"py",extensions:[".py"],sourceRoots:["."],mainRoot:"src",testGlobs:["tests/test_*.py","tests/**/test_*.py","tests/**/*_test.py"],coverageSummary:"coverage.xml",coverageFormat:"cobertura-xml",importMatcher:gEe,importStyle:"dotted"},SJ={typescript:vJ,kotlin:yEe,python:_Ee},bEe=[".js",".jsx",".mts",".cts",".rs",".go",".java",".rb",".php",".cs",".fs",".ex",".exs"],wJ=new Set([...Object.values(SJ).flatMap(t=>t?.extensions??[]),...bEe].map(t=>t.toLowerCase()))});import{existsSync as vEe,readFileSync as SEe,readdirSync as wEe,statSync as xEe}from"node:fs";import{join as $J,relative as xJ}from"node:path";function $Ee(t,e){if(!vEe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=wEe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=$J(i,s),c;try{c=xEe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function kEe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function AEe(t){return EEe.test(t)}function TEe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=Fi(e,r.project?.language),o=i.sourceRoots.flatMap(a=>$Ee($J(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=SEe(a,"utf8")}catch{continue}let l=c.split(` -`);for(let u=0;u{"use strict";Ue();Ba();kJ="AI_HINTS_FORBIDDEN_PATTERN";EEe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;EJ={name:kJ,run:TEe}});function OEe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:TJ,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var TJ,OJ,RJ=y(()=>{"use strict";Ue();TJ="AC_DUPLICATE_WITHIN_FEATURE";OJ={name:TJ,run:OEe}});import{createRequire as REe}from"module";import{basename as IEe,dirname as RP,normalize as PEe,relative as CEe,resolve as DEe,sep as CJ}from"path";import*as NEe from"fs";function jEe(t){let e=PEe(t);return e.length>1&&e[e.length-1]===CJ&&(e=e.substring(0,e.length-1)),e}function DJ(t,e){return t.replace(MEe,e)}function LEe(t){return t==="/"||FEe.test(t)}function OP(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=DEe(t)),(n||o)&&(t=jEe(t)),t===".")return"";let s=t[t.length-1]!==i;return DJ(s?t+i:t,i)}function NJ(t,e){return e+t}function zEe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:DJ(CEe(t,n),e.pathSeparator)+e.pathSeparator+r}}function UEe(t){return t}function qEe(t,e,r){return e+t+r}function BEe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?zEe(t,e):n?NJ:UEe}function HEe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function GEe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function KEe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?GEe(t):HEe(t):n&&n.length?VEe:ZEe:WEe}function tAe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?eAe:r&&r.length?n?JEe:YEe:n?XEe:QEe}function iAe(t){return t.group?nAe:rAe}function aAe(t){return t.group?oAe:sAe}function uAe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?lAe:cAe}function jJ(t,e,r){if(r.options.useRealPaths)return dAe(e,r);let n=RP(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=RP(n)}return r.symlinks.set(t,e),i>1}function dAe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function jv(t,e,r,n){e(t&&!n?t:null,r)}function vAe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?fAe:gAe:n?e?pAe:bAe:i?e?hAe:_Ae:e?mAe:yAe}function xAe(t){return t?wAe:SAe}function AAe(t,e){return new Promise((r,n)=>{LJ(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function LJ(t,e,r){new FJ(t,e,r).start()}function TAe(t,e){return new FJ(t,e).start()}var IJ,MEe,FEe,ZEe,VEe,WEe,JEe,YEe,XEe,QEe,eAe,rAe,nAe,oAe,sAe,cAe,lAe,fAe,pAe,mAe,hAe,gAe,yAe,_Ae,bAe,MJ,SAe,wAe,$Ae,kAe,EAe,FJ,PJ,zJ,UJ,qJ=y(()=>{IJ=REe(import.meta.url);MEe=/[\\/]/g;FEe=/^[a-z]:[\\/]$/i;ZEe=(t,e)=>{e.push(t||".")},VEe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},WEe=()=>{};JEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},YEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},XEe=(t,e,r,n)=>{r.files++},QEe=(t,e)=>{e.push(t)},eAe=()=>{};rAe=t=>t,nAe=()=>[""].slice(0,0);oAe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},sAe=()=>{};cAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&jJ(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},lAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&jJ(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};fAe=t=>t.counts,pAe=t=>t.groups,mAe=t=>t.paths,hAe=t=>t.paths.slice(0,t.options.maxFiles),gAe=(t,e,r)=>(jv(e,r,t.counts,t.options.suppressErrors),null),yAe=(t,e,r)=>(jv(e,r,t.paths,t.options.suppressErrors),null),_Ae=(t,e,r)=>(jv(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),bAe=(t,e,r)=>(jv(e,r,t.groups,t.options.suppressErrors),null);MJ={withFileTypes:!0},SAe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",MJ,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},wAe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",MJ)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};$Ae=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},kAe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},EAe=class{aborted=!1;abort(){this.aborted=!0}},FJ=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=vAe(e,this.isSynchronous),this.root=OP(t,e),this.state={root:LEe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new kAe,options:e,queue:new $Ae((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new EAe,fs:e.fs||NEe},this.joinPath=BEe(this.root,e),this.pushDirectory=KEe(this.root,e),this.pushFile=tAe(e),this.getArray=iAe(e),this.groupFiles=aAe(e),this.resolveSymlink=uAe(e,this.isSynchronous),this.walkDirectory=xAe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(b.isDirectory()){if(_=OP(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let S=IEe(_),x=OP(RP(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};PJ=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return AAe(this.root,this.options)}withCallback(t){LJ(this.root,this.options,t)}sync(){return TAe(this.root,this.options)}},zJ=null;try{IJ.resolve("picomatch"),zJ=IJ("picomatch")}catch{}UJ=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:CJ,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new PJ(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new PJ(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||zJ;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var hp=v((edt,VJ)=>{"use strict";var BJ="[^\\\\/]",OAe="(?=.)",HJ="[^/]",IP="(?:\\/|$)",GJ="(?:^|\\/)",PP=`\\.{1,2}${IP}`,RAe="(?!\\.)",IAe=`(?!${GJ}${PP})`,PAe=`(?!\\.{0,1}${IP})`,CAe=`(?!${PP})`,DAe="[^.\\/]",NAe=`${HJ}*?`,jAe="/",ZJ={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:OAe,QMARK:HJ,END_ANCHOR:IP,DOTS_SLASH:PP,NO_DOT:RAe,NO_DOTS:IAe,NO_DOT_SLASH:PAe,NO_DOTS_SLASH:CAe,QMARK_NO_DOT:DAe,STAR:NAe,START_ANCHOR:GJ,SEP:jAe},MAe={...ZJ,SLASH_LITERAL:"[\\\\/]",QMARK:BJ,STAR:`${BJ}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},FAe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};VJ.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:FAe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?MAe:ZJ}}});var gp=v(Fr=>{"use strict";var{REGEX_BACKSLASH:LAe,REGEX_REMOVE_BACKSLASH:zAe,REGEX_SPECIAL_CHARS:UAe,REGEX_SPECIAL_CHARS_GLOBAL:qAe}=hp();Fr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Fr.hasRegexChars=t=>UAe.test(t);Fr.isRegexChar=t=>t.length===1&&Fr.hasRegexChars(t);Fr.escapeRegex=t=>t.replace(qAe,"\\$1");Fr.toPosixSlashes=t=>t.replace(LAe,"/");Fr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Fr.removeBackslashes=t=>t.replace(zAe,e=>e==="\\"?"":e);Fr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Fr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Fr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Fr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Fr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var t8=v((rdt,e8)=>{"use strict";var WJ=gp(),{CHAR_ASTERISK:CP,CHAR_AT:BAe,CHAR_BACKWARD_SLASH:yp,CHAR_COMMA:HAe,CHAR_DOT:DP,CHAR_EXCLAMATION_MARK:NP,CHAR_FORWARD_SLASH:QJ,CHAR_LEFT_CURLY_BRACE:jP,CHAR_LEFT_PARENTHESES:MP,CHAR_LEFT_SQUARE_BRACKET:GAe,CHAR_PLUS:ZAe,CHAR_QUESTION_MARK:KJ,CHAR_RIGHT_CURLY_BRACE:VAe,CHAR_RIGHT_PARENTHESES:JJ,CHAR_RIGHT_SQUARE_BRACKET:WAe}=hp(),YJ=t=>t===QJ||t===yp,XJ=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},KAe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,b=!1,_=!1,S=!1,x=!1,w=!1,O=0,T,A,D={value:"",depth:0,isGlob:!1},$=()=>l>=n,ie=()=>c.charCodeAt(l+1),K=()=>(T=A,c.charCodeAt(++l));for(;l0&&(C=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),P=c.slice(d)):m===!0?(xe="",P=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&YJ(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(P&&(P=WJ.removeBackslashes(P)),xe&&_===!0&&(xe=WJ.removeBackslashes(xe)));let Ir={prefix:C,input:t,start:u,base:xe,glob:P,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&(Ir.maxDepth=0,YJ(A)||s.push(D),Ir.tokens=s),r.parts===!0||r.tokens===!0){let se;for(let Ce=0;Ce{"use strict";var _p=hp(),an=gp(),{MAX_LENGTH:Mv,POSIX_REGEX_SOURCE:JAe,REGEX_NON_SPECIAL_CHARS:YAe,REGEX_SPECIAL_CHARS_BACKREF:XAe,REPLACEMENTS:r8}=_p,QAe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>an.escapeRegex(i)).join("..")}return r},Hl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,n8=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},eTe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},i8=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(eTe(e))return e.replace(/\\(.)/g,"$1")},tTe=t=>{let e=t.map(i8).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},rTe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=i8(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?an.escapeRegex(r[0]):`[${r.map(i=>an.escapeRegex(i)).join("")}]`}*`},nTe=t=>{let e=0,r=t.trim(),n=FP(r);for(;n;)e++,r=n.body.trim(),n=FP(r);return e},iTe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:_p.DEFAULT_MAX_EXTGLOB_RECURSION,n=n8(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||tTe(n)))return{risky:!0};for(let i of n){let o=rTe(i);if(o)return{risky:!0,safeOutput:o};if(nTe(i)>r)return{risky:!0}}return{risky:!1}},LP=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=r8[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Mv,r.maxLength):Mv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=_p.globChars(r.windows),l=_p.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:b,QMARK:_,QMARK_NO_DOT:S,STAR:x,START_ANCHOR:w}=c,O=H=>`(${a}(?:(?!${w}${H.dot?m:u}).)*?)`,T=r.dot?"":h,A=r.dot?_:S,D=r.bash===!0?O(r):x;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let $={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=an.removePrefix(t,$),i=t.length;let ie=[],K=[],xe=[],C=o,P,Ir=()=>$.index===i-1,se=$.peek=(H=1)=>t[$.index+H],Ce=$.advance=()=>t[++$.index]||"",Kt=()=>t.slice($.index+1),dr=(H="",ht=0)=>{$.consumed+=H,$.index+=ht},Xt=H=>{$.output+=H.output!=null?H.output:H.value,dr(H.value)},lo=()=>{let H=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)Ce(),$.start++,H++;return H%2===0?!1:($.negated=!0,$.start++,!0)},$i=H=>{$[H]++,xe.push(H)},Xr=H=>{$[H]--,xe.pop()},de=H=>{if(C.type==="globstar"){let ht=$.braces>0&&(H.type==="comma"||H.type==="brace"),q=H.extglob===!0||ie.length&&(H.type==="pipe"||H.type==="paren");H.type!=="slash"&&H.type!=="paren"&&!ht&&!q&&($.output=$.output.slice(0,-C.output.length),C.type="star",C.value="*",C.output=D,$.output+=C.output)}if(ie.length&&H.type!=="paren"&&(ie[ie.length-1].inner+=H.value),(H.value||H.output)&&Xt(H),C&&C.type==="text"&&H.type==="text"){C.output=(C.output||C.value)+H.value,C.value+=H.value;return}H.prev=C,s.push(H),C=H},uo=(H,ht)=>{let q={...l[ht],conditions:1,inner:""};q.prev=C,q.parens=$.parens,q.output=$.output,q.startIndex=$.index,q.tokensIndex=s.length;let Oe=(r.capture?"(":"")+q.open;$i("parens"),de({type:H,value:ht,output:$.output?"":p}),de({type:"paren",extglob:!0,value:Ce(),output:Oe}),ie.push(q)},jde=H=>{let ht=t.slice(H.startIndex,$.index+1),q=t.slice(H.startIndex+2,$.index),Oe=iTe(q,r);if((H.type==="plus"||H.type==="star")&&Oe.risky){let lt=Oe.safeOutput?(H.output?"":p)+(r.capture?`(${Oe.safeOutput})`:Oe.safeOutput):void 0,ki=s[H.tokensIndex];ki.type="text",ki.value=ht,ki.output=lt||an.escapeRegex(ht);for(let Ei=H.tokensIndex+1;Ei1&&H.inner.includes("/")&&(lt=O(r)),(lt!==D||Ir()||/^\)+$/.test(Kt()))&&(ut=H.close=`)$))${lt}`),H.inner.includes("*")&&(zt=Kt())&&/^\.[^\\/.]+$/.test(zt)){let ki=LP(zt,{...e,fastpaths:!1}).output;ut=H.close=`)${ki})${lt})`}H.prev.type==="bos"&&($.negatedExtglob=!0)}de({type:"paren",extglob:!0,value:P,output:ut}),Xr("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let H=!1,ht=t.replace(XAe,(q,Oe,ut,zt,lt,ki)=>zt==="\\"?(H=!0,q):zt==="?"?Oe?Oe+zt+(lt?_.repeat(lt.length):""):ki===0?A+(lt?_.repeat(lt.length):""):_.repeat(ut.length):zt==="."?u.repeat(ut.length):zt==="*"?Oe?Oe+zt+(lt?D:""):D:Oe?q:`\\${q}`);return H===!0&&(r.unescape===!0?ht=ht.replace(/\\/g,""):ht=ht.replace(/\\+/g,q=>q.length%2===0?"\\\\":q?"\\":"")),ht===t&&r.contains===!0?($.output=t,$):($.output=an.wrapOutput(ht,$,e),$)}for(;!Ir();){if(P=Ce(),P==="\0")continue;if(P==="\\"){let q=se();if(q==="/"&&r.bash!==!0||q==="."||q===";")continue;if(!q){P+="\\",de({type:"text",value:P});continue}let Oe=/^\\+/.exec(Kt()),ut=0;if(Oe&&Oe[0].length>2&&(ut=Oe[0].length,$.index+=ut,ut%2!==0&&(P+="\\")),r.unescape===!0?P=Ce():P+=Ce(),$.brackets===0){de({type:"text",value:P});continue}}if($.brackets>0&&(P!=="]"||C.value==="["||C.value==="[^")){if(r.posix!==!1&&P===":"){let q=C.value.slice(1);if(q.includes("[")&&(C.posix=!0,q.includes(":"))){let Oe=C.value.lastIndexOf("["),ut=C.value.slice(0,Oe),zt=C.value.slice(Oe+2),lt=JAe[zt];if(lt){C.value=ut+lt,$.backtrack=!0,Ce(),!o.output&&s.indexOf(C)===1&&(o.output=p);continue}}}(P==="["&&se()!==":"||P==="-"&&se()==="]")&&(P=`\\${P}`),P==="]"&&(C.value==="["||C.value==="[^")&&(P=`\\${P}`),r.posix===!0&&P==="!"&&C.value==="["&&(P="^"),C.value+=P,Xt({value:P});continue}if($.quotes===1&&P!=='"'){P=an.escapeRegex(P),C.value+=P,Xt({value:P});continue}if(P==='"'){$.quotes=$.quotes===1?0:1,r.keepQuotes===!0&&de({type:"text",value:P});continue}if(P==="("){$i("parens"),de({type:"paren",value:P});continue}if(P===")"){if($.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Hl("opening","("));let q=ie[ie.length-1];if(q&&$.parens===q.parens+1){jde(ie.pop());continue}de({type:"paren",value:P,output:$.parens?")":"\\)"}),Xr("parens");continue}if(P==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Hl("closing","]"));P=`\\${P}`}else $i("brackets");de({type:"bracket",value:P});continue}if(P==="]"){if(r.nobracket===!0||C&&C.type==="bracket"&&C.value.length===1){de({type:"text",value:P,output:`\\${P}`});continue}if($.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Hl("opening","["));de({type:"text",value:P,output:`\\${P}`});continue}Xr("brackets");let q=C.value.slice(1);if(C.posix!==!0&&q[0]==="^"&&!q.includes("/")&&(P=`/${P}`),C.value+=P,Xt({value:P}),r.literalBrackets===!1||an.hasRegexChars(q))continue;let Oe=an.escapeRegex(C.value);if($.output=$.output.slice(0,-C.value.length),r.literalBrackets===!0){$.output+=Oe,C.value=Oe;continue}C.value=`(${a}${Oe}|${C.value})`,$.output+=C.value;continue}if(P==="{"&&r.nobrace!==!0){$i("braces");let q={type:"brace",value:P,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};K.push(q),de(q);continue}if(P==="}"){let q=K[K.length-1];if(r.nobrace===!0||!q){de({type:"text",value:P,output:P});continue}let Oe=")";if(q.dots===!0){let ut=s.slice(),zt=[];for(let lt=ut.length-1;lt>=0&&(s.pop(),ut[lt].type!=="brace");lt--)ut[lt].type!=="dots"&&zt.unshift(ut[lt].value);Oe=QAe(zt,r),$.backtrack=!0}if(q.comma!==!0&&q.dots!==!0){let ut=$.output.slice(0,q.outputIndex),zt=$.tokens.slice(q.tokensIndex);q.value=q.output="\\{",P=Oe="\\}",$.output=ut;for(let lt of zt)$.output+=lt.output||lt.value}de({type:"brace",value:P,output:Oe}),Xr("braces"),K.pop();continue}if(P==="|"){ie.length>0&&ie[ie.length-1].conditions++,de({type:"text",value:P});continue}if(P===","){let q=P,Oe=K[K.length-1];Oe&&xe[xe.length-1]==="braces"&&(Oe.comma=!0,q="|"),de({type:"comma",value:P,output:q});continue}if(P==="/"){if(C.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",s.pop(),C=o;continue}de({type:"slash",value:P,output:f});continue}if(P==="."){if($.braces>0&&C.type==="dot"){C.value==="."&&(C.output=u);let q=K[K.length-1];C.type="dots",C.output+=P,C.value+=P,q.dots=!0;continue}if($.braces+$.parens===0&&C.type!=="bos"&&C.type!=="slash"){de({type:"text",value:P,output:u});continue}de({type:"dot",value:P,output:u});continue}if(P==="?"){if(!(C&&C.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("qmark",P);continue}if(C&&C.type==="paren"){let Oe=se(),ut=P;(C.value==="("&&!/[!=<:]/.test(Oe)||Oe==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(ut=`\\${P}`),de({type:"text",value:P,output:ut});continue}if(r.dot!==!0&&(C.type==="slash"||C.type==="bos")){de({type:"qmark",value:P,output:S});continue}de({type:"qmark",value:P,output:_});continue}if(P==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){uo("negate",P);continue}if(r.nonegate!==!0&&$.index===0){lo();continue}}if(P==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("plus",P);continue}if(C&&C.value==="("||r.regex===!1){de({type:"plus",value:P,output:d});continue}if(C&&(C.type==="bracket"||C.type==="paren"||C.type==="brace")||$.parens>0){de({type:"plus",value:P});continue}de({type:"plus",value:d});continue}if(P==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){de({type:"at",extglob:!0,value:P,output:""});continue}de({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let q=YAe.exec(Kt());q&&(P+=q[0],$.index+=q[0].length),de({type:"text",value:P});continue}if(C&&(C.type==="globstar"||C.star===!0)){C.type="star",C.star=!0,C.value+=P,C.output=D,$.backtrack=!0,$.globstar=!0,dr(P);continue}let H=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(H)){uo("star",P);continue}if(C.type==="star"){if(r.noglobstar===!0){dr(P);continue}let q=C.prev,Oe=q.prev,ut=q.type==="slash"||q.type==="bos",zt=Oe&&(Oe.type==="star"||Oe.type==="globstar");if(r.bash===!0&&(!ut||H[0]&&H[0]!=="/")){de({type:"star",value:P,output:""});continue}let lt=$.braces>0&&(q.type==="comma"||q.type==="brace"),ki=ie.length&&(q.type==="pipe"||q.type==="paren");if(!ut&&q.type!=="paren"&&!lt&&!ki){de({type:"star",value:P,output:""});continue}for(;H.slice(0,3)==="/**";){let Ei=t[$.index+4];if(Ei&&Ei!=="/")break;H=H.slice(3),dr("/**",3)}if(q.type==="bos"&&Ir()){C.type="globstar",C.value+=P,C.output=O(r),$.output=C.output,$.globstar=!0,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&!zt&&Ir()){$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=O(r)+(r.strictSlashes?")":"|$)"),C.value+=P,$.globstar=!0,$.output+=q.output+C.output,dr(P);continue}if(q.type==="slash"&&q.prev.type!=="bos"&&H[0]==="/"){let Ei=H[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(q.output+C.output).length),q.output=`(?:${q.output}`,C.type="globstar",C.output=`${O(r)}${f}|${f}${Ei})`,C.value+=P,$.output+=q.output+C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}if(q.type==="bos"&&H[0]==="/"){C.type="globstar",C.value+=P,C.output=`(?:^|${f}|${O(r)}${f})`,$.output=C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-C.output.length),C.type="globstar",C.output=O(r),C.value+=P,$.output+=C.output,$.globstar=!0,dr(P);continue}let ht={type:"star",value:P,output:D};if(r.bash===!0){ht.output=".*?",(C.type==="bos"||C.type==="slash")&&(ht.output=T+ht.output),de(ht);continue}if(C&&(C.type==="bracket"||C.type==="paren")&&r.regex===!0){ht.output=P,de(ht);continue}($.index===$.start||C.type==="slash"||C.type==="dot")&&(C.type==="dot"?($.output+=g,C.output+=g):r.dot===!0?($.output+=b,C.output+=b):($.output+=T,C.output+=T),se()!=="*"&&($.output+=p,C.output+=p)),de(ht)}for(;$.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing","]"));$.output=an.escapeLast($.output,"["),Xr("brackets")}for(;$.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing",")"));$.output=an.escapeLast($.output,"("),Xr("parens")}for(;$.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing","}"));$.output=an.escapeLast($.output,"{"),Xr("braces")}if(r.strictSlashes!==!0&&(C.type==="star"||C.type==="bracket")&&de({type:"maybe_slash",value:"",output:`${f}?`}),$.backtrack===!0){$.output="";for(let H of $.tokens)$.output+=H.output!=null?H.output:H.value,H.suffix&&($.output+=H.suffix)}return $};LP.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Mv,r.maxLength):Mv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=r8[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=_p.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=T=>T.noglobstar===!0?_:`(${g}(?:(?!${p}${T.dot?c:o}).)*?)`,x=T=>{switch(T){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${S(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${S(r)}${s})?${o}${a}${_}`;default:{let A=/^(.*?)\.(\w+)$/.exec(T);if(!A)return;let D=x(A[1]);return D?D+o+A[2]:void 0}}},w=an.removePrefix(t,b),O=x(w);return O&&r.strictSlashes!==!0&&(O+=`${s}?`),O};o8.exports=LP});var l8=v((idt,c8)=>{"use strict";var oTe=t8(),zP=s8(),a8=gp(),sTe=hp(),aTe=t=>t&&typeof t=="object"&&!Array.isArray(t),Rt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Rt(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=aTe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?Rt.compileRe(t,e):Rt.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Rt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Rt.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};Rt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?a8.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Rt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Rt.matchBase=(t,e,r)=>(e instanceof RegExp?e:Rt.makeRe(e,r)).test(a8.basename(t));Rt.isMatch=(t,e,r)=>Rt(e,r)(t);Rt.parse=(t,e)=>Array.isArray(t)?t.map(r=>Rt.parse(r,e)):zP(t,{...e,fastpaths:!1});Rt.scan=(t,e)=>oTe(t,e);Rt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Rt.toRegex(a,e);return n===!0&&(c.state=t),c};Rt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=zP.fastpaths(t,e)),i.output||(i=zP(t,e)),Rt.compileRe(i,e,r,n)};Rt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Rt.constants=sTe;c8.exports=Rt});var p8=v((odt,f8)=>{"use strict";var u8=l8(),cTe=gp();function d8(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:cTe.isWindows()}),u8(t,e,r)}Object.assign(d8,u8);f8.exports=d8});import{readdir as lTe,readdirSync as uTe,realpath as dTe,realpathSync as fTe,stat as pTe,statSync as mTe}from"fs";import{isAbsolute as hTe,posix as Ha,resolve as gTe}from"path";import{fileURLToPath as yTe}from"url";function vTe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&bTe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>Ha.relative(t,n)||".":n=>Ha.relative(t,`${e}/${n}`)||"."}function xTe(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=Ha.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function y8(t){var e;let r=Gl.default.scan(t,$Te);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function RTe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Gl.default.scan(t);return r.isGlob||r.negated}function bp(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function _8(t){return typeof t=="string"?[t]:t??[]}function UP(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=OTe(o);s=hTe(s.replace(PTe,""))?Ha.relative(a,s):Ha.normalize(s);let c=(i=ITe.exec(s))===null||i===void 0?void 0:i[0],l=y8(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?Ha.join(o,...d):o}return s}function CTe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(UP(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(UP(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(UP(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function DTe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=CTe(t,e,n);t.debug&&bp("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(h8,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Gl.default)(i.match,f),m=(0,Gl.default)(i.ignore,f),h=vTe(i.match,f),g=m8(r,d,o),b=o?g:m8(r,d,!0),_=(w,O)=>{let T=b(O,!0);return T!=="."&&!h(T)||m(T)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let x=new UJ({filters:[a?(w,O)=>{let T=g(w,O),A=p(T)&&!m(T);return A&&bp(`matched ${T}`),A}:(w,O)=>{let T=g(w,O);return p(T)&&!m(T)}],exclude:a?(w,O)=>{let T=_(w,O);return bp(`${T?"skipped":"crawling"} ${O}`),T}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:S,signal:t.signal}).crawl(d);return t.debug&&bp("internal properties:",{...n,root:d}),[x,r!==d&&!o&&xTe(r,d)]}function NTe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function MTe(t){let e={...jTe,...t};return e.cwd=(e.cwd instanceof URL?yTe(e.cwd):gTe(e.cwd)).replace(h8,"/"),e.ignore=_8(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||lTe,readdirSync:e.fs.readdirSync||uTe,realpath:e.fs.realpath||dTe,realpathSync:e.fs.realpathSync||fTe,stat:e.fs.stat||pTe,statSync:e.fs.statSync||mTe}),e.debug&&bp("globbing with options:",e),e}function FTe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=_Te(t)||typeof t=="string",i=_8((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=MTe(n?e:t);return i.length>0?DTe(o,i):[]}function ys(t,e){let[r,n]=FTe(t,e);return r?NTe(r.sync(),n):[]}var Gl,_Te,h8,g8,bTe,STe,wTe,$Te,kTe,ETe,ATe,TTe,OTe,ITe,PTe,jTe,vp=y(()=>{qJ();Gl=St(p8(),1),_Te=Array.isArray,h8=/\\/g,g8=process.platform==="win32",bTe=/^(\/?\.\.)+$/;STe=/^[A-Z]:\/$/i,wTe=g8?t=>STe.test(t):t=>t==="/";$Te={parts:!0};kTe=/(?t.replace(kTe,"\\$&"),TTe=t=>t.replace(ETe,"\\$&"),OTe=g8?TTe:ATe;ITe=/^(\/?\.\.)+/,PTe=/\\(?=[()[\]{}!*+?@|])/g;jTe={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as Sp,readFileSync as LTe,readdirSync as zTe,statSync as b8}from"node:fs";import{join as Ga}from"node:path";function UTe(t){let{cwd:e="."}=t,r,n;try{let c=B(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=Fi(e,n),o=[],{layers:s,forbiddenImports:a}=qP(r);return(s.size>0||a.length>0)&&!Sp(Ga(e,i.mainRoot))?[{detector:wp,severity:"info",path:`${i.mainRoot}/`,message:`architecture layers declared but ${i.mainRoot}/ not found \u2014 layer checks skipped (flat layout not yet supported)`}]:(s.size>0&&(qTe(e,i,s,o),BTe(e,i,s,o)),a.length>0&&HTe(e,i,a,o),o)}function qP(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function qTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of zTe(o)){let a=Ga(o,s);b8(a).isDirectory()&&(r.has(s)||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function BTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of r){let a=Ga(o,s);Sp(a)&&b8(a).isDirectory()||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function HTe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Ga(t,i,s.from);if(!Sp(a))continue;let c=ys([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Ga(a,l),d;try{d=LTe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];GTe(p,s.to,e.importStyle)&&n.push({detector:wp,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function GTe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var wp,v8,BP=y(()=>{"use strict";vp();Ue();Ba();wp="ARCHITECTURE_FROM_SPEC";v8={name:wp,run:UTe}});import{existsSync as ZTe,readFileSync as VTe}from"node:fs";import{join as WTe}from"node:path";function JTe(t){let{cwd:e="."}=t,r=WTe(e,"spec/capabilities.yaml");if(!ZTe(r))return[];let n;try{let u=VTe(r,"utf8"),d=S8.default.parse(u);if(!d||typeof d!="object")return[];n=d}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o,s=!1;try{let u=B(e);o=new Set(u.features.map(d=>d.id)),s=u.project.onboarding_seeded===!0}catch{return[]}let a=[],c=new Set,l=s&&o.size{"use strict";S8=St(er(),1);Ue();Fv="CAPABILITIES_FEATURE_MAPPING",KTe=8;w8={name:Fv,run:JTe}});import{existsSync as YTe,readFileSync as XTe}from"node:fs";import{join as QTe}from"node:path";function eOe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("#")||e.startsWith('"""')||e.startsWith("'''")}function tOe(t){let{cwd:e="."}=t;return ge(e,HP,r=>rOe(r,e))}function rOe(t,e){let r=Fi(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=QTe(e,o);if(!YTe(s))continue;let a=XTe(s,"utf8");eOe(a)||n.push({detector:HP,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var HP,$8,k8=y(()=>{"use strict";Ba();wt();HP="CONVENTION_DRIFT";$8={name:HP,run:tOe}});import{existsSync as GP,readFileSync as E8}from"node:fs";import{join as Lv}from"node:path";function nOe(t){return JSON.parse(t).total?.lines?.pct??0}function A8(t){let e=/]*\bline-rate="([0-9]*\.?[0-9]+)"/.exec(t);return e?Number(e[1])*100:null}function sOe(t,e){if(!xv(dt(t).gates.coverage?.cmd))return null;let r;try{r=$v(t,e)}catch(c){return[{detector:$o,severity:"error",message:c.message}]}let n=0,i=0,o=0,s=[];for(let c of r){let l=wP.find(d=>GP(Lv(c.dir,d)));if(!l){s.push(c.path);continue}let u=A8(E8(Lv(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:$o,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=T8(n,i);return a0?[{detector:$o,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function aOe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let a=sOe(e,t.focusModules);if(a)return a}let r;try{r=B(e).project?.language}catch{}let n=Fi(e,r),i=dt(e).language==="kotlin"?wP.find(a=>GP(Lv(e,a)))??lJ(e):n.coverageSummary,o=Lv(e,i);if(!GP(o))return[{detector:$o,severity:"info",message:`${i} not present \u2014 run stage_2.2 first`}];let s;try{let a=E8(o,"utf8");s=n.coverageFormat==="jacoco-xml"?iOe(a):n.coverageFormat==="cobertura-xml"?oOe(a):nOe(a)}catch(a){return[{detector:$o,severity:"warn",message:`${i} unparseable: ${a.message}`}]}return s===null?n.coverageFormat==="cobertura-xml"?[]:[{detector:$o,severity:"warn",message:`${i} contained no line-coverage counter`}]:s>=zv?[]:[{detector:$o,severity:"warn",message:`line coverage ${s.toFixed(1)}% < floor ${zv}%`}]}var $o,zv,O8,R8=y(()=>{"use strict";Ue();Av();Ba();kv();sn();$o="COVERAGE_DROP",zv=70;O8={name:$o,run:aOe}});import{existsSync as cOe}from"node:fs";import{join as lOe}from"node:path";function dOe(t){let{cwd:e="."}=t;return ge(e,Uv,r=>fOe(r,e))}function fOe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);if(!r){if(n.length===0)return[];let i=t.project.onboarding_seeded===!0&&t.features.length{"use strict";wt();Uv="DELIVERABLE_INTEGRITY",uOe=8;I8={name:Uv,run:dOe}});function pOe(t){let e=new Set((t.features??[]).map(n=>n.id)),r=[];for(let n of t.project?.smoke??[]){let i=n.feature;if(i===void 0||e.has(i))continue;let o=(n.run??[]).join(" ")||`kind:${n.kind}`;r.push({detector:qv,severity:"warn",path:"spec.yaml",message:`smoke probe '${o}' binds feature ${i}, which is not in the spec \u2014 a dangling binding is annotation drift (the bound feature was renamed, archived, or never existed). Fix the id or drop the binding.`})}return r}function mOe(t){let e=pOe(t),r=(t.features??[]).filter(o=>o.status==="done");return r.length===0||!!!t.project?.deliverable||(t.project?.smoke??[]).length>0?e:[...e,{detector:qv,severity:"warn",path:"spec.yaml",message:`${r.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function hOe(t){let{cwd:e="."}=t;return ge(e,qv,r=>mOe(r))}var qv,C8,D8=y(()=>{"use strict";wt();qv="SMOKE_PROBE_DEMAND";C8={name:qv,run:hOe}});function gOe(t){let{cwd:e="."}=t;return ge(e,Bv,r=>yOe(r,e))}function yOe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=as(e);if(n===null)return[{detector:Bv,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=B_(n,e,o);s.state!=="fresh"&&i.push({detector:Bv,severity:"warn",path:"spec/attestation.yaml",message:s.state==="unattested"?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:s.module?`${o.id}'s module ${s.module} changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var Bv,Hv,ZP=y(()=>{"use strict";vl();wt();Bv="STALE_ATTESTATION";Hv={name:Bv,run:gOe}});function _Oe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}return bOe(r)}function bOe(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:N8,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var N8,Gv,VP=y(()=>{"use strict";Ue();N8="DEPENDENCY_CYCLE";Gv={name:N8,run:_Oe}});import{appendFileSync as vOe,existsSync as j8,mkdirSync as SOe,readFileSync as wOe}from"node:fs";import{dirname as xOe,join as $Oe}from"node:path";function M8(t){return $Oe(t,kOe,EOe)}function F8(t){return WP.add(t),()=>WP.delete(t)}function Za(t,e){let r=M8(t),n=xOe(r);j8(n)||SOe(n,{recursive:!0}),vOe(r,`${JSON.stringify(e)} -`,"utf8");for(let i of WP)try{i(t,e)}catch{}}function In(t){let e=M8(t);if(!j8(e))return[];let r=wOe(e,"utf8").trim();return r.length===0?[]:r.split(` -`).filter(n=>n.length>0).map(n=>JSON.parse(n))}var kOe,EOe,WP,ni=y(()=>{"use strict";kOe=".cladding",EOe="audit.log.jsonl";WP=new Set});import{existsSync as AOe}from"node:fs";import{join as TOe}from"node:path";function OOe(t){let{cwd:e="."}=t,r=In(e);if(r.length===0)return[{detector:KP,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=[];for(let i of r)i.artifact&&(AOe(TOe(e,i.artifact))||n.push({detector:KP,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var KP,L8,z8=y(()=>{"use strict";ni();KP="EVIDENCE_MISMATCH";L8={name:KP,run:OOe}});import{existsSync as ROe,readFileSync as IOe}from"node:fs";import{join as POe}from"node:path";function COe(t){let e=POe(t,H8);if(!ROe(e))return null;try{let n=((0,B8.parse)(IOe(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*q8(t,e){for(let r of t??[])r.startsWith(U8)&&(yield{ref:r,name:r.slice(U8.length),field:e})}function DOe(t){let{cwd:e="."}=t,r=COe(e);if(r===null)return[];let n;try{n=B(e)}catch(o){return[{detector:JP,severity:"info",message:`spec.yaml not loaded: ${o.message}`}]}let i=[];for(let o of n.features)for(let s of o.acceptance_criteria??[]){let a=[...q8(s.evidence_refs,"evidence_refs"),...q8(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:JP,severity:"warn",path:H8,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var B8,JP,U8,H8,G8,Z8=y(()=>{"use strict";B8=St(er(),1);Ue();JP="FIXTURE_REFERENCE_INVALID",U8="fixture:",H8="conformance/fixtures.yaml";G8={name:JP,run:DOe}});import{existsSync as Zl,readFileSync as YP}from"node:fs";import{join as Va}from"node:path";function NOe(t){return ys(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec|spec-first-window)\.ts$/.test(r)).length}function xp(t){if(!Zl(t))return null;try{return JSON.parse(YP(t,"utf8"))}catch{return null}}function jOe(t,e){let r=Va(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(YP(r,"utf8"))}catch(c){e.push({detector:ko,severity:"info",message:`plugin.json not loaded: ${c.message}`});return}let i=n.ironclad?.current?.detectors;if(!i)return;let o=i.match(/^(\d+)\/(\d+)$/);if(!o){e.push({detector:ko,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=NOe(t);s!==a&&e.push({detector:ko,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function MOe(t,e){for(let r of V8){let n=Va(t,r.path);if(!Zl(n))continue;let i=xp(n);if(!i){e.push({detector:ko,severity:"warn",message:`${r.host}: ${r.path} could not be parsed as JSON`});continue}for(let o of r.required)(i[o]===void 0||i[o]===null||i[o]==="")&&e.push({detector:ko,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function FOe(t,e){let r=xp(Va(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of V8){let s=Va(t,o.path);if(!Zl(s))continue;let a=xp(s);a?.version&&a.version!==n&&e.push({detector:ko,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=Va(t,".claude-plugin","marketplace.json");if(Zl(i)){let o=xp(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:ko,severity:"error",message:`marketplace: .claude-plugin/marketplace.json plugin '${s.name??"?"}' version='${s.version}' but package.json version='${n}' \u2014 the catalog advertises a stale version; bump it in lockstep`})}}function LOe(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function zOe(t,e){let r=Va(t,"src","cli","clad.ts"),n=Va(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!Zl(r)||!Zl(n))return;let i=LOe(YP(r,"utf8"));if(i.length===0)return;let s=xp(n)?.ironclad?.current?.["stages-implemented"];if(!Array.isArray(s))return;let a=new Set(i),c=new Set(s),l=i.filter(f=>!c.has(f)),u=s.filter(f=>!a.has(f));if(l.length===0&&u.length===0)return;let d=[l.length?`missing [${l.join(", ")}]`:"",u.length?`unexpected [${u.join(", ")}]`:""].filter(Boolean).join("; ");e.push({detector:ko,severity:"error",message:`plugins/claude-code/.claude-plugin/plugin.json stages-implemented disagrees with TIER_STAGES.all (src/cli/clad.ts): ${d} \u2014 run \`npm run build:plugin\` to re-derive`})}function UOe(t){let{cwd:e="."}=t,r=[];return jOe(e,r),zOe(e,r),MOe(e,r),FOe(e,r),r}var ko,V8,W8,K8=y(()=>{"use strict";vp();ko="HARNESS_INTEGRITY",V8=[{host:"claude-code",path:"plugins/claude-code/.claude-plugin/plugin.json",required:["name","version"]},{host:"codex",path:"plugins/codex/.codex-plugin/plugin.json",required:["name","version","description"]},{host:"gemini-cli",path:"plugins/gemini-cli/gemini-extension.json",required:["name","version"]}];W8={name:ko,run:UOe}});import{existsSync as qOe,readFileSync as BOe}from"node:fs";import{join as HOe}from"node:path";function ZOe(t){let{cwd:e="."}=t;return ge(e,Zv,r=>WOe(r,e))}function VOe(t){let e=HOe(t,"spec/capabilities.yaml");if(!qOe(e))return!1;try{let r=J8.default.parse(BOe(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function WOe(t,e){let r=t.features.length;if(r{"use strict";J8=St(er(),1);wt();Zv="HOLLOW_GOVERNANCE",GOe=8;Y8={name:Zv,run:ZOe}});import{existsSync as Q8,readFileSync as e5}from"node:fs";import{join as t5}from"node:path";function r5(t,e){let r=t.match(e);if(!r)return null;try{let n=JSON.parse(r[1]),i={};for(let[o,s]of Object.entries(n))typeof s=="string"&&(i[o]=s);return i}catch{return null}}function YOe(t){switch(t){case"fail":case"wiring-fail":return 0;case"wiring-ok":case"wiring-only":return 1;case"verified":return 2;default:return null}}function XOe(t){switch(t){case"wiring-only":return 1;case"verified":return 2;default:return null}}function QOe(t){let e=t5(t,"README.md"),r=t5(t,"docs","dogfood","matrix.md");if(!Q8(e)||!Q8(r))return[];let n=r5(e5(e,"utf8"),KOe),i=r5(e5(r,"utf8"),JOe);if(!n||!i)return[];let o=[];for(let[s,a]of Object.entries(n)){let c=XOe(a);if(c===null)continue;let l=i[s]??"not-run",u=YOe(l);u!==null&&c>u&&o.push({detector:n5,severity:"warn",path:"README.md",message:`README host-claims: '${s}' claims '${a}' but the newest matrix evidence is '${l}' \u2014 the claim exceeds the evidence. Re-run \`clad doctor --hosts\` (with consent) or lower the README claim for '${s}'.`})}return o}function eRe(t){let{cwd:e="."}=t;return QOe(e)}var n5,KOe,JOe,i5,o5=y(()=>{"use strict";n5="HOST_CLAIM_DRIFT",KOe=//,JOe=//;i5={name:n5,run:eRe}});function tRe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=[];return s5(r.features.map(i=>i.id),"feature","spec/features/",n),s5((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function s5(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:a5,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var a5,c5,l5=y(()=>{"use strict";Ue();a5="ID_COLLISION";c5={name:a5,run:tRe}});import{existsSync as $p,readFileSync as XP,readdirSync as QP,statSync as rRe,writeFileSync as d5}from"node:fs";import{join as Eo}from"node:path";function u5(t){if(!$p(t))return 0;try{return QP(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function nRe(t){if(!$p(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=QP(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=Eo(n,o),a;try{a=rRe(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function iRe(t){let e=Eo(t,"spec","capabilities.yaml");if(!$p(e))return 0;try{let r=Vv.default.parse(XP(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function _s(t="."){let e=u5(Eo(t,"spec","features")),r=u5(Eo(t,"spec","scenarios")),n=iRe(t),i=nRe(Eo(t,"tests"));return{features:e,scenarios:r,capabilities:n,test_files:i}}function Vl(t,e){let r=Eo(t,"spec.yaml");if(!$p(r))return;let n=XP(r,"utf8"),i=oRe(n,e);i!==n&&d5(r,i)}function oRe(t,e){let r=t.includes(`\r + if (condition) { yield value; }`)}});import{Buffer as Uxe}from"node:buffer";import{StringDecoder as qxe}from"node:string_decoder";var tv,Bxe,Hxe,Gxe,_I=y(()=>{nn();tv=(t,e,r)=>{if(r)return;if(t)return{transform:Bxe.bind(void 0,new TextEncoder)};let n=new qxe(e);return{transform:Hxe.bind(void 0,n),final:Gxe.bind(void 0,n)}},Bxe=function*(t,e){Uxe.isBuffer(e)?yield _o(e):typeof e=="string"?yield t.encode(e):yield e},Hxe=function*(t,e){yield qt(e)?t.write(e):e},Gxe=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as YW}from"node:util";var bI,rv,XW,Zxe,QW,Vxe,e3=y(()=>{bI=YW(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),rv=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Vxe}=e[r];for await(let i of n(t))yield*rv(i,e,r+1)},XW=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Zxe(r,Number(e),t)},Zxe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*rv(n,r,e+1)},QW=YW(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Vxe=function*(t){yield t}});var vI,t3,Ma,op,Wxe,Kxe,SI=y(()=>{vI=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},t3=(t,e)=>[...e.flatMap(r=>[...Ma(r,t,0)]),...op(t)],Ma=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Kxe}=e[r];for(let i of n(t))yield*Ma(i,e,r+1)},op=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Wxe(r,Number(e),t)},Wxe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ma(n,r,e+1)},Kxe=function*(t){yield t}});import{Transform as Jxe,getDefaultHighWaterMark as r3}from"node:stream";var wI,nv,n3,iv=y(()=>{Sr();ev();JW();_I();e3();SI();wI=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=n3(t,s,o),l=ja(e),u=ja(r),d=l?bI.bind(void 0,rv,a):vI.bind(void 0,Ma),f=l||u?bI.bind(void 0,XW,a):vI.bind(void 0,op),p=l||u?QW.bind(void 0,a):void 0;return{stream:new Jxe({writableObjectMode:n,writableHighWaterMark:r3(n),readableObjectMode:i,readableHighWaterMark:r3(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},nv=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=n3(s,r,a);t=t3(c,t)}return t},n3=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:VW(n,a)},tv(r,s,n),Qb(r,o,n,c),{transform:t,final:e},{transform:WW(i,a)},ZW({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var i3,Yxe,Xxe,Qxe,e0e,o3=y(()=>{iv();nn();Sr();i3=(t,e)=>{for(let r of Yxe(t))Xxe(t,r,e)},Yxe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Xxe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ps[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>Qxe(a,n));r.input=Bf(s)},Qxe=(t,e)=>{let r=nv(t,e,"utf8",!0);return e0e(r),Bf(r)},e0e=t=>{let e=t.find(r=>typeof r!="string"&&!qt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var ov,t0e,r0e,s3,a3,n0e,c3,xI=y(()=>{Pa();Sr();El();ls();ov=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&kl(r,n)&&!on.has(e)&&t0e(n)&&(t.some(({type:i,value:o})=>i==="native"&&r0e.has(o))||t.every(({type:i})=>On.has(i))),t0e=t=>t===1||t===2,r0e=new Set(["pipe","overlapped"]),s3=async(t,e,r,n)=>{for await(let i of t)n0e(e)||c3(i,r,n)},a3=(t,e,r)=>{for(let n of t)c3(n,e,r)},n0e=t=>t._readableState.pipes.length>0,c3=(t,e,r)=>{let n=ib(t);Pi({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as i0e,appendFileSync as o0e}from"node:fs";var l3,s0e,a0e,c0e,l0e,u0e,u3=y(()=>{xI();iv();ev();nn();Sr();Na();l3=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>s0e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},s0e=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=WV(t,o,d),p=_o(f),{stdioItems:m,objectMode:h}=e[r],g=a0e([p],m,c,n),{serializedResult:b,finalResult:_=b}=c0e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});l0e({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&u0e(b,m,i),S}catch(x){return n.error=x,S}},a0e=(t,e,r,n)=>{try{return nv(t,e,r,!1)}catch(i){return n.error=i,t}},c0e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Bf(t)};let s=FG(t,r);return n[o]?{serializedResult:s,finalResult:yI(s,!i[o],e)}:{serializedResult:s}},l0e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!ov({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=yI(t,!1,s);try{a3(a,e,n)}catch(c){r.error??=c}},u0e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>Jb.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?o0e(n,t):(r.add(o),i0e(n,t))}}});var d3,f3=y(()=>{nn();ip();d3=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,xo(e,r,"all")]:Array.isArray(e)?[xo(t,r,"all"),...e]:qt(t)&&qt(e)?fR([t,e]):`${t}${e}`}});import{once as $I}from"node:events";var p3,d0e,m3,h3,f0e,kI,EI=y(()=>{Ra();p3=async(t,e)=>{let[r,n]=await d0e(t);return e.isForcefullyTerminated??=!1,[r,n]},d0e=async t=>{let[e,r]=await Promise.allSettled([$I(t,"spawn"),$I(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?m3(t):r.value},m3=async t=>{try{return await $I(t,"exit")}catch{return m3(t)}},h3=async t=>{let[e,r]=await t;if(!f0e(e,r)&&kI(e,r))throw new ei;return[e,r]},f0e=(t,e)=>t===void 0&&e===void 0,kI=(t,e)=>t!==0||e!==null});var g3,p0e,y3=y(()=>{Ra();Na();EI();g3=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=p0e(t,e,r),s=o?.code==="ETIMEDOUT",a=VV(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},p0e=(t,e,r)=>t!==void 0?t:kI(e,r)?new ei:void 0});import{spawnSync as m0e}from"node:child_process";var _3,h0e,g0e,y0e,sv,_0e,b0e,v0e,S0e,b3=y(()=>{SR();KR();JR();np();Vb();BW();ip();o3();u3();Na();f3();y3();_3=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=h0e(t,e,r),d=_0e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Ml(d,c,l)},h0e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ab(t,e,r),a=g0e(r),{file:c,commandArguments:l,options:u}=Db(t,e,a);y0e(u);let d=UW(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},g0e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,y0e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&sv("ipcInput"),t&&sv("ipc: true"),r&&sv("detached: true"),n&&sv("cancelSignal")},sv=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},_0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=b0e({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=g3(c,r),{output:m,error:h=l}=l3({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>xo(_,r,S)),b=xo(d3(m,r),r,"all");return S0e({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},b0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{i3(o,r);let a=v0e(r);return m0e(...Nb(t,e,a))}catch(a){return jl({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},v0e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Gb(e)}),S0e=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?Zb({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):rp({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as AI,on as w0e}from"node:events";var v3,x0e,$0e,k0e,E0e,S3=y(()=>{Il();Yf();Jf();v3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(Ol({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Ab(t)}),x0e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),x0e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{vb(e,i);let o=fs(t,e,r),s=new AbortController;try{return await Promise.race([$0e(o,n,s),k0e(o,r,s),E0e(o,r,s)])}catch(a){throw Rl(t),a}finally{s.abort(),Sb(e,i)}},$0e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await AI(t,"message",{signal:r});return n}for await(let[n]of w0e(t,"message",{signal:r}))if(e(n))return n},k0e=async(t,e,{signal:r})=>{await AI(t,"disconnect",{signal:r}),P9(e)},E0e=async(t,e,{signal:r})=>{let[n]=await AI(t,"strict:error",{signal:r});throw gb(n,e)}});import{once as x3,on as A0e}from"node:events";var $3,TI,T0e,O0e,R0e,w3,OI=y(()=>{Il();Yf();Jf();$3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>TI({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),TI=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{Ol({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Ab(t)}),vb(e,o);let s=fs(t,e,r),a=new AbortController,c={};return T0e(t,s,a),O0e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),R0e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},T0e=async(t,e,r)=>{try{await x3(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},O0e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await x3(t,"strict:error",{signal:r.signal});n.error=gb(i,e),r.abort()}catch{}},R0e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of A0e(r,"message",{signal:o.signal}))w3(s),yield c}catch{w3(s)}finally{o.abort(),Sb(e,a),n||Rl(t),i&&await t}},w3=({error:t})=>{if(t)throw t}});import k3 from"node:process";var E3,A3,T3,RI=y(()=>{Pb();S3();OI();kb();E3=(t,{ipc:e})=>{Object.assign(t,T3(t,!1,e))},A3=()=>{let t=k3,e=!0,r=k3.channel!==void 0;return{...T3(t,e,r),getCancelSignal:sV.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},T3=(t,e,r)=>({sendMessage:Ib.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:v3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:$3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as I0e}from"node:child_process";import{PassThrough as P0e,Readable as C0e,Writable as D0e,Duplex as N0e}from"node:stream";var O3,j0e,sp,M0e,F0e,L0e,z0e,R3=y(()=>{Xb();np();Vb();O3=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{mI(n);let a=new I0e;j0e(a,n),Object.assign(a,{readable:M0e,writable:F0e,duplex:L0e});let c=jl({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=z0e(c,s,i);return{subprocess:a,promise:l}},j0e=(t,e)=>{let r=sp(),n=sp(),i=sp(),o=Array.from({length:e.length-3},sp),s=sp(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},sp=()=>{let t=new P0e;return t.end(),t},M0e=()=>new C0e({read(){}}),F0e=()=>new D0e({write(){}}),L0e=()=>new N0e({read(){},write(){}}),z0e=async(t,e,r)=>Ml(t,e,r)});import{createReadStream as I3,createWriteStream as P3}from"node:fs";import{Buffer as U0e}from"node:buffer";import{Readable as ap,Writable as q0e,Duplex as B0e}from"node:stream";var D3,cp,C3,H0e,N3=y(()=>{iv();Xb();Sr();D3=(t,e)=>Yb(H0e,t,e,!1),cp=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ps[t]}.`)},C3={fileNumber:cp,generator:wI,asyncGenerator:wI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:B0e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},H0e={input:{...C3,fileUrl:({value:t})=>({stream:I3(t)}),filePath:({value:{file:t}})=>({stream:I3(t)}),webStream:({value:t})=>({stream:ap.fromWeb(t)}),iterable:({value:t})=>({stream:ap.from(t)}),asyncIterable:({value:t})=>({stream:ap.from(t)}),string:({value:t})=>({stream:ap.from(t)}),uint8Array:({value:t})=>({stream:ap.from(U0e.from(t))})},output:{...C3,fileUrl:({value:t})=>({stream:P3(t)}),filePath:({value:{file:t,append:e}})=>({stream:P3(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:q0e.fromWeb(t)}),iterable:cp,asyncIterable:cp,string:cp,uint8Array:cp}}});import{on as G0e,once as j3}from"node:events";import{PassThrough as Z0e,getDefaultHighWaterMark as V0e}from"node:stream";import{finished as L3}from"node:stream/promises";function Fa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)PI(i);let e=t.some(({readableObjectMode:i})=>i),r=W0e(t,e),n=new II({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var W0e,II,K0e,J0e,Y0e,PI,X0e,Q0e,e$e,t$e,r$e,z3,U3,CI,q3,n$e,av,M3,F3,cv=y(()=>{W0e=(t,e)=>{if(t.length===0)return V0e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},II=class extends Z0e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(PI(e),this.#t.has(e))return;this.#t.add(e),this.#n??=K0e(this,this.#t,this.#o);let r=X0e({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(PI(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},K0e=async(t,e,r)=>{av(t,M3);let n=new AbortController;try{await Promise.race([J0e(t,n),Y0e(t,e,r,n)])}finally{n.abort(),av(t,-M3)}},J0e=async(t,{signal:e})=>{try{await L3(t,{signal:e,cleanup:!0})}catch(r){throw z3(t,r),r}},Y0e=async(t,e,r,{signal:n})=>{for await(let[i]of G0e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},PI=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},X0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{av(t,F3);let a=new AbortController;try{await Promise.race([Q0e(o,e,a),e$e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),t$e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),av(t,-F3)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?CI(t):r$e(t))},Q0e=async(t,e,{signal:r})=>{try{await t,r.aborted||CI(e)}catch(n){r.aborted||z3(e,n)}},e$e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await L3(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;U3(s)?i.add(e):q3(t,s)}},t$e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await j3(t,i,{signal:o}),!t.readable)return j3(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},r$e=t=>{t.writable&&t.end()},z3=(t,e)=>{U3(e)?CI(t):q3(t,e)},U3=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",CI=t=>{(t.readable||t.writable)&&t.destroy()},q3=(t,e)=>{t.destroyed||(t.once("error",n$e),t.destroy(e))},n$e=()=>{},av=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},M3=2,F3=1});import{finished as B3}from"node:stream/promises";var Ll,i$e,DI,o$e,NI,lv=y(()=>{bo();Ll=(t,e)=>{t.pipe(e),i$e(t,e),o$e(t,e)},i$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await B3(t,{cleanup:!0,readable:!0,writable:!1})}catch{}DI(e)}},DI=t=>{t.writable&&t.end()},o$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await B3(e,{cleanup:!0,readable:!1,writable:!0})}catch{}NI(t)}},NI=t=>{t.readable&&t.destroy()}});var H3,s$e,a$e,c$e,l$e,u$e,G3=y(()=>{cv();bo();bb();Sr();lv();H3=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>On.has(c)))s$e(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!On.has(c)))c$e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Fa(o);Ll(s,i)}},s$e=(t,e,r,n)=>{r==="output"?Ll(t.stdio[n],e):Ll(e,t.stdio[n]);let i=a$e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},a$e=["stdin","stdout","stderr"],c$e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;l$e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},l$e=(t,{signal:e})=>{Qn(t)&&Ia(t,u$e,e)},u$e=2});var La,Z3=y(()=>{La=[];La.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&La.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&La.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var uv,jI,MI,d$e,FI,dv,f$e,LI,zI,UI,V3,rat,nat,W3=y(()=>{Z3();uv=t=>!!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",jI=Symbol.for("signal-exit emitter"),MI=globalThis,d$e=Object.defineProperty.bind(Object),FI=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(MI[jI])return MI[jI];d$e(MI,jI,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},dv=class{},f$e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),LI=class extends dv{onExit(){return()=>{}}load(){}unload(){}},zI=class extends dv{#t=UI.platform==="win32"?"SIGINT":"SIGHUP";#r=new FI;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of La)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!uv(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of La)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,La.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return uv(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&uv(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},UI=globalThis.process,{onExit:V3,load:rat,unload:nat}=f$e(uv(UI)?new zI(UI):new LI)});import{addAbortListener as p$e}from"node:events";var K3,J3=y(()=>{W3();K3=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=V3(()=>{t.kill()});p$e(n,()=>{i()})}});var X3,m$e,h$e,Y3,g$e,Q3=y(()=>{dR();sb();ds();xl();X3=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=ob(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=m$e(r,n,i),{sourceStream:d,sourceError:f}=g$e(t,l),{options:p,fileDescriptors:m}=Di.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},m$e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=h$e(t,e,...r),a=_b(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},h$e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(Y3,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||lR(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=W_(r,...n);return{destination:e(Y3)(i,o,s),pipeOptions:s}}if(Di.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Y3=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),g$e=(t,e)=>{try{return{sourceStream:Cl(t,e)}}catch(r){return{sourceError:r}}}});var tK,y$e,qI,eK,BI=y(()=>{np();lv();tK=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=y$e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw qI({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},y$e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return NI(t),n;if(e!==void 0)return DI(r),e},qI=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>jl({error:t,command:eK,escapedCommand:eK,fileDescriptors:e,options:r,startTime:n,isSync:!1}),eK="source.pipe(destination)"});var rK,nK=y(()=>{rK=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as _$e}from"node:stream/promises";var iK,b$e,v$e,S$e,fv,w$e,x$e,oK=y(()=>{cv();bb();lv();iK=(t,e,r)=>{let n=fv.has(e)?v$e(t,e):b$e(t,e);return Ia(t,w$e,r.signal),Ia(e,x$e,r.signal),S$e(e),n},b$e=(t,e)=>{let r=Fa([t]);return Ll(r,e),fv.set(e,r),r},v$e=(t,e)=>{let r=fv.get(e);return r.add(t),r},S$e=async t=>{try{await _$e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}fv.delete(t)},fv=new WeakMap,w$e=2,x$e=1});import{aborted as $$e}from"node:util";var sK,k$e,aK=y(()=>{BI();sK=(t,e)=>t===void 0?[]:[k$e(t,e)],k$e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await $$e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw qI({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var pv,E$e,A$e,cK=y(()=>{yo();Q3();BI();nK();oK();aK();pv=(t,...e)=>{if(Ot(e[0]))return pv.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=X3(t,...e),i=E$e({...n,destination:r});return i.pipe=pv.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},E$e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=A$e(t,i);tK({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=iK(e,o,d);return await Promise.race([rK(u),...sK(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},A$e=(t,e)=>Promise.allSettled([t,e])});import{on as T$e}from"node:events";import{getDefaultHighWaterMark as O$e}from"node:stream";var mv,R$e,HI,I$e,uK,GI,lK,P$e,C$e,hv=y(()=>{_I();ev();SI();mv=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return R$e(e,s),uK({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},R$e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},HI=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;I$e(e,s,t);let a=t.readableObjectMode&&!o;return uK({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},I$e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},uK=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=T$e(t,"data",{signal:e.signal,highWaterMark:lK,highWatermark:lK});return P$e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},GI=O$e(!0),lK=GI,P$e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=C$e({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ma(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*op(a)}},C$e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[tv(t,r,!e),Qb(t,i,!n,{})].filter(Boolean)});import{setImmediate as D$e}from"node:timers/promises";var dK,N$e,j$e,M$e,ZI,fK,VI=y(()=>{Hb();nn();xI();hv();Na();ip();dK=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=N$e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([j$e(t),d]);return}let f=hI(c,r),p=HI({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([M$e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},N$e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!ov({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=HI({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await s3(a,t,r,o)},j$e=async t=>{await D$e(),t.readableFlowing===null&&t.resume()},M$e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await zb(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await Ub(r,{maxBuffer:o})):await Bb(r,{maxBuffer:o})}catch(a){return fK(HV({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},ZI=async t=>{try{return await t}catch(e){return fK(e)}},fK=({bufferedData:t})=>jG(t)?new Uint8Array(t):t});import{finished as F$e}from"node:stream/promises";var lp,L$e,z$e,U$e,q$e,B$e,WI,gv,pK,yv=y(()=>{lp=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=L$e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],F$e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||q$e(a,e,r,n)}finally{s.abort()}},L$e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&z$e(t,r,n),n},z$e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{U$e(e,r),n.call(t,...i)}},U$e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},q$e=(t,e,r,n)=>{if(!B$e(t,e,r,n))throw t},B$e=(t,e,r,n=!0)=>r.propagating?pK(t)||gv(t):(r.propagating=!0,WI(r,e)===n?pK(t):gv(t)),WI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",gv=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",pK=t=>t?.code==="EPIPE"});var mK,KI,JI=y(()=>{VI();yv();mK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>KI({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),KI=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=lp(t,e,l);if(WI(l,e)){await u;return}let[d]=await Promise.all([dK({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var hK,gK,H$e,G$e,YI=y(()=>{cv();JI();hK=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Fa([t,e].filter(Boolean)):void 0,gK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>KI({...H$e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:G$e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),H$e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},G$e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var yK,_K,bK=y(()=>{El();ls();yK=t=>kl(t,"ipc"),_K=(t,e)=>{let r=ib(t);Pi({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var vK,SK,wK=y(()=>{Na();bK();So();OI();vK=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=yK(o),a=vo(e,"ipc"),c=vo(r,"ipc");for await(let l of TI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(GV(t,i,c),i.push(l)),s&&_K(l,o);return i},SK=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as Z$e}from"node:events";var xK,V$e,W$e,K$e,$K=y(()=>{Da();HR();NR();BR();bo();Sr();VI();wK();ZR();YI();JI();EI();yv();xK=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:b})=>{let _=p3(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=mK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=gK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),O=[],T=vK({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),A=V$e(h,t,S),D=W$e(m,S);try{return await Promise.race([Promise.all([{},h3(_),Promise.all(x),w,T,gV(t,d),...A,...D]),g,K$e(t,b),...dV(t,o,f,b),...I9({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...lV({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch($){return f.terminationReason??="other",Promise.all([{error:$},_,Promise.all(x.map(ie=>ZI(ie))),ZI(w),SK(T,O),Promise.allSettled(A),Promise.allSettled(D)])}},V$e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:lp(n,i,r)),W$e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>ri(o,{checkOpen:!1})&&!Qn(o)).map(({type:i,value:o,stream:s=o})=>lp(s,n,e,{isSameDirection:On.has(i),stopOnExit:i==="native"}))),K$e=async(t,{signal:e})=>{let[r]=await Z$e(t,"error",{signal:e});throw r}});var kK,up,zl,_v=y(()=>{Pl();kK=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),up=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Ci();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},zl=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as EK}from"node:stream/promises";var XI,AK,QI,eP,bv,vv,tP=y(()=>{yv();XI=async t=>{if(t!==void 0)try{await QI(t)}catch{}},AK=async t=>{if(t!==void 0)try{await eP(t)}catch{}},QI=async t=>{await EK(t,{cleanup:!0,readable:!1,writable:!0})},eP=async t=>{await EK(t,{cleanup:!0,readable:!0,writable:!1})},bv=async(t,e)=>{if(await t,e)throw e},vv=(t,e,r)=>{r&&!gv(r)?t.destroy(r):e&&t.destroy()}});import{Readable as J$e}from"node:stream";import{callbackify as Y$e}from"node:util";var TK,rP,nP,iP,X$e,oP,sP,OK,aP=y(()=>{Pa();ds();hv();Pl();_v();tP();TK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||on.has(r),{subprocessStdout:a,waitReadableDestroy:c}=rP(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=nP(a,s),{read:f,onStdoutDataDone:p}=iP({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new J$e({read:f,destroy:Y$e(sP.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return oP({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},rP=(t,e,r)=>{let n=Cl(t,e),i=up(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},nP=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:GI},iP=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Ci(),s=mv({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){X$e(this,s,o)},onStdoutDataDone:o}},X$e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},oP=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await eP(t),await n,await XI(i),await e,r.readable&&r.push(null)}catch(o){await XI(i),OK(r,o)}},sP=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await zl(r,e)&&(OK(t,n),await bv(e,n))},OK=(t,e)=>{vv(t,t.readable,e)}});import{Writable as Q$e}from"node:stream";import{callbackify as RK}from"node:util";var IK,cP,lP,eke,tke,uP,dP,PK,fP=y(()=>{ds();_v();tP();IK=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=cP(t,r,e),s=new Q$e({...lP(n,t,i),destroy:RK(dP.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return uP(n,s),s},cP=(t,e,r)=>{let n=_b(t,e),i=up(r,n,"writableFinal"),o=up(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},lP=(t,e,r)=>({write:eke.bind(void 0,t),final:RK(tke.bind(void 0,t,e,r))}),eke=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},tke=async(t,e,r)=>{await zl(r,e)&&(t.writable&&t.end(),await e)},uP=async(t,e,r)=>{try{await QI(t),e.writable&&e.end()}catch(n){await AK(r),PK(e,n)}},dP=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await zl(r,e),await zl(n,e)&&(PK(t,i),await bv(e,i))},PK=(t,e)=>{vv(t,t.writable,e)}});import{Duplex as rke}from"node:stream";import{callbackify as nke}from"node:util";var CK,ike,DK=y(()=>{Pa();aP();fP();CK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||on.has(r),{subprocessStdout:c,waitReadableDestroy:l}=rP(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=cP(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=nP(c,a),{read:g,onStdoutDataDone:b}=iP({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new rke({read:g,...lP(u,t,d),destroy:nke(ike.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return oP({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),uP(u,_,c),_},ike=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([sP({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),dP({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var pP,oke,NK=y(()=>{Pa();ds();hv();pP=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||on.has(e),s=Cl(t,r),a=mv({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return oke(a,s,t)},oke=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var jK,MK=y(()=>{_v();aP();fP();DK();NK();jK=(t,{encoding:e})=>{let r=kK();t.readable=TK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=IK.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=CK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=pP.bind(void 0,t,e),t[Symbol.asyncIterator]=pP.bind(void 0,t,e,{})}});var FK,ske,ake,LK=y(()=>{FK=(t,e)=>{for(let[r,n]of ake){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},ske=(async()=>{})().constructor.prototype,ake=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(ske,t)])});import{setMaxListeners as cke}from"node:events";import{spawn as lke}from"node:child_process";var zK,uke,dke,fke,pke,mke,UK=y(()=>{Hb();SR();KR();ds();JR();RI();np();Vb();R3();N3();ip();G3();mb();J3();cK();YI();$K();MK();Pl();LK();zK=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=uke(t,e,r),{subprocess:f,promise:p}=fke({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=pv.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),FK(f,p),Di.set(f,{options:u,fileDescriptors:d}),f},uke=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ab(t,e,r),{file:a,commandArguments:c,options:l}=Db(t,e,r),u=dke(l),d=D3(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},dke=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},fke=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=lke(...Nb(t,e,r))}catch(m){return O3({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;cke(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];H3(c,a,l),K3(c,r,l);let d={},f=Ci();c.kill=O9.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=hK(c,r),jK(c,r),E3(c,r);let p=pke({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},pke=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await xK({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map((x,w)=>xo(x,e,w)),_=xo(h,e,"all"),S=mke({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Ml(S,n,e)},mke=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?rp({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Ni,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):Zb({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var Sv,hke,gke,qK=y(()=>{yo();So();Sv=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,hke(n,t[n],i)]));return{...t,...r}},hke=(t,e,r)=>gke.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,gke=new Set(["env",...gR])});var ms,yke,_ke,BK=y(()=>{yo();dR();HG();b3();UK();qK();ms=(t,e,r,n)=>{let i=(s,a,c)=>ms(s,a,r,c),o=(...s)=>yke({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},yke=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Ot(o))return i(t,Sv(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=_ke({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?_3(a,c,l):zK(a,c,l,i)},_ke=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=qG(e)?BG(e,r):[e,...r],[s,a,c]=W_(...o),l=Sv(Sv(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var HK,GK,ZK,bke,vke,VK=y(()=>{HK=({file:t,commandArguments:e})=>ZK(t,e),GK=({file:t,commandArguments:e})=>({...ZK(t,e),isSync:!0}),ZK=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=bke(t);return{file:r,commandArguments:n}},bke=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(vke)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},vke=/ +/g});var WK,KK,Ske,JK,wke,YK,XK=y(()=>{WK=(t,e,r)=>{t.sync=e(Ske,r),t.s=t.sync},KK=({options:t})=>JK(t),Ske=({options:t})=>({...JK(t),isSync:!0}),JK=t=>({options:{...wke(t),...t}}),wke=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},YK={preferLocal:!0}});var Zlt,We,Vlt,Wlt,Klt,Jlt,Ylt,Xlt,Qlt,eut,Mr=y(()=>{BK();VK();GR();XK();RI();Zlt=ms(()=>({})),We=ms(()=>({isSync:!0})),Vlt=ms(HK),Wlt=ms(GK),Klt=ms(pV),Jlt=ms(KK,{},YK,WK),{sendMessage:Ylt,getOneMessage:Xlt,getEachMessage:Qlt,getCancelSignal:eut}=A3()});import{existsSync as wv,statSync as xke}from"node:fs";import{dirname as mP,extname as $ke,isAbsolute as QK,join as hP,relative as gP,resolve as xv,sep as kke}from"node:path";function $v(t){return t==="./gradlew"||t==="gradle"}function Eke(t){return(wv(hP(t,"build.gradle.kts"))||wv(hP(t,"build.gradle")))&&wv(hP(t,"gradle.properties"))}function Ake(t,e){let n=gP(t,e).split(kke).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function hs(t,e){return t===":"?`:${e}`:`${t}:${e}`}function Tke(t,e){let r=xv(t,e),n=r;wv(r)?xke(r).isFile()&&(n=mP(r)):$ke(r)!==""&&(n=mP(r));let i=gP(t,n);if(i.startsWith("..")||QK(i))return null;let o=n;for(;;){if(Eke(o))return o;if(xv(o)===xv(t))return null;let s=mP(o);if(s===o)return null;let a=gP(t,s);if(a.startsWith("..")||QK(a))return null;o=s}}function kv(t,e){let r=xv(t),n=new Map,i=[];for(let o of e){let s=Tke(r,o);if(!s){i.push(o);continue}let a=Ake(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var Ev=y(()=>{"use strict"});import{existsSync as _P,readFileSync as Oke}from"node:fs";import{join as Ul}from"node:path";function ql(t="."){let e=Ul(t,".cladding","config.yaml");if(!_P(e))return yP;try{let n=(0,eJ.parse)(Oke(e,"utf8"))?.gate;if(!n)return yP;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of Rke){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return yP}}function tJ(t="."){let e=ql(t).testReport,r=e?[e,...bP]:bP;return[...new Set(r.map(n=>Ul(t,n)))]}function rJ(t="."){let e=ql(t).testReport;if(e){let r=Ul(t,e);return _P(r)?r:null}return bP.map(r=>Ul(t,r)).find(r=>_P(r))??null}function nJ(t,e){let r=[],n=!1;for(let i of t){let o=Ike.exec(i);if(o){n=!0;for(let s of e)r.push(hs(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var eJ,Rke,yP,bP,Ike,dp=y(()=>{"use strict";eJ=St(er(),1);Ev();Rke=["type","lint","test","coverage"],yP={scope:"feature"},bP=["test-report.junit.xml",Ul("coverage","junit.xml"),Ul(".cladding","test-report.junit.xml")];Ike=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as SP,readFileSync as iJ,readdirSync as Pke,statSync as Cke}from"node:fs";import{join as Av}from"node:path";function $P(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=Av(t,e);if(SP(r))try{if(oJ.test(iJ(r,"utf8")))return!0}catch{}}return!1}function sJ(t){try{return SP(t)&&oJ.test(iJ(t,"utf8"))}catch{return!1}}function aJ(t,e=0){if(e>4||!SP(t))return!1;let r;try{r=Pke(t)}catch{return!1}for(let n of r){let i=Av(t,n),o=!1;try{o=Cke(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(aJ(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&sJ(i))return!0}return!1}function jke(t){if($P(t))return!0;for(let e of Dke)if(sJ(Av(t,e)))return!0;for(let e of Nke)if(aJ(Av(t,e)))return!0;return!1}function cJ(t="."){let e=ql(t).coverage;return e||(jke(t)?"kover":"jacoco")}function lJ(t="."){return wP[cJ(t)]}function uJ(t="."){return vP[cJ(t)]}var wP,vP,xP,oJ,Dke,Nke,Tv=y(()=>{"use strict";dp();wP={kover:"koverXmlReport",jacoco:"jacocoTestReport"},vP={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},xP=[vP.kover,vP.jacoco],oJ=/kover/i;Dke=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],Nke=["buildSrc","build-logic"]});import{existsSync as pp,readFileSync as fJ,readdirSync as pJ}from"node:fs";import{join as gs}from"node:path";function EP(t){return pp(gs(t,"gradlew"))?"./gradlew":"gradle"}function Mke(t){let e=EP(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[lJ(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function Fke(t){let e=!1;try{e=/(^|\n)\s*flutter\s*:|sdk:\s*flutter/.test(fJ(gs(t,"pubspec.yaml"),"utf8"))}catch{}let r={cmd:"dart",args:["format","--output=none","--set-exit-if-changed","."]},n={cmd:"gitleaks",args:["detect","--no-banner"]};return e?{type:{cmd:"flutter",args:["analyze"]},lint:r,test:{cmd:"flutter",args:["test"]},coverage:{cmd:"flutter",args:["test","--coverage"]},secret:n}:{type:{cmd:"dart",args:["analyze"]},lint:r,test:{cmd:"dart",args:["test"]},coverage:{cmd:"dart",args:["test","--coverage=coverage"]},secret:n}}function zke(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function Bke(t,e){for(let r of e)if(pp(gs(t,r)))return r}function Hke(t,e){try{return pJ(t).find(n=>n.endsWith(e))}catch{return}}function Vke(t){try{return JSON.parse(fJ(gs(t,"package.json"),"utf8"))}catch{return{}}}function fp(t,e){let r=t.scripts?.[e];return typeof r=="string"&&r.trim().length>0?r.trim():void 0}function dJ(t,e){return[t.dependencies,t.devDependencies,t.optionalDependencies,t.peerDependencies].some(r=>r?.[e]!==void 0)}function Wke(t,e,r){if(fp(r,"lint"))return{cmd:"npm",args:["run","--silent","lint"]};for(let n of Gke)if(n.configs.some(i=>pp(gs(t,i))))return n.gate;if(Zke.some(n=>pp(gs(t,n)))||r.eslintConfig!==void 0)return e}function Jke(t,e){return Kke.some(r=>pp(gs(t,r)))?!0:e.jest!==void 0}function Yke(t){if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?vitest(?:\s+run)?$/i.test(t))return"vitest";if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?jest$/i.test(t))return"jest"}function kP(t,e){let r={...t};return e==="lint"?delete r.lint:delete r.coverage,r}function Xke(t,e){let r=Vke(t),n=e.lint?Wke(t,e.lint,r):void 0,i=n?{...e,lint:n}:kP(e,"lint"),o=fp(r,"test"),s=o?Yke(o):void 0;return o&&!s?(i=kP(i,"coverage"),{...i,test:{cmd:"npm",args:["test"]},...fp(r,"coverage")?{coverage:{cmd:"npm",args:["run","--silent","coverage"]}}:{}}):s==="jest"||!o&&Jke(t,r)?{...i,test:{cmd:"npx",args:[...Mi,"jest"]},coverage:{cmd:"npx",args:[...Mi,"jest","--coverage"]}}:(s==="vitest"&&!fp(r,"coverage")&&!dJ(r,"@vitest/coverage-v8")&&!dJ(r,"@vitest/coverage-istanbul")?i=kP(i,"coverage"):s==="vitest"&&fp(r,"coverage")&&(i={...i,coverage:{cmd:"npm",args:["run","--silent","coverage"]}}),i)}function dt(t="."){for(let e of Uke){let r;for(let o of e.manifests)if(o.startsWith(".")?r=Hke(t,o):r=Bke(t,[o]),r)break;if(!r||e.requiresSource&&!zke(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"?Xke(t,n):n;return{language:e.language,manifest:r,gates:i}}return qke}var Mi,Lke,Uke,qke,Gke,Zke,Kke,sn=y(()=>{"use strict";Tv();Mi=["--offline","--no-install"];Lke=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);Uke=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:[...Mi,"tsc","--noEmit"]},lint:{cmd:"npx",args:[...Mi,"eslint","."]},test:{cmd:"npx",args:[...Mi,"vitest","run"]},coverage:{cmd:"npx",args:[...Mi,"vitest","run","--coverage"]},secret:{cmd:"npx",args:[...Mi,"secretlint","**/*"]},arch:{cmd:"npx",args:[...Mi,"madge","--circular","--extensions","ts,tsx,js,jsx","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:Mke},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"swift",manifests:["Package.swift"],gates:{type:{cmd:"swift",args:["build"]},lint:{cmd:"swiftlint",args:["lint"]},test:{cmd:"swift",args:["test"]},coverage:{cmd:"swift",args:["test","--enable-code-coverage"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dart",manifests:["pubspec.yaml"],gates:Fke}],qke={language:"unknown",manifest:"",gates:{}};Gke=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:[...Mi,"biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:[...Mi,"oxlint"]}}],Zke=["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts",".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"];Kke=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs","jest.config.json"]});import{existsSync as Qke,readFileSync as eEe}from"node:fs";import{join as tEe}from"node:path";function za(t){return t.code==="ENOENT"}function Ov(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return mJ.test(o)||mJ.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function Nt(t,e,r,n=[]){if(za(r))return{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`};let i=`${String(r.stderr??"")} +${String(r.stdout??"")}`,o=/ENOTCACHED|ENOTFOUND|EAI_AGAIN|canceled due to missing packages|could not determine executable/i.test(i),a=n.find(l=>l!=="--"&&!l.startsWith("-"))?.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=r.exitCode===127&&a!==void 0&&new RegExp(`(?:^|[\\s:])${a}: (?:command )?not found\\b`,"i").test(i);return e==="npx"&&(o||c)?{stage:t,pass:!1,exitCode:2,stderr:"setup gap: 'npx' could not resolve the configured tool without installing it; the inferred tool is not installed or unavailable offline"}:null}function Yt(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Bl(t,e){let r=tEe(t,"package.json");if(!Qke(r))return!1;try{return!!JSON.parse(eEe(r,"utf8")).scripts?.[e]}catch{return!1}}var mJ,Rn=y(()=>{"use strict";mJ=/config (is |file )?not found|no such file|ENOENT|ENOTCACHED|ENOTFOUND|EAI_AGAIN|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function rEe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.arch;if(!n)return[{detector:Rv,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=We(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Rv,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:Ov(i,Rv,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var Rv,Ua,Iv=y(()=>{"use strict";Mr();sn();Rn();Rv="ARCHITECTURE_VIOLATION";Ua={name:Rv,subprocess:!0,run:rEe}});function nEe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.secret;if(!n)return[{detector:Pv,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=We(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Pv,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:Ov(i,Pv,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var Pv,qa,Cv=y(()=>{"use strict";Mr();sn();Rn();Pv="HARDCODED_SECRET";qa={name:Pv,subprocess:!0,run:nEe}});import{existsSync as AP,readdirSync as hJ}from"node:fs";import{join as Dv}from"node:path";function oEe(t,e){let r=Dv(t,e.path);if(!AP(r))return!0;if(e.isDirectory)try{return hJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function sEe(t){let{cwd:e="."}=t,r=[];for(let i of iEe)oEe(e,i)&&r.push({detector:mp,severity:i.severity,path:i.path,message:`${i.path} is absent \u2014 cladding scaffold incomplete (${i.purpose}). Run \`clad init --intent ""\` to populate it.`});let n=Dv(e,"spec.yaml");if(AP(n)){let i=lEe(n),o=i?null:aEe(e);if(i)r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present but unreadable (${i}) \u2014 cladding is governing nothing. Fix the SSoT root, then \`clad sync\` to validate.`});else if(o)r.push({detector:mp,severity:"error",path:o.path,message:`spec shard '${o.path}' is present but unparseable (${o.reason}) \u2014 loadSpec throws on it, so every spec-gated detector silently passes. Fix it, then \`clad sync\`.`});else{let s=cEe(e);s&&r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present and parses, but the assembled spec does not load (${s}) \u2014 every spec-gated detector then degrades to non-blocking info, so the gate would pass GREEN on an unloadable SSoT. Fix it, then \`clad sync\` to validate.`})}}return r}function aEe(t){for(let e of["spec/features","spec/scenarios"]){let r=Dv(t,e);if(!AP(r))continue;let n;try{n=hJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{Oi(Dv(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function cEe(t){try{return q(t),null}catch(e){return e.message}}function lEe(t){let e;try{e=Oi(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var mp,iEe,gJ,yJ=y(()=>{"use strict";Ue();F_();mp="ABSENCE_OF_GOVERNANCE",iEe=[{path:"spec.yaml",severity:"error",purpose:"SSoT root \u2014 every spec-gated detector needs it"},{path:"spec/architecture.yaml",severity:"warn",purpose:"architecture invariants (layers + forbidden_imports)"},{path:"spec/capabilities.yaml",severity:"warn",purpose:"capability \u2194 feature traceability"},{path:"docs/project-context.md",severity:"warn",purpose:"intent narrative + decision history"},{path:"docs/conventions.md",severity:"info",purpose:"project style guide (recommended)"},{path:"spec/scenarios",severity:"info",purpose:"user-journey scenarios (recommended)",isDirectory:!0}];gJ={name:mp,run:sEe}});function Nv(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function TP(t,e){let r=e?.trim()??"";if(!t)return r.length>0?"condition is present but ears pattern is not declared":null;if(t==="ubiquitous")return r.length>0?`ears='ubiquitous' but condition is present ('${r.slice(0,40)}\u2026')`:null;if(t==="complex"){if(r.length===0)return"ears='complex' requires a 'while' precondition and a 'when' trigger \u2014 empty";let i=Nv(r)==="while",o=dEe.test(r);return i?o?null:"ears='complex' requires a 'when' trigger clause after the 'while' precondition \u2014 none found":`ears='complex' requires the condition to start with 'while' (precondition) \u2014 got '${Nv(r)}'`}let n=uEe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:Nv(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${Nv(r)}'`:null}function fEe(t,e){let r=TP(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function _J(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...fEe(r,n));return e}var uEe,dEe,OP=y(()=>{"use strict";uEe={event:"when",state:"while",optional:"where",unwanted:"if"},dEe=/\bwhen\b/i});function ge(t,e,r){let n;try{n=q(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var wt=y(()=>{"use strict";Ue()});function pEe(t){let{cwd:e="."}=t;return ge(e,jv,mEe)}function mEe(t){let e=[];for(let r of t.features)for(let n of r.acceptance_criteria??[]){let i=!!n.text?.trim(),o=!!(n.condition?.trim()||n.action?.trim()||n.response?.trim());!i&&!o&&e.push({detector:jv,severity:"error",message:`${r.id}.${n.id} has neither rendered text nor any EARS field (condition/action/response) \u2014 structurally empty AC`})}for(let r of _J(t.features))e.push({detector:jv,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var jv,bJ,vJ=y(()=>{"use strict";OP();wt();jv="AC_DRIFT";bJ={name:jv,run:pEe}});function Fi(t=".",e){let n=(e??"").trim().toLowerCase()||dt(t).language;return wJ[n]??SJ}var hEe,gEe,yEe,SJ,_Ee,bEe,wJ,vEe,xJ,Ba=y(()=>{"use strict";sn();hEe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,gEe=/^[ \t]*import\s+([\w.]+)/gm,yEe=/^[ \t]*(?:from|import)\s+([\w.]+)/gm,SJ={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:hEe,importStyle:"relative"},_Ee={ext:"kt",extensions:[".kt",".kts"],sourceRoots:["src/main/kotlin","src/test/kotlin"],mainRoot:"src/main/kotlin",testGlobs:["src/test/kotlin/**/*Test.kt","src/test/kotlin/**/*Tests.kt"],coverageSummary:"build/reports/jacoco/test/jacocoTestReport.xml",coverageFormat:"jacoco-xml",importMatcher:gEe,importStyle:"dotted"},bEe={ext:"py",extensions:[".py"],sourceRoots:["."],mainRoot:"src",testGlobs:["tests/test_*.py","tests/**/test_*.py","tests/**/*_test.py"],coverageSummary:"coverage.xml",coverageFormat:"cobertura-xml",importMatcher:yEe,importStyle:"dotted"},wJ={typescript:SJ,kotlin:_Ee,python:bEe},vEe=[".js",".jsx",".mts",".cts",".rs",".go",".java",".rb",".php",".cs",".fs",".ex",".exs"],xJ=new Set([...Object.values(wJ).flatMap(t=>t?.extensions??[]),...vEe].map(t=>t.toLowerCase()))});import{existsSync as SEe,readFileSync as wEe,readdirSync as xEe,statSync as $Ee}from"node:fs";import{join as kJ,relative as $J}from"node:path";function kEe(t,e){if(!SEe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=xEe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=kJ(i,s),c;try{c=$Ee(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function EEe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function TEe(t){return AEe.test(t)}function OEe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=Fi(e,r.project?.language),o=i.sourceRoots.flatMap(a=>kEe(kJ(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=wEe(a,"utf8")}catch{continue}let l=c.split(` +`);for(let u=0;u{"use strict";Ue();Ba();EJ="AI_HINTS_FORBIDDEN_PATTERN";AEe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;AJ={name:EJ,run:OEe}});function REe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:OJ,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var OJ,RJ,IJ=y(()=>{"use strict";Ue();OJ="AC_DUPLICATE_WITHIN_FEATURE";RJ={name:OJ,run:REe}});import{createRequire as IEe}from"module";import{basename as PEe,dirname as IP,normalize as CEe,relative as DEe,resolve as NEe,sep as DJ}from"path";import*as jEe from"fs";function MEe(t){let e=CEe(t);return e.length>1&&e[e.length-1]===DJ&&(e=e.substring(0,e.length-1)),e}function NJ(t,e){return t.replace(FEe,e)}function zEe(t){return t==="/"||LEe.test(t)}function RP(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=NEe(t)),(n||o)&&(t=MEe(t)),t===".")return"";let s=t[t.length-1]!==i;return NJ(s?t+i:t,i)}function jJ(t,e){return e+t}function UEe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:NJ(DEe(t,n),e.pathSeparator)+e.pathSeparator+r}}function qEe(t){return t}function BEe(t,e,r){return e+t+r}function HEe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?UEe(t,e):n?jJ:qEe}function GEe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function ZEe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function JEe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?ZEe(t):GEe(t):n&&n.length?WEe:VEe:KEe}function rAe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?tAe:r&&r.length?n?YEe:XEe:n?QEe:eAe}function oAe(t){return t.group?iAe:nAe}function cAe(t){return t.group?sAe:aAe}function dAe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?uAe:lAe}function MJ(t,e,r){if(r.options.useRealPaths)return fAe(e,r);let n=IP(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=IP(n)}return r.symlinks.set(t,e),i>1}function fAe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function Mv(t,e,r,n){e(t&&!n?t:null,r)}function SAe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?pAe:yAe:n?e?mAe:vAe:i?e?gAe:bAe:e?hAe:_Ae}function $Ae(t){return t?xAe:wAe}function TAe(t,e){return new Promise((r,n)=>{zJ(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function zJ(t,e,r){new LJ(t,e,r).start()}function OAe(t,e){return new LJ(t,e).start()}var PJ,FEe,LEe,VEe,WEe,KEe,YEe,XEe,QEe,eAe,tAe,nAe,iAe,sAe,aAe,lAe,uAe,pAe,mAe,hAe,gAe,yAe,_Ae,bAe,vAe,FJ,wAe,xAe,kAe,EAe,AAe,LJ,CJ,UJ,qJ,BJ=y(()=>{PJ=IEe(import.meta.url);FEe=/[\\/]/g;LEe=/^[a-z]:[\\/]$/i;VEe=(t,e)=>{e.push(t||".")},WEe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},KEe=()=>{};YEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},XEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},QEe=(t,e,r,n)=>{r.files++},eAe=(t,e)=>{e.push(t)},tAe=()=>{};nAe=t=>t,iAe=()=>[""].slice(0,0);sAe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},aAe=()=>{};lAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&MJ(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},uAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&MJ(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};pAe=t=>t.counts,mAe=t=>t.groups,hAe=t=>t.paths,gAe=t=>t.paths.slice(0,t.options.maxFiles),yAe=(t,e,r)=>(Mv(e,r,t.counts,t.options.suppressErrors),null),_Ae=(t,e,r)=>(Mv(e,r,t.paths,t.options.suppressErrors),null),bAe=(t,e,r)=>(Mv(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),vAe=(t,e,r)=>(Mv(e,r,t.groups,t.options.suppressErrors),null);FJ={withFileTypes:!0},wAe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",FJ,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},xAe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",FJ)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};kAe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},EAe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},AAe=class{aborted=!1;abort(){this.aborted=!0}},LJ=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=SAe(e,this.isSynchronous),this.root=RP(t,e),this.state={root:zEe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new EAe,options:e,queue:new kAe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new AAe,fs:e.fs||jEe},this.joinPath=HEe(this.root,e),this.pushDirectory=JEe(this.root,e),this.pushFile=rAe(e),this.getArray=oAe(e),this.groupFiles=cAe(e),this.resolveSymlink=dAe(e,this.isSynchronous),this.walkDirectory=$Ae(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(b.isDirectory()){if(_=RP(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let S=PEe(_),x=RP(IP(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};CJ=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return TAe(this.root,this.options)}withCallback(t){zJ(this.root,this.options,t)}sync(){return OAe(this.root,this.options)}},UJ=null;try{PJ.resolve("picomatch"),UJ=PJ("picomatch")}catch{}qJ=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:DJ,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new CJ(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new CJ(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||UJ;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var hp=v((ndt,WJ)=>{"use strict";var HJ="[^\\\\/]",RAe="(?=.)",GJ="[^/]",PP="(?:\\/|$)",ZJ="(?:^|\\/)",CP=`\\.{1,2}${PP}`,IAe="(?!\\.)",PAe=`(?!${ZJ}${CP})`,CAe=`(?!\\.{0,1}${PP})`,DAe=`(?!${CP})`,NAe="[^.\\/]",jAe=`${GJ}*?`,MAe="/",VJ={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:RAe,QMARK:GJ,END_ANCHOR:PP,DOTS_SLASH:CP,NO_DOT:IAe,NO_DOTS:PAe,NO_DOT_SLASH:CAe,NO_DOTS_SLASH:DAe,QMARK_NO_DOT:NAe,STAR:jAe,START_ANCHOR:ZJ,SEP:MAe},FAe={...VJ,SLASH_LITERAL:"[\\\\/]",QMARK:HJ,STAR:`${HJ}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},LAe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};WJ.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:LAe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?FAe:VJ}}});var gp=v(Fr=>{"use strict";var{REGEX_BACKSLASH:zAe,REGEX_REMOVE_BACKSLASH:UAe,REGEX_SPECIAL_CHARS:qAe,REGEX_SPECIAL_CHARS_GLOBAL:BAe}=hp();Fr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Fr.hasRegexChars=t=>qAe.test(t);Fr.isRegexChar=t=>t.length===1&&Fr.hasRegexChars(t);Fr.escapeRegex=t=>t.replace(BAe,"\\$1");Fr.toPosixSlashes=t=>t.replace(zAe,"/");Fr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Fr.removeBackslashes=t=>t.replace(UAe,e=>e==="\\"?"":e);Fr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Fr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Fr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Fr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Fr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var r8=v((odt,t8)=>{"use strict";var KJ=gp(),{CHAR_ASTERISK:DP,CHAR_AT:HAe,CHAR_BACKWARD_SLASH:yp,CHAR_COMMA:GAe,CHAR_DOT:NP,CHAR_EXCLAMATION_MARK:jP,CHAR_FORWARD_SLASH:e8,CHAR_LEFT_CURLY_BRACE:MP,CHAR_LEFT_PARENTHESES:FP,CHAR_LEFT_SQUARE_BRACKET:ZAe,CHAR_PLUS:VAe,CHAR_QUESTION_MARK:JJ,CHAR_RIGHT_CURLY_BRACE:WAe,CHAR_RIGHT_PARENTHESES:YJ,CHAR_RIGHT_SQUARE_BRACKET:KAe}=hp(),XJ=t=>t===e8||t===yp,QJ=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},JAe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,b=!1,_=!1,S=!1,x=!1,w=!1,O=0,T,A,D={value:"",depth:0,isGlob:!1},$=()=>l>=n,ie=()=>c.charCodeAt(l+1),K=()=>(T=A,c.charCodeAt(++l));for(;l0&&(C=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),P=c.slice(d)):m===!0?(xe="",P=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&XJ(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(P&&(P=KJ.removeBackslashes(P)),xe&&_===!0&&(xe=KJ.removeBackslashes(xe)));let Ir={prefix:C,input:t,start:u,base:xe,glob:P,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&(Ir.maxDepth=0,XJ(A)||s.push(D),Ir.tokens=s),r.parts===!0||r.tokens===!0){let se;for(let Ce=0;Ce{"use strict";var _p=hp(),an=gp(),{MAX_LENGTH:Fv,POSIX_REGEX_SOURCE:YAe,REGEX_NON_SPECIAL_CHARS:XAe,REGEX_SPECIAL_CHARS_BACKREF:QAe,REPLACEMENTS:n8}=_p,eTe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>an.escapeRegex(i)).join("..")}return r},Hl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,i8=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},tTe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},o8=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(tTe(e))return e.replace(/\\(.)/g,"$1")},rTe=t=>{let e=t.map(o8).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},nTe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=o8(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?an.escapeRegex(r[0]):`[${r.map(i=>an.escapeRegex(i)).join("")}]`}*`},iTe=t=>{let e=0,r=t.trim(),n=LP(r);for(;n;)e++,r=n.body.trim(),n=LP(r);return e},oTe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:_p.DEFAULT_MAX_EXTGLOB_RECURSION,n=i8(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||rTe(n)))return{risky:!0};for(let i of n){let o=nTe(i);if(o)return{risky:!0,safeOutput:o};if(iTe(i)>r)return{risky:!0}}return{risky:!1}},zP=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=n8[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Fv,r.maxLength):Fv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=_p.globChars(r.windows),l=_p.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:b,QMARK:_,QMARK_NO_DOT:S,STAR:x,START_ANCHOR:w}=c,O=H=>`(${a}(?:(?!${w}${H.dot?m:u}).)*?)`,T=r.dot?"":h,A=r.dot?_:S,D=r.bash===!0?O(r):x;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let $={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=an.removePrefix(t,$),i=t.length;let ie=[],K=[],xe=[],C=o,P,Ir=()=>$.index===i-1,se=$.peek=(H=1)=>t[$.index+H],Ce=$.advance=()=>t[++$.index]||"",Kt=()=>t.slice($.index+1),dr=(H="",ht=0)=>{$.consumed+=H,$.index+=ht},Xt=H=>{$.output+=H.output!=null?H.output:H.value,dr(H.value)},lo=()=>{let H=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)Ce(),$.start++,H++;return H%2===0?!1:($.negated=!0,$.start++,!0)},$i=H=>{$[H]++,xe.push(H)},Xr=H=>{$[H]--,xe.pop()},de=H=>{if(C.type==="globstar"){let ht=$.braces>0&&(H.type==="comma"||H.type==="brace"),B=H.extglob===!0||ie.length&&(H.type==="pipe"||H.type==="paren");H.type!=="slash"&&H.type!=="paren"&&!ht&&!B&&($.output=$.output.slice(0,-C.output.length),C.type="star",C.value="*",C.output=D,$.output+=C.output)}if(ie.length&&H.type!=="paren"&&(ie[ie.length-1].inner+=H.value),(H.value||H.output)&&Xt(H),C&&C.type==="text"&&H.type==="text"){C.output=(C.output||C.value)+H.value,C.value+=H.value;return}H.prev=C,s.push(H),C=H},uo=(H,ht)=>{let B={...l[ht],conditions:1,inner:""};B.prev=C,B.parens=$.parens,B.output=$.output,B.startIndex=$.index,B.tokensIndex=s.length;let Oe=(r.capture?"(":"")+B.open;$i("parens"),de({type:H,value:ht,output:$.output?"":p}),de({type:"paren",extglob:!0,value:Ce(),output:Oe}),ie.push(B)},Mde=H=>{let ht=t.slice(H.startIndex,$.index+1),B=t.slice(H.startIndex+2,$.index),Oe=oTe(B,r);if((H.type==="plus"||H.type==="star")&&Oe.risky){let lt=Oe.safeOutput?(H.output?"":p)+(r.capture?`(${Oe.safeOutput})`:Oe.safeOutput):void 0,ki=s[H.tokensIndex];ki.type="text",ki.value=ht,ki.output=lt||an.escapeRegex(ht);for(let Ei=H.tokensIndex+1;Ei1&&H.inner.includes("/")&&(lt=O(r)),(lt!==D||Ir()||/^\)+$/.test(Kt()))&&(ut=H.close=`)$))${lt}`),H.inner.includes("*")&&(zt=Kt())&&/^\.[^\\/.]+$/.test(zt)){let ki=zP(zt,{...e,fastpaths:!1}).output;ut=H.close=`)${ki})${lt})`}H.prev.type==="bos"&&($.negatedExtglob=!0)}de({type:"paren",extglob:!0,value:P,output:ut}),Xr("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let H=!1,ht=t.replace(QAe,(B,Oe,ut,zt,lt,ki)=>zt==="\\"?(H=!0,B):zt==="?"?Oe?Oe+zt+(lt?_.repeat(lt.length):""):ki===0?A+(lt?_.repeat(lt.length):""):_.repeat(ut.length):zt==="."?u.repeat(ut.length):zt==="*"?Oe?Oe+zt+(lt?D:""):D:Oe?B:`\\${B}`);return H===!0&&(r.unescape===!0?ht=ht.replace(/\\/g,""):ht=ht.replace(/\\+/g,B=>B.length%2===0?"\\\\":B?"\\":"")),ht===t&&r.contains===!0?($.output=t,$):($.output=an.wrapOutput(ht,$,e),$)}for(;!Ir();){if(P=Ce(),P==="\0")continue;if(P==="\\"){let B=se();if(B==="/"&&r.bash!==!0||B==="."||B===";")continue;if(!B){P+="\\",de({type:"text",value:P});continue}let Oe=/^\\+/.exec(Kt()),ut=0;if(Oe&&Oe[0].length>2&&(ut=Oe[0].length,$.index+=ut,ut%2!==0&&(P+="\\")),r.unescape===!0?P=Ce():P+=Ce(),$.brackets===0){de({type:"text",value:P});continue}}if($.brackets>0&&(P!=="]"||C.value==="["||C.value==="[^")){if(r.posix!==!1&&P===":"){let B=C.value.slice(1);if(B.includes("[")&&(C.posix=!0,B.includes(":"))){let Oe=C.value.lastIndexOf("["),ut=C.value.slice(0,Oe),zt=C.value.slice(Oe+2),lt=YAe[zt];if(lt){C.value=ut+lt,$.backtrack=!0,Ce(),!o.output&&s.indexOf(C)===1&&(o.output=p);continue}}}(P==="["&&se()!==":"||P==="-"&&se()==="]")&&(P=`\\${P}`),P==="]"&&(C.value==="["||C.value==="[^")&&(P=`\\${P}`),r.posix===!0&&P==="!"&&C.value==="["&&(P="^"),C.value+=P,Xt({value:P});continue}if($.quotes===1&&P!=='"'){P=an.escapeRegex(P),C.value+=P,Xt({value:P});continue}if(P==='"'){$.quotes=$.quotes===1?0:1,r.keepQuotes===!0&&de({type:"text",value:P});continue}if(P==="("){$i("parens"),de({type:"paren",value:P});continue}if(P===")"){if($.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Hl("opening","("));let B=ie[ie.length-1];if(B&&$.parens===B.parens+1){Mde(ie.pop());continue}de({type:"paren",value:P,output:$.parens?")":"\\)"}),Xr("parens");continue}if(P==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Hl("closing","]"));P=`\\${P}`}else $i("brackets");de({type:"bracket",value:P});continue}if(P==="]"){if(r.nobracket===!0||C&&C.type==="bracket"&&C.value.length===1){de({type:"text",value:P,output:`\\${P}`});continue}if($.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Hl("opening","["));de({type:"text",value:P,output:`\\${P}`});continue}Xr("brackets");let B=C.value.slice(1);if(C.posix!==!0&&B[0]==="^"&&!B.includes("/")&&(P=`/${P}`),C.value+=P,Xt({value:P}),r.literalBrackets===!1||an.hasRegexChars(B))continue;let Oe=an.escapeRegex(C.value);if($.output=$.output.slice(0,-C.value.length),r.literalBrackets===!0){$.output+=Oe,C.value=Oe;continue}C.value=`(${a}${Oe}|${C.value})`,$.output+=C.value;continue}if(P==="{"&&r.nobrace!==!0){$i("braces");let B={type:"brace",value:P,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};K.push(B),de(B);continue}if(P==="}"){let B=K[K.length-1];if(r.nobrace===!0||!B){de({type:"text",value:P,output:P});continue}let Oe=")";if(B.dots===!0){let ut=s.slice(),zt=[];for(let lt=ut.length-1;lt>=0&&(s.pop(),ut[lt].type!=="brace");lt--)ut[lt].type!=="dots"&&zt.unshift(ut[lt].value);Oe=eTe(zt,r),$.backtrack=!0}if(B.comma!==!0&&B.dots!==!0){let ut=$.output.slice(0,B.outputIndex),zt=$.tokens.slice(B.tokensIndex);B.value=B.output="\\{",P=Oe="\\}",$.output=ut;for(let lt of zt)$.output+=lt.output||lt.value}de({type:"brace",value:P,output:Oe}),Xr("braces"),K.pop();continue}if(P==="|"){ie.length>0&&ie[ie.length-1].conditions++,de({type:"text",value:P});continue}if(P===","){let B=P,Oe=K[K.length-1];Oe&&xe[xe.length-1]==="braces"&&(Oe.comma=!0,B="|"),de({type:"comma",value:P,output:B});continue}if(P==="/"){if(C.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",s.pop(),C=o;continue}de({type:"slash",value:P,output:f});continue}if(P==="."){if($.braces>0&&C.type==="dot"){C.value==="."&&(C.output=u);let B=K[K.length-1];C.type="dots",C.output+=P,C.value+=P,B.dots=!0;continue}if($.braces+$.parens===0&&C.type!=="bos"&&C.type!=="slash"){de({type:"text",value:P,output:u});continue}de({type:"dot",value:P,output:u});continue}if(P==="?"){if(!(C&&C.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("qmark",P);continue}if(C&&C.type==="paren"){let Oe=se(),ut=P;(C.value==="("&&!/[!=<:]/.test(Oe)||Oe==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(ut=`\\${P}`),de({type:"text",value:P,output:ut});continue}if(r.dot!==!0&&(C.type==="slash"||C.type==="bos")){de({type:"qmark",value:P,output:S});continue}de({type:"qmark",value:P,output:_});continue}if(P==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){uo("negate",P);continue}if(r.nonegate!==!0&&$.index===0){lo();continue}}if(P==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("plus",P);continue}if(C&&C.value==="("||r.regex===!1){de({type:"plus",value:P,output:d});continue}if(C&&(C.type==="bracket"||C.type==="paren"||C.type==="brace")||$.parens>0){de({type:"plus",value:P});continue}de({type:"plus",value:d});continue}if(P==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){de({type:"at",extglob:!0,value:P,output:""});continue}de({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let B=XAe.exec(Kt());B&&(P+=B[0],$.index+=B[0].length),de({type:"text",value:P});continue}if(C&&(C.type==="globstar"||C.star===!0)){C.type="star",C.star=!0,C.value+=P,C.output=D,$.backtrack=!0,$.globstar=!0,dr(P);continue}let H=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(H)){uo("star",P);continue}if(C.type==="star"){if(r.noglobstar===!0){dr(P);continue}let B=C.prev,Oe=B.prev,ut=B.type==="slash"||B.type==="bos",zt=Oe&&(Oe.type==="star"||Oe.type==="globstar");if(r.bash===!0&&(!ut||H[0]&&H[0]!=="/")){de({type:"star",value:P,output:""});continue}let lt=$.braces>0&&(B.type==="comma"||B.type==="brace"),ki=ie.length&&(B.type==="pipe"||B.type==="paren");if(!ut&&B.type!=="paren"&&!lt&&!ki){de({type:"star",value:P,output:""});continue}for(;H.slice(0,3)==="/**";){let Ei=t[$.index+4];if(Ei&&Ei!=="/")break;H=H.slice(3),dr("/**",3)}if(B.type==="bos"&&Ir()){C.type="globstar",C.value+=P,C.output=O(r),$.output=C.output,$.globstar=!0,dr(P);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&!zt&&Ir()){$.output=$.output.slice(0,-(B.output+C.output).length),B.output=`(?:${B.output}`,C.type="globstar",C.output=O(r)+(r.strictSlashes?")":"|$)"),C.value+=P,$.globstar=!0,$.output+=B.output+C.output,dr(P);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&H[0]==="/"){let Ei=H[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(B.output+C.output).length),B.output=`(?:${B.output}`,C.type="globstar",C.output=`${O(r)}${f}|${f}${Ei})`,C.value+=P,$.output+=B.output+C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}if(B.type==="bos"&&H[0]==="/"){C.type="globstar",C.value+=P,C.output=`(?:^|${f}|${O(r)}${f})`,$.output=C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-C.output.length),C.type="globstar",C.output=O(r),C.value+=P,$.output+=C.output,$.globstar=!0,dr(P);continue}let ht={type:"star",value:P,output:D};if(r.bash===!0){ht.output=".*?",(C.type==="bos"||C.type==="slash")&&(ht.output=T+ht.output),de(ht);continue}if(C&&(C.type==="bracket"||C.type==="paren")&&r.regex===!0){ht.output=P,de(ht);continue}($.index===$.start||C.type==="slash"||C.type==="dot")&&(C.type==="dot"?($.output+=g,C.output+=g):r.dot===!0?($.output+=b,C.output+=b):($.output+=T,C.output+=T),se()!=="*"&&($.output+=p,C.output+=p)),de(ht)}for(;$.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing","]"));$.output=an.escapeLast($.output,"["),Xr("brackets")}for(;$.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing",")"));$.output=an.escapeLast($.output,"("),Xr("parens")}for(;$.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing","}"));$.output=an.escapeLast($.output,"{"),Xr("braces")}if(r.strictSlashes!==!0&&(C.type==="star"||C.type==="bracket")&&de({type:"maybe_slash",value:"",output:`${f}?`}),$.backtrack===!0){$.output="";for(let H of $.tokens)$.output+=H.output!=null?H.output:H.value,H.suffix&&($.output+=H.suffix)}return $};zP.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Fv,r.maxLength):Fv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=n8[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=_p.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=T=>T.noglobstar===!0?_:`(${g}(?:(?!${p}${T.dot?c:o}).)*?)`,x=T=>{switch(T){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${S(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${S(r)}${s})?${o}${a}${_}`;default:{let A=/^(.*?)\.(\w+)$/.exec(T);if(!A)return;let D=x(A[1]);return D?D+o+A[2]:void 0}}},w=an.removePrefix(t,b),O=x(w);return O&&r.strictSlashes!==!0&&(O+=`${s}?`),O};s8.exports=zP});var u8=v((adt,l8)=>{"use strict";var sTe=r8(),UP=a8(),c8=gp(),aTe=hp(),cTe=t=>t&&typeof t=="object"&&!Array.isArray(t),Rt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Rt(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=cTe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?Rt.compileRe(t,e):Rt.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Rt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Rt.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};Rt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?c8.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Rt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Rt.matchBase=(t,e,r)=>(e instanceof RegExp?e:Rt.makeRe(e,r)).test(c8.basename(t));Rt.isMatch=(t,e,r)=>Rt(e,r)(t);Rt.parse=(t,e)=>Array.isArray(t)?t.map(r=>Rt.parse(r,e)):UP(t,{...e,fastpaths:!1});Rt.scan=(t,e)=>sTe(t,e);Rt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Rt.toRegex(a,e);return n===!0&&(c.state=t),c};Rt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=UP.fastpaths(t,e)),i.output||(i=UP(t,e)),Rt.compileRe(i,e,r,n)};Rt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Rt.constants=aTe;l8.exports=Rt});var m8=v((cdt,p8)=>{"use strict";var d8=u8(),lTe=gp();function f8(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:lTe.isWindows()}),d8(t,e,r)}Object.assign(f8,d8);p8.exports=f8});import{readdir as uTe,readdirSync as dTe,realpath as fTe,realpathSync as pTe,stat as mTe,statSync as hTe}from"fs";import{isAbsolute as gTe,posix as Ha,resolve as yTe}from"path";import{fileURLToPath as _Te}from"url";function STe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&vTe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>Ha.relative(t,n)||".":n=>Ha.relative(t,`${e}/${n}`)||"."}function $Te(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=Ha.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function _8(t){var e;let r=Gl.default.scan(t,kTe);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function ITe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Gl.default.scan(t);return r.isGlob||r.negated}function bp(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function b8(t){return typeof t=="string"?[t]:t??[]}function qP(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=RTe(o);s=gTe(s.replace(CTe,""))?Ha.relative(a,s):Ha.normalize(s);let c=(i=PTe.exec(s))===null||i===void 0?void 0:i[0],l=_8(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?Ha.join(o,...d):o}return s}function DTe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(qP(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(qP(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(qP(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function NTe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=DTe(t,e,n);t.debug&&bp("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(g8,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Gl.default)(i.match,f),m=(0,Gl.default)(i.ignore,f),h=STe(i.match,f),g=h8(r,d,o),b=o?g:h8(r,d,!0),_=(w,O)=>{let T=b(O,!0);return T!=="."&&!h(T)||m(T)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let x=new qJ({filters:[a?(w,O)=>{let T=g(w,O),A=p(T)&&!m(T);return A&&bp(`matched ${T}`),A}:(w,O)=>{let T=g(w,O);return p(T)&&!m(T)}],exclude:a?(w,O)=>{let T=_(w,O);return bp(`${T?"skipped":"crawling"} ${O}`),T}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:S,signal:t.signal}).crawl(d);return t.debug&&bp("internal properties:",{...n,root:d}),[x,r!==d&&!o&&$Te(r,d)]}function jTe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function FTe(t){let e={...MTe,...t};return e.cwd=(e.cwd instanceof URL?_Te(e.cwd):yTe(e.cwd)).replace(g8,"/"),e.ignore=b8(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||uTe,readdirSync:e.fs.readdirSync||dTe,realpath:e.fs.realpath||fTe,realpathSync:e.fs.realpathSync||pTe,stat:e.fs.stat||mTe,statSync:e.fs.statSync||hTe}),e.debug&&bp("globbing with options:",e),e}function LTe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=bTe(t)||typeof t=="string",i=b8((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=FTe(n?e:t);return i.length>0?NTe(o,i):[]}function ys(t,e){let[r,n]=LTe(t,e);return r?jTe(r.sync(),n):[]}var Gl,bTe,g8,y8,vTe,wTe,xTe,kTe,ETe,ATe,TTe,OTe,RTe,PTe,CTe,MTe,vp=y(()=>{BJ();Gl=St(m8(),1),bTe=Array.isArray,g8=/\\/g,y8=process.platform==="win32",vTe=/^(\/?\.\.)+$/;wTe=/^[A-Z]:\/$/i,xTe=y8?t=>wTe.test(t):t=>t==="/";kTe={parts:!0};ETe=/(?t.replace(ETe,"\\$&"),OTe=t=>t.replace(ATe,"\\$&"),RTe=y8?OTe:TTe;PTe=/^(\/?\.\.)+/,CTe=/\\(?=[()[\]{}!*+?@|])/g;MTe={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as Sp,readFileSync as zTe,readdirSync as UTe,statSync as v8}from"node:fs";import{join as Ga}from"node:path";function qTe(t){let{cwd:e="."}=t,r,n;try{let c=q(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=Fi(e,n),o=[],{layers:s,forbiddenImports:a}=BP(r);return(s.size>0||a.length>0)&&!Sp(Ga(e,i.mainRoot))?[{detector:wp,severity:"info",path:`${i.mainRoot}/`,message:`architecture layers declared but ${i.mainRoot}/ not found \u2014 layer checks skipped (flat layout not yet supported)`}]:(s.size>0&&(BTe(e,i,s,o),HTe(e,i,s,o)),a.length>0&>e(e,i,a,o),o)}function BP(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function BTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of UTe(o)){let a=Ga(o,s);v8(a).isDirectory()&&(r.has(s)||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function HTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of r){let a=Ga(o,s);Sp(a)&&v8(a).isDirectory()||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function GTe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Ga(t,i,s.from);if(!Sp(a))continue;let c=ys([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Ga(a,l),d;try{d=zTe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];ZTe(p,s.to,e.importStyle)&&n.push({detector:wp,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function ZTe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var wp,S8,HP=y(()=>{"use strict";vp();Ue();Ba();wp="ARCHITECTURE_FROM_SPEC";S8={name:wp,run:qTe}});import{existsSync as VTe,readFileSync as WTe}from"node:fs";import{join as KTe}from"node:path";function YTe(t){let{cwd:e="."}=t,r=KTe(e,"spec/capabilities.yaml");if(!VTe(r))return[];let n;try{let u=WTe(r,"utf8"),d=w8.default.parse(u);if(!d||typeof d!="object")return[];n=d}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o,s=!1;try{let u=q(e);o=new Set(u.features.map(d=>d.id)),s=u.project.onboarding_seeded===!0}catch{return[]}let a=[],c=new Set,l=s&&o.size{"use strict";w8=St(er(),1);Ue();Lv="CAPABILITIES_FEATURE_MAPPING",JTe=8;x8={name:Lv,run:YTe}});import{existsSync as XTe,readFileSync as QTe}from"node:fs";import{join as eOe}from"node:path";function tOe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("#")||e.startsWith('"""')||e.startsWith("'''")}function rOe(t){let{cwd:e="."}=t;return ge(e,GP,r=>nOe(r,e))}function nOe(t,e){let r=Fi(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=eOe(e,o);if(!XTe(s))continue;let a=QTe(s,"utf8");tOe(a)||n.push({detector:GP,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var GP,k8,E8=y(()=>{"use strict";Ba();wt();GP="CONVENTION_DRIFT";k8={name:GP,run:rOe}});import{existsSync as ZP,readFileSync as A8}from"node:fs";import{join as zv}from"node:path";function iOe(t){return JSON.parse(t).total?.lines?.pct??0}function T8(t){let e=/]*\bline-rate="([0-9]*\.?[0-9]+)"/.exec(t);return e?Number(e[1])*100:null}function aOe(t,e){if(!$v(dt(t).gates.coverage?.cmd))return null;let r;try{r=kv(t,e)}catch(c){return[{detector:$o,severity:"error",message:c.message}]}let n=0,i=0,o=0,s=[];for(let c of r){let l=xP.find(d=>ZP(zv(c.dir,d)));if(!l){s.push(c.path);continue}let u=T8(A8(zv(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:$o,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=O8(n,i);return a0?[{detector:$o,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function cOe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let a=aOe(e,t.focusModules);if(a)return a}let r;try{r=q(e).project?.language}catch{}let n=Fi(e,r),i=dt(e).language==="kotlin"?xP.find(a=>ZP(zv(e,a)))??uJ(e):n.coverageSummary,o=zv(e,i);if(!ZP(o))return[{detector:$o,severity:"info",message:`${i} not present \u2014 run stage_2.2 first`}];let s;try{let a=A8(o,"utf8");s=n.coverageFormat==="jacoco-xml"?oOe(a):n.coverageFormat==="cobertura-xml"?sOe(a):iOe(a)}catch(a){return[{detector:$o,severity:"warn",message:`${i} unparseable: ${a.message}`}]}return s===null?n.coverageFormat==="cobertura-xml"?[]:[{detector:$o,severity:"warn",message:`${i} contained no line-coverage counter`}]:s>=Uv?[]:[{detector:$o,severity:"warn",message:`line coverage ${s.toFixed(1)}% < floor ${Uv}%`}]}var $o,Uv,R8,I8=y(()=>{"use strict";Ue();Tv();Ba();Ev();sn();$o="COVERAGE_DROP",Uv=70;R8={name:$o,run:cOe}});import{existsSync as lOe}from"node:fs";import{join as uOe}from"node:path";function fOe(t){let{cwd:e="."}=t;return ge(e,qv,r=>pOe(r,e))}function pOe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);if(!r){if(n.length===0)return[];let i=t.project.onboarding_seeded===!0&&t.features.length{"use strict";wt();qv="DELIVERABLE_INTEGRITY",dOe=8;P8={name:qv,run:fOe}});function mOe(t){let e=new Set((t.features??[]).map(n=>n.id)),r=[];for(let n of t.project?.smoke??[]){let i=n.feature;if(i===void 0||e.has(i))continue;let o=(n.run??[]).join(" ")||`kind:${n.kind}`;r.push({detector:Bv,severity:"warn",path:"spec.yaml",message:`smoke probe '${o}' binds feature ${i}, which is not in the spec \u2014 a dangling binding is annotation drift (the bound feature was renamed, archived, or never existed). Fix the id or drop the binding.`})}return r}function hOe(t){let e=mOe(t),r=(t.features??[]).filter(o=>o.status==="done");return r.length===0||!!!t.project?.deliverable||(t.project?.smoke??[]).length>0?e:[...e,{detector:Bv,severity:"warn",path:"spec.yaml",message:`${r.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function gOe(t){let{cwd:e="."}=t;return ge(e,Bv,r=>hOe(r))}var Bv,D8,N8=y(()=>{"use strict";wt();Bv="SMOKE_PROBE_DEMAND";D8={name:Bv,run:gOe}});function yOe(t){let{cwd:e="."}=t;return ge(e,Hv,r=>_Oe(r,e))}function _Oe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=as(e);if(n===null)return[{detector:Hv,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=H_(n,e,o);s.state!=="fresh"&&i.push({detector:Hv,severity:"warn",path:"spec/attestation.yaml",message:s.state==="unattested"?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:s.module?`${o.id}'s module ${s.module} changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var Hv,Gv,VP=y(()=>{"use strict";vl();wt();Hv="STALE_ATTESTATION";Gv={name:Hv,run:yOe}});function bOe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}return vOe(r)}function vOe(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:j8,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var j8,Zv,WP=y(()=>{"use strict";Ue();j8="DEPENDENCY_CYCLE";Zv={name:j8,run:bOe}});import{appendFileSync as SOe,existsSync as M8,mkdirSync as wOe,readFileSync as xOe}from"node:fs";import{dirname as $Oe,join as kOe}from"node:path";function F8(t){return kOe(t,EOe,AOe)}function L8(t){return KP.add(t),()=>KP.delete(t)}function Za(t,e){let r=F8(t),n=$Oe(r);M8(n)||wOe(n,{recursive:!0}),SOe(r,`${JSON.stringify(e)} +`,"utf8");for(let i of KP)try{i(t,e)}catch{}}function In(t){let e=F8(t);if(!M8(e))return[];let r=xOe(e,"utf8").trim();return r.length===0?[]:r.split(` +`).filter(n=>n.length>0).map(n=>JSON.parse(n))}var EOe,AOe,KP,ni=y(()=>{"use strict";EOe=".cladding",AOe="audit.log.jsonl";KP=new Set});import{existsSync as TOe}from"node:fs";import{join as OOe}from"node:path";function ROe(t){let{cwd:e="."}=t,r=In(e);if(r.length===0)return[{detector:JP,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=[];for(let i of r)i.artifact&&(TOe(OOe(e,i.artifact))||n.push({detector:JP,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var JP,z8,U8=y(()=>{"use strict";ni();JP="EVIDENCE_MISMATCH";z8={name:JP,run:ROe}});import{existsSync as IOe,readFileSync as POe}from"node:fs";import{join as COe}from"node:path";function DOe(t){let e=COe(t,G8);if(!IOe(e))return null;try{let n=((0,H8.parse)(POe(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*B8(t,e){for(let r of t??[])r.startsWith(q8)&&(yield{ref:r,name:r.slice(q8.length),field:e})}function NOe(t){let{cwd:e="."}=t,r=DOe(e);if(r===null)return[];let n;try{n=q(e)}catch(o){return[{detector:YP,severity:"info",message:`spec.yaml not loaded: ${o.message}`}]}let i=[];for(let o of n.features)for(let s of o.acceptance_criteria??[]){let a=[...B8(s.evidence_refs,"evidence_refs"),...B8(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:YP,severity:"warn",path:G8,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var H8,YP,q8,G8,Z8,V8=y(()=>{"use strict";H8=St(er(),1);Ue();YP="FIXTURE_REFERENCE_INVALID",q8="fixture:",G8="conformance/fixtures.yaml";Z8={name:YP,run:NOe}});import{existsSync as Zl,readFileSync as XP}from"node:fs";import{join as Va}from"node:path";function jOe(t){return ys(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec|spec-first-window)\.ts$/.test(r)).length}function xp(t){if(!Zl(t))return null;try{return JSON.parse(XP(t,"utf8"))}catch{return null}}function MOe(t,e){let r=Va(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(XP(r,"utf8"))}catch(c){e.push({detector:ko,severity:"info",message:`plugin.json not loaded: ${c.message}`});return}let i=n.ironclad?.current?.detectors;if(!i)return;let o=i.match(/^(\d+)\/(\d+)$/);if(!o){e.push({detector:ko,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=jOe(t);s!==a&&e.push({detector:ko,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function FOe(t,e){for(let r of W8){let n=Va(t,r.path);if(!Zl(n))continue;let i=xp(n);if(!i){e.push({detector:ko,severity:"warn",message:`${r.host}: ${r.path} could not be parsed as JSON`});continue}for(let o of r.required)(i[o]===void 0||i[o]===null||i[o]==="")&&e.push({detector:ko,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function LOe(t,e){let r=xp(Va(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of W8){let s=Va(t,o.path);if(!Zl(s))continue;let a=xp(s);a?.version&&a.version!==n&&e.push({detector:ko,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=Va(t,".claude-plugin","marketplace.json");if(Zl(i)){let o=xp(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:ko,severity:"error",message:`marketplace: .claude-plugin/marketplace.json plugin '${s.name??"?"}' version='${s.version}' but package.json version='${n}' \u2014 the catalog advertises a stale version; bump it in lockstep`})}}function zOe(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function UOe(t,e){let r=Va(t,"src","cli","clad.ts"),n=Va(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!Zl(r)||!Zl(n))return;let i=zOe(XP(r,"utf8"));if(i.length===0)return;let s=xp(n)?.ironclad?.current?.["stages-implemented"];if(!Array.isArray(s))return;let a=new Set(i),c=new Set(s),l=i.filter(f=>!c.has(f)),u=s.filter(f=>!a.has(f));if(l.length===0&&u.length===0)return;let d=[l.length?`missing [${l.join(", ")}]`:"",u.length?`unexpected [${u.join(", ")}]`:""].filter(Boolean).join("; ");e.push({detector:ko,severity:"error",message:`plugins/claude-code/.claude-plugin/plugin.json stages-implemented disagrees with TIER_STAGES.all (src/cli/clad.ts): ${d} \u2014 run \`npm run build:plugin\` to re-derive`})}function qOe(t){let{cwd:e="."}=t,r=[];return MOe(e,r),UOe(e,r),FOe(e,r),LOe(e,r),r}var ko,W8,K8,J8=y(()=>{"use strict";vp();ko="HARNESS_INTEGRITY",W8=[{host:"claude-code",path:"plugins/claude-code/.claude-plugin/plugin.json",required:["name","version"]},{host:"codex",path:"plugins/codex/.codex-plugin/plugin.json",required:["name","version","description"]},{host:"gemini-cli",path:"plugins/gemini-cli/gemini-extension.json",required:["name","version"]}];K8={name:ko,run:qOe}});import{existsSync as BOe,readFileSync as HOe}from"node:fs";import{join as GOe}from"node:path";function VOe(t){let{cwd:e="."}=t;return ge(e,Vv,r=>KOe(r,e))}function WOe(t){let e=GOe(t,"spec/capabilities.yaml");if(!BOe(e))return!1;try{let r=Y8.default.parse(HOe(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function KOe(t,e){let r=t.features.length;if(r{"use strict";Y8=St(er(),1);wt();Vv="HOLLOW_GOVERNANCE",ZOe=8;X8={name:Vv,run:VOe}});import{existsSync as e5,readFileSync as t5}from"node:fs";import{join as r5}from"node:path";function n5(t,e){let r=t.match(e);if(!r)return null;try{let n=JSON.parse(r[1]),i={};for(let[o,s]of Object.entries(n))typeof s=="string"&&(i[o]=s);return i}catch{return null}}function XOe(t){switch(t){case"fail":case"wiring-fail":return 0;case"wiring-ok":case"wiring-only":return 1;case"verified":return 2;default:return null}}function QOe(t){switch(t){case"wiring-only":return 1;case"verified":return 2;default:return null}}function eRe(t){let e=r5(t,"README.md"),r=r5(t,"docs","dogfood","matrix.md");if(!e5(e)||!e5(r))return[];let n=n5(t5(e,"utf8"),JOe),i=n5(t5(r,"utf8"),YOe);if(!n||!i)return[];let o=[];for(let[s,a]of Object.entries(n)){let c=QOe(a);if(c===null)continue;let l=i[s]??"not-run",u=XOe(l);u!==null&&c>u&&o.push({detector:i5,severity:"warn",path:"README.md",message:`README host-claims: '${s}' claims '${a}' but the newest matrix evidence is '${l}' \u2014 the claim exceeds the evidence. Re-run \`clad doctor --hosts\` (with consent) or lower the README claim for '${s}'.`})}return o}function tRe(t){let{cwd:e="."}=t;return eRe(e)}var i5,JOe,YOe,o5,s5=y(()=>{"use strict";i5="HOST_CLAIM_DRIFT",JOe=//,YOe=//;o5={name:i5,run:tRe}});function rRe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}let n=[];return a5(r.features.map(i=>i.id),"feature","spec/features/",n),a5((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function a5(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:c5,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var c5,l5,u5=y(()=>{"use strict";Ue();c5="ID_COLLISION";l5={name:c5,run:rRe}});import{existsSync as $p,readFileSync as QP,readdirSync as eC,statSync as nRe,writeFileSync as f5}from"node:fs";import{join as Eo}from"node:path";function d5(t){if(!$p(t))return 0;try{return eC(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function iRe(t){if(!$p(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=eC(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=Eo(n,o),a;try{a=nRe(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function oRe(t){let e=Eo(t,"spec","capabilities.yaml");if(!$p(e))return 0;try{let r=Wv.default.parse(QP(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function _s(t="."){let e=d5(Eo(t,"spec","features")),r=d5(Eo(t,"spec","scenarios")),n=oRe(t),i=iRe(Eo(t,"tests"));return{features:e,scenarios:r,capabilities:n,test_files:i}}function Vl(t,e){let r=Eo(t,"spec.yaml");if(!$p(r))return;let n=QP(r,"utf8"),i=sRe(n,e);i!==n&&f5(r,i)}function sRe(t,e){let r=t.includes(`\r `)?`\r `:` `,n=t.split(/\r?\n/),i=n.findIndex(d=>/^inventory:\s*$/.test(d)),o=["# Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand.","inventory:",` features: ${e.features??0}`,` scenarios: ${e.scenarios??0}`,` capabilities: ${e.capabilities??0}`,` test_files: ${e.test_files??0}`],s=d=>r===`\r @@ -270,51 +270,51 @@ ${o.join(` `)}let a=i;a>0&&/Auto-maintained by `clad sync`/.test(n[a-1])&&(a-=1);let c=i+1;for(;ci+1);)c++;let l=n.slice(0,a),u=n.slice(c);for(;l.length>0&&l[l.length-1].trim()==="";)l.pop();return l.push(""),s([...l,...o,"",...u.filter((d,f)=>!(f===0&&d.trim()===""))].join(` `).replace(/\n{3,}/g,` -`))}function Wa(t="."){let e=Eo(t,"spec","features");if(!$p(e))return!1;let r=[];for(let i of QP(e).sort())if(!(!i.endsWith(".yaml")&&!i.endsWith(".yml")))try{let o=(0,Vv.parse)(XP(Eo(e,i),"utf8"));if(!o?.id)continue;let s=o.slug??i.replace(/\.(ya?ml)$/,"");r.push(` ${o.id}: {slug: ${s}, status: ${o.status??"planned"}, modules: ${(o.modules??[]).length}}`)}catch{continue}r.sort();let n="# Cladding \xB7 Tier C \u2014 generated feature index (`clad sync`). Do not edit by hand.\n# One line per feature \u2192 1-file lookup + line-independent merges\n# (suggested .gitattributes: `spec/index.yaml merge=union`).\nfeatures:\n"+r.join(` +`))}function Wa(t="."){let e=Eo(t,"spec","features");if(!$p(e))return!1;let r=[];for(let i of eC(e).sort())if(!(!i.endsWith(".yaml")&&!i.endsWith(".yml")))try{let o=(0,Wv.parse)(QP(Eo(e,i),"utf8"));if(!o?.id)continue;let s=o.slug??i.replace(/\.(ya?ml)$/,"");r.push(` ${o.id}: {slug: ${s}, status: ${o.status??"planned"}, modules: ${(o.modules??[]).length}}`)}catch{continue}r.sort();let n="# Cladding \xB7 Tier C \u2014 generated feature index (`clad sync`). Do not edit by hand.\n# One line per feature \u2192 1-file lookup + line-independent merges\n# (suggested .gitattributes: `spec/index.yaml merge=union`).\nfeatures:\n"+r.join(` `)+` -`;return d5(Eo(t,"spec","index.yaml"),n,"utf8"),!0}var Vv,kp=y(()=>{"use strict";Vv=St(er(),1)});import{existsSync as f5,readFileSync as p5,readdirSync as sRe}from"node:fs";import{join as eC}from"node:path";function aRe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=_s(e),i=r.inventory;if(!i){let s=m5.filter(([c])=>(n[c]??0)>0);if(s.length===0)return tC(e);let a=s.map(([c,l])=>`${n[c]??0} ${l}`).join(", ");return[...tC(e),{detector:Ep,severity:"warn",path:"spec.yaml",message:`spec.yaml has no inventory: block, but the project has ${a} on disk \u2014 run \`clad sync\` to record the inventory so anyone reading spec.yaml sees its real scale.`}]}let o=[];for(let[s,a]of m5){let c=i[s]??0,l=n[s]??0;c!==l&&o.push({detector:Ep,severity:"error",path:"spec.yaml",message:`spec.yaml inventory.${s} declares ${c} but the project has ${l} ${a} on disk \u2014 run \`clad sync\` (a stale inventory hides created/deleted shards from anyone reading spec.yaml).`})}return o.push(...tC(e)),o}function tC(t){let e=eC(t,"spec","index.yaml"),r=eC(t,"spec","features");if(!f5(e)||!f5(r))return[];let n=new Map;try{for(let l of p5(e,"utf8").split(` -`)){let u=l.match(/^ (F-[\w-]+):.*\bstatus:\s*['"]?([\w-]+)['"]?/);if(u){n.set(u[1],u[2]);continue}let d=l.match(/^ (F-[\w-]+):/);d&&n.set(d[1],"planned")}}catch{return[]}let i=new Map;try{for(let l of sRe(r)){if(!l.endsWith(".yaml")&&!l.endsWith(".yml"))continue;let u=p5(eC(r,l),"utf8"),d=u.match(/^id:\s*['"]?(F-[\w-]+)['"]?/m);if(!d)continue;let f=u.match(/^status:\s*['"]?([\w-]+)['"]?/m);i.set(d[1],f?f[1]:"planned")}}catch{return[]}let o=[],s=[...i.keys()].filter(l=>!n.has(l)).sort(),a=[...n.keys()].filter(l=>!i.has(l)).sort();if(s.length>0||a.length>0){let l=[];s.length>0&&l.push(`missing from index: ${s.join(", ")}`),a.length>0&&l.push(`in index but not on disk: ${a.join(", ")}`),o.push({detector:Ep,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml disagrees with spec/features/ (${l.join("; ")}) \u2014 run \`clad sync\` to regenerate (a stale index silently misleads agents that trust it for lookup).`})}let c=[...i.keys()].filter(l=>n.has(l)&&n.get(l)!==i.get(l)).sort().map(l=>`${l} (index: ${n.get(l)}, shard: ${i.get(l)})`);return c.length>0&&o.push({detector:Ep,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml status disagrees with spec/features/ for ${c.join("; ")} \u2014 run \`clad sync\` to regenerate (a stale status silently misleads agents that trust the index).`}),o}var Ep,m5,h5,g5=y(()=>{"use strict";kp();Ue();Ep="INVENTORY_DRIFT",m5=[["features","feature shard(s)"],["scenarios","scenario shard(s)"],["capabilities","capabilit(ies)"],["test_files","test file(s)"]];h5={name:Ep,run:aRe}});import{existsSync as cRe,readFileSync as lRe}from"node:fs";import{join as uRe}from"node:path";function fRe(t){let{cwd:e="."}=t,r=uRe(e,"src","spec","schema.json"),n=[];if(cRe(r)){let i;try{i=JSON.parse(lRe(r,"utf8"))}catch(o){n.push({detector:Ap,severity:"error",message:`spec/schema.json unreadable or invalid JSON: ${o.message}`})}if(i)for(let o of dRe)i.required?.includes(o)||n.push({detector:Ap,severity:"error",message:`spec/schema.json does not require root key '${o}'`}),i.properties?.[o]||n.push({detector:Ap,severity:"error",message:`spec/schema.json does not declare property '${o}'`})}try{let i=B(e);i.schema!==y5&&n.push({detector:Ap,severity:"error",message:`spec.yaml schema='${i.schema}' but supported version is '${y5}'`})}catch{}return n}var Ap,dRe,y5,_5,b5=y(()=>{"use strict";Ue();Ap="META_INTEGRITY",dRe=["schema","project","features"],y5="0.1";_5={name:Ap,run:fRe}});function pRe(t){let{cwd:e="."}=t,r;try{r=B(e)}catch{return[]}let n=[];return v5(r.features.map(i=>({id:i.id,slug:i.slug})),"features",n),v5((r.scenarios??[]).map(i=>({id:i.id,slug:i.slug})),"scenarios",n),n}function v5(t,e,r){let n=new Map;for(let i of t){if(!i.slug)continue;let o=n.get(i.slug);o?r.push({detector:S5,severity:"error",message:`slug '${i.slug}' is used by both ${o} and ${i.id} in ${e}/ \u2014 two items in the same namespace cannot share a slug; pick a different slug for one`}):n.set(i.slug,i.id)}}var S5,w5,x5=y(()=>{"use strict";Ue();S5="SLUG_CONFLICT";w5={name:S5,run:pRe}});function Wl(t){return t==="planned"||t==="in_progress"}var Wv=y(()=>{"use strict"});import{existsSync as mRe}from"node:fs";import{join as hRe}from"node:path";function gRe(t){let{cwd:e="."}=t;return ge(e,Kv,r=>yRe(r,e))}function yRe(t,e){let r=[];for(let n of t.features)for(let i of n.modules??[]){let o=hRe(e,i);mRe(o)||r.push(_Re(n.id,i,n.status))}return r}function _Re(t,e,r){return Wl(r)?{detector:Kv,severity:"info",path:e,message:`feature ${t}'s module '${e}' is not built yet \u2014 the normal state between authoring the spec entry and implementing it`}:{detector:Kv,severity:"error",path:e,message:`feature ${t} declares module '${e}' but the file does not exist`}}var Kv,Jv,rC=y(()=>{"use strict";Wv();wt();Kv="MISSING_IMPLEMENTATION";Jv={name:Kv,run:gRe}});function bRe(t){let{cwd:e="."}=t;return ge(e,nC,vRe)}function vRe(t){let e=[];for(let r of t.features)if(r.status==="done")for(let n of r.acceptance_criteria??[]){let o=(n.test_refs??[]).filter(c=>!c.startsWith("derived:")).length>0,s=(n.evidence_refs?.length??0)>0,a=!o&&!s&&(n.test_refs?.length??0)>0;!o&&!s&&e.push({detector:nC,severity:"error",message:`${r.id}.${n.id} declares no test_refs or evidence_refs \u2014 AC is unverified`+(a?" (a 'derived:' candidate exists \u2014 confirm it by removing the prefix, or author a real ref)":"")})}return e}var nC,Yv,iC=y(()=>{"use strict";wt();nC="MISSING_TESTS";Yv={name:nC,run:bRe}});import{existsSync as SRe,readFileSync as wRe}from"node:fs";import{join as $5}from"node:path";function k5(t){if(SRe(t))try{return JSON.parse(wRe(t,"utf8"))}catch{return}}function ERe(t){let{cwd:e="."}=t,r=k5($5(e,xRe)),n=k5($5(e,$Re));if(!r||!n)return[{detector:oC,severity:"info",message:"perf baseline or current missing \u2014 run stage_3.2 with --record first"}];let i=[];for(let[o,s]of Object.entries(r.metrics??{})){let a=n.metrics?.[o];if(!a||typeof s.value!="number"||typeof a.value!="number"||s.value===0)continue;let c=(a.value-s.value)/s.value*100;c>kRe&&i.push({detector:oC,severity:"warn",message:`${o} regressed ${c.toFixed(1)}% (baseline ${s.value}${s.unit??""} \u2192 current ${a.value}${a.unit??""})`})}return i}var oC,xRe,$Re,kRe,E5,A5=y(()=>{"use strict";oC="PERFORMANCE_DRIFT",xRe="perf/baseline.json",$Re="perf/current.json",kRe=10;E5={name:oC,run:ERe}});import{existsSync as ARe}from"node:fs";import{join as TRe}from"node:path";function RRe(t){let{cwd:e="."}=t;return ge(e,sC,r=>PRe(r,e))}function IRe(t,e){return(t.modules??[]).some(r=>ARe(TRe(e,r)))}function PRe(t,e){let r=[];for(let s of t.features)s.status!=="planned"&&s.status!=="in_progress"||IRe(s,e)||r.push(s.id);let n=ORe;if(r.length<=n)return[];let i=r.slice(0,T5).join(", "),o=r.length>T5?", \u2026":"";return[{detector:sC,severity:"warn",message:`${r.length} planned/in_progress features have NO code on disk (> ${n} tolerated) \u2014 the spec has raced ahead of the code. Work one feature end-to-end before authoring the next (docs/feature-cycle.md). Stalled: ${i}${o}`}]}var sC,ORe,T5,O5,R5=y(()=>{"use strict";wt();sC="PLANNED_BACKLOG",ORe=5,T5=8;O5={name:sC,run:RRe}});import{existsSync as CRe,readFileSync as DRe}from"node:fs";import{join as NRe}from"node:path";function FRe(t){let{cwd:e="."}=t;return ge(e,aC,r=>LRe(r,e))}function LRe(t,e){if(t.features.lengthn.includes(i))?[{detector:aC,severity:"warn",path:"docs/project-context.md",message:`${t.features.length} features but docs/project-context.md is still the unrefined init template (it still carries the placeholder prompts) \u2014 the Why/What/Purpose narrative was never filled in. Fill it in with \`clad clarify\` or by hand.`}]:[]}var aC,jRe,MRe,I5,P5=y(()=>{"use strict";wt();aC="PROJECT_CONTEXT_DRIFT",jRe=8,MRe=["Refine by hand or re-run with LLM available","What gap or pain led to this project","What does success look like"];I5={name:aC,run:FRe}});function C5(t,e,r){return e?e.filter(n=>!t.has(n)).map(n=>({detector:Xv,severity:"error",message:`${r} references unknown id '${n}'`})):[]}function zRe(t){let{cwd:e="."}=t;return ge(e,Xv,URe)}function URe(t){let e=new Set(t.features.map(n=>n.id)),r=[];for(let n of t.features)r.push(...C5(e,n.depends_on,`feature ${n.id}.depends_on`)),n.superseded_by&&!e.has(n.superseded_by)&&r.push({detector:Xv,severity:"error",message:`feature ${n.id}.superseded_by references unknown id '${n.superseded_by}'`});for(let n of t.scenarios??[])r.push(...C5(e,n.features,`scenario ${n.id}.features`));return r}var Xv,Qv,cC=y(()=>{"use strict";wt();Xv="REFERENCE_INTEGRITY";Qv={name:Xv,run:zRe}});function Tp(t=""){return new RegExp(qRe,t)}var qRe,lC=y(()=>{"use strict";qRe=String.raw`\bF-(?:\d{3,}|[0-9a-f]{6,8})\b`});import{existsSync as BRe,readdirSync as HRe,readFileSync as GRe,statSync as ZRe,writeFileSync as VRe}from"node:fs";import{dirname as WRe,join as Op,normalize as KRe,relative as JRe}from"node:path";function tIe(t){let e=[];for(let r of t.matchAll(eIe))if(!r[1].trim().startsWith("ignore"))for(let n of r[1].match(Tp("g"))??[])e.push(n);return[...new Set(e)].sort()}function rIe(t){return t.replace(/```[\s\S]*?```/g," ").replace(/~~~[\s\S]*?~~~/g," ").replace(/`[^`\n]*`/g," ")}function D5(t){return t.split("\\").join("/")}function nIe(t){return YRe.some(e=>t===e||t.startsWith(`${e}/`))}function iIe(t){let e=Op(t,"docs");if(!BRe(e))return[];let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=HRe(i)}catch{continue}for(let s of o){if(s.startsWith("."))continue;let a=Op(i,s),c;try{c=ZRe(a)}catch{continue}let l=D5(JRe(t,a));c.isDirectory()?n.push(a):s.endsWith(".md")&&r.push(l)}}return r.sort()}function oIe(t,e){if(/^[a-z]+:/i.test(e))return null;let r=KRe(Op(WRe(t),e));return D5(r)}function Rp(t="."){let e=[];for(let r of iIe(t)){let n;try{n=GRe(Op(t,r),"utf8")}catch{continue}let i=rIe(n),o=tIe(i);if(nIe(r)){if(o.length===0)continue;e.push({doc:r,features:o,doc_links:[]});continue}let a=n.includes(XRe)?[]:i.match(Tp("g"))??[],c=[...new Set([...a,...o])].sort(),l=new Set;for(let u of i.matchAll(QRe)){let d=oIe(r,u[1]);d&&l.add(d)}e.push({doc:r,features:c,doc_links:[...l].sort()})}return{docs:e}}function N5(t="."){let e=Rp(t);if(e.docs.length===0)return!1;let r=["# Cladding \xB7 Tier C \u2014 generated doc\u2192spec / doc\u2192doc link index (`clad sync`). Do not edit by hand.","# Source of truth is the docs themselves; DOC_LINK_INTEGRITY validates resolution.",'schema: "0.1"',"docs:"];for(let n of e.docs)n.features.length===0&&n.doc_links.length===0||(r.push(` ${JSON.stringify(n.doc)}:`),n.features.length>0&&r.push(` features: [${n.features.join(", ")}]`),n.doc_links.length>0&&r.push(` doc_links: [${n.doc_links.map(i=>JSON.stringify(i)).join(", ")}]`));return VRe(Op(t,"spec","_doc-links.yaml"),`${r.join(` +`;return f5(Eo(t,"spec","index.yaml"),n,"utf8"),!0}var Wv,kp=y(()=>{"use strict";Wv=St(er(),1)});import{existsSync as p5,readFileSync as m5,readdirSync as aRe}from"node:fs";import{join as tC}from"node:path";function cRe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}let n=_s(e),i=r.inventory;if(!i){let s=h5.filter(([c])=>(n[c]??0)>0);if(s.length===0)return rC(e);let a=s.map(([c,l])=>`${n[c]??0} ${l}`).join(", ");return[...rC(e),{detector:Ep,severity:"warn",path:"spec.yaml",message:`spec.yaml has no inventory: block, but the project has ${a} on disk \u2014 run \`clad sync\` to record the inventory so anyone reading spec.yaml sees its real scale.`}]}let o=[];for(let[s,a]of h5){let c=i[s]??0,l=n[s]??0;c!==l&&o.push({detector:Ep,severity:"error",path:"spec.yaml",message:`spec.yaml inventory.${s} declares ${c} but the project has ${l} ${a} on disk \u2014 run \`clad sync\` (a stale inventory hides created/deleted shards from anyone reading spec.yaml).`})}return o.push(...rC(e)),o}function rC(t){let e=tC(t,"spec","index.yaml"),r=tC(t,"spec","features");if(!p5(e)||!p5(r))return[];let n=new Map;try{for(let l of m5(e,"utf8").split(` +`)){let u=l.match(/^ (F-[\w-]+):.*\bstatus:\s*['"]?([\w-]+)['"]?/);if(u){n.set(u[1],u[2]);continue}let d=l.match(/^ (F-[\w-]+):/);d&&n.set(d[1],"planned")}}catch{return[]}let i=new Map;try{for(let l of aRe(r)){if(!l.endsWith(".yaml")&&!l.endsWith(".yml"))continue;let u=m5(tC(r,l),"utf8"),d=u.match(/^id:\s*['"]?(F-[\w-]+)['"]?/m);if(!d)continue;let f=u.match(/^status:\s*['"]?([\w-]+)['"]?/m);i.set(d[1],f?f[1]:"planned")}}catch{return[]}let o=[],s=[...i.keys()].filter(l=>!n.has(l)).sort(),a=[...n.keys()].filter(l=>!i.has(l)).sort();if(s.length>0||a.length>0){let l=[];s.length>0&&l.push(`missing from index: ${s.join(", ")}`),a.length>0&&l.push(`in index but not on disk: ${a.join(", ")}`),o.push({detector:Ep,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml disagrees with spec/features/ (${l.join("; ")}) \u2014 run \`clad sync\` to regenerate (a stale index silently misleads agents that trust it for lookup).`})}let c=[...i.keys()].filter(l=>n.has(l)&&n.get(l)!==i.get(l)).sort().map(l=>`${l} (index: ${n.get(l)}, shard: ${i.get(l)})`);return c.length>0&&o.push({detector:Ep,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml status disagrees with spec/features/ for ${c.join("; ")} \u2014 run \`clad sync\` to regenerate (a stale status silently misleads agents that trust the index).`}),o}var Ep,h5,g5,y5=y(()=>{"use strict";kp();Ue();Ep="INVENTORY_DRIFT",h5=[["features","feature shard(s)"],["scenarios","scenario shard(s)"],["capabilities","capabilit(ies)"],["test_files","test file(s)"]];g5={name:Ep,run:cRe}});import{existsSync as lRe,readFileSync as uRe}from"node:fs";import{join as dRe}from"node:path";function pRe(t){let{cwd:e="."}=t,r=dRe(e,"src","spec","schema.json"),n=[];if(lRe(r)){let i;try{i=JSON.parse(uRe(r,"utf8"))}catch(o){n.push({detector:Ap,severity:"error",message:`spec/schema.json unreadable or invalid JSON: ${o.message}`})}if(i)for(let o of fRe)i.required?.includes(o)||n.push({detector:Ap,severity:"error",message:`spec/schema.json does not require root key '${o}'`}),i.properties?.[o]||n.push({detector:Ap,severity:"error",message:`spec/schema.json does not declare property '${o}'`})}try{let i=q(e);i.schema!==_5&&n.push({detector:Ap,severity:"error",message:`spec.yaml schema='${i.schema}' but supported version is '${_5}'`})}catch{}return n}var Ap,fRe,_5,b5,v5=y(()=>{"use strict";Ue();Ap="META_INTEGRITY",fRe=["schema","project","features"],_5="0.1";b5={name:Ap,run:pRe}});function mRe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}let n=[];return S5(r.features.map(i=>({id:i.id,slug:i.slug})),"features",n),S5((r.scenarios??[]).map(i=>({id:i.id,slug:i.slug})),"scenarios",n),n}function S5(t,e,r){let n=new Map;for(let i of t){if(!i.slug)continue;let o=n.get(i.slug);o?r.push({detector:w5,severity:"error",message:`slug '${i.slug}' is used by both ${o} and ${i.id} in ${e}/ \u2014 two items in the same namespace cannot share a slug; pick a different slug for one`}):n.set(i.slug,i.id)}}var w5,x5,$5=y(()=>{"use strict";Ue();w5="SLUG_CONFLICT";x5={name:w5,run:mRe}});function Wl(t){return t==="planned"||t==="in_progress"}var Kv=y(()=>{"use strict"});import{existsSync as hRe}from"node:fs";import{join as gRe}from"node:path";function yRe(t){let{cwd:e="."}=t;return ge(e,Jv,r=>_Re(r,e))}function _Re(t,e){let r=[];for(let n of t.features)for(let i of n.modules??[]){let o=gRe(e,i);hRe(o)||r.push(bRe(n.id,i,n.status))}return r}function bRe(t,e,r){return Wl(r)?{detector:Jv,severity:"info",path:e,message:`feature ${t}'s module '${e}' is not built yet \u2014 the normal state between authoring the spec entry and implementing it`}:{detector:Jv,severity:"error",path:e,message:`feature ${t} declares module '${e}' but the file does not exist`}}var Jv,Yv,nC=y(()=>{"use strict";Kv();wt();Jv="MISSING_IMPLEMENTATION";Yv={name:Jv,run:yRe}});function vRe(t){let{cwd:e="."}=t;return ge(e,iC,SRe)}function SRe(t){let e=[];for(let r of t.features)if(r.status==="done")for(let n of r.acceptance_criteria??[]){let o=(n.test_refs??[]).filter(c=>!c.startsWith("derived:")).length>0,s=(n.evidence_refs?.length??0)>0,a=!o&&!s&&(n.test_refs?.length??0)>0;!o&&!s&&e.push({detector:iC,severity:"error",message:`${r.id}.${n.id} declares no test_refs or evidence_refs \u2014 AC is unverified`+(a?" (a 'derived:' candidate exists \u2014 confirm it by removing the prefix, or author a real ref)":"")})}return e}var iC,Xv,oC=y(()=>{"use strict";wt();iC="MISSING_TESTS";Xv={name:iC,run:vRe}});import{existsSync as wRe,readFileSync as xRe}from"node:fs";import{join as k5}from"node:path";function E5(t){if(wRe(t))try{return JSON.parse(xRe(t,"utf8"))}catch{return}}function ARe(t){let{cwd:e="."}=t,r=E5(k5(e,$Re)),n=E5(k5(e,kRe));if(!r||!n)return[{detector:sC,severity:"info",message:"perf baseline or current missing \u2014 run stage_3.2 with --record first"}];let i=[];for(let[o,s]of Object.entries(r.metrics??{})){let a=n.metrics?.[o];if(!a||typeof s.value!="number"||typeof a.value!="number"||s.value===0)continue;let c=(a.value-s.value)/s.value*100;c>ERe&&i.push({detector:sC,severity:"warn",message:`${o} regressed ${c.toFixed(1)}% (baseline ${s.value}${s.unit??""} \u2192 current ${a.value}${a.unit??""})`})}return i}var sC,$Re,kRe,ERe,A5,T5=y(()=>{"use strict";sC="PERFORMANCE_DRIFT",$Re="perf/baseline.json",kRe="perf/current.json",ERe=10;A5={name:sC,run:ARe}});import{existsSync as TRe}from"node:fs";import{join as ORe}from"node:path";function IRe(t){let{cwd:e="."}=t;return ge(e,aC,r=>CRe(r,e))}function PRe(t,e){return(t.modules??[]).some(r=>TRe(ORe(e,r)))}function CRe(t,e){let r=[];for(let s of t.features)s.status!=="planned"&&s.status!=="in_progress"||PRe(s,e)||r.push(s.id);let n=RRe;if(r.length<=n)return[];let i=r.slice(0,O5).join(", "),o=r.length>O5?", \u2026":"";return[{detector:aC,severity:"warn",message:`${r.length} planned/in_progress features have NO code on disk (> ${n} tolerated) \u2014 the spec has raced ahead of the code. Work one feature end-to-end before authoring the next (docs/feature-cycle.md). Stalled: ${i}${o}`}]}var aC,RRe,O5,R5,I5=y(()=>{"use strict";wt();aC="PLANNED_BACKLOG",RRe=5,O5=8;R5={name:aC,run:IRe}});import{existsSync as DRe,readFileSync as NRe}from"node:fs";import{join as jRe}from"node:path";function LRe(t){let{cwd:e="."}=t;return ge(e,cC,r=>zRe(r,e))}function zRe(t,e){if(t.features.lengthn.includes(i))?[{detector:cC,severity:"warn",path:"docs/project-context.md",message:`${t.features.length} features but docs/project-context.md is still the unrefined init template (it still carries the placeholder prompts) \u2014 the Why/What/Purpose narrative was never filled in. Fill it in with \`clad clarify\` or by hand.`}]:[]}var cC,MRe,FRe,P5,C5=y(()=>{"use strict";wt();cC="PROJECT_CONTEXT_DRIFT",MRe=8,FRe=["Refine by hand or re-run with LLM available","What gap or pain led to this project","What does success look like"];P5={name:cC,run:LRe}});function D5(t,e,r){return e?e.filter(n=>!t.has(n)).map(n=>({detector:Qv,severity:"error",message:`${r} references unknown id '${n}'`})):[]}function URe(t){let{cwd:e="."}=t;return ge(e,Qv,qRe)}function qRe(t){let e=new Set(t.features.map(n=>n.id)),r=[];for(let n of t.features)r.push(...D5(e,n.depends_on,`feature ${n.id}.depends_on`)),n.superseded_by&&!e.has(n.superseded_by)&&r.push({detector:Qv,severity:"error",message:`feature ${n.id}.superseded_by references unknown id '${n.superseded_by}'`});for(let n of t.scenarios??[])r.push(...D5(e,n.features,`scenario ${n.id}.features`));return r}var Qv,eS,lC=y(()=>{"use strict";wt();Qv="REFERENCE_INTEGRITY";eS={name:Qv,run:URe}});function Tp(t=""){return new RegExp(BRe,t)}var BRe,uC=y(()=>{"use strict";BRe=String.raw`\bF-(?:\d{3,}|[0-9a-f]{6,8})\b`});import{existsSync as HRe,readdirSync as GRe,readFileSync as ZRe,statSync as VRe,writeFileSync as WRe}from"node:fs";import{dirname as KRe,join as Op,normalize as JRe,relative as YRe}from"node:path";function rIe(t){let e=[];for(let r of t.matchAll(tIe))if(!r[1].trim().startsWith("ignore"))for(let n of r[1].match(Tp("g"))??[])e.push(n);return[...new Set(e)].sort()}function nIe(t){return t.replace(/```[\s\S]*?```/g," ").replace(/~~~[\s\S]*?~~~/g," ").replace(/`[^`\n]*`/g," ")}function N5(t){return t.split("\\").join("/")}function iIe(t){return XRe.some(e=>t===e||t.startsWith(`${e}/`))}function oIe(t){let e=Op(t,"docs");if(!HRe(e))return[];let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=GRe(i)}catch{continue}for(let s of o){if(s.startsWith("."))continue;let a=Op(i,s),c;try{c=VRe(a)}catch{continue}let l=N5(YRe(t,a));c.isDirectory()?n.push(a):s.endsWith(".md")&&r.push(l)}}return r.sort()}function sIe(t,e){if(/^[a-z]+:/i.test(e))return null;let r=JRe(Op(KRe(t),e));return N5(r)}function Rp(t="."){let e=[];for(let r of oIe(t)){let n;try{n=ZRe(Op(t,r),"utf8")}catch{continue}let i=nIe(n),o=rIe(i);if(iIe(r)){if(o.length===0)continue;e.push({doc:r,features:o,doc_links:[]});continue}let a=n.includes(QRe)?[]:i.match(Tp("g"))??[],c=[...new Set([...a,...o])].sort(),l=new Set;for(let u of i.matchAll(eIe)){let d=sIe(r,u[1]);d&&l.add(d)}e.push({doc:r,features:c,doc_links:[...l].sort()})}return{docs:e}}function j5(t="."){let e=Rp(t);if(e.docs.length===0)return!1;let r=["# Cladding \xB7 Tier C \u2014 generated doc\u2192spec / doc\u2192doc link index (`clad sync`). Do not edit by hand.","# Source of truth is the docs themselves; DOC_LINK_INTEGRITY validates resolution.",'schema: "0.1"',"docs:"];for(let n of e.docs)n.features.length===0&&n.doc_links.length===0||(r.push(` ${JSON.stringify(n.doc)}:`),n.features.length>0&&r.push(` features: [${n.features.join(", ")}]`),n.doc_links.length>0&&r.push(` doc_links: [${n.doc_links.map(i=>JSON.stringify(i)).join(", ")}]`));return WRe(Op(t,"spec","_doc-links.yaml"),`${r.join(` `)} -`,"utf8"),!0}var YRe,XRe,QRe,eIe,eS=y(()=>{"use strict";lC();YRe=["docs/ab-evaluation","docs/ab-evaluation-extended","docs/dogfood","docs/benchmarks"],XRe="clad-doc-links: ignore",QRe=/\]\(\s*([^)\s]+?\.md)(?:#[^)]*)?\s*\)/g,eIe=/clad-doc-links:[ \t]*([^\n>]*)/g});import{existsSync as sIe}from"node:fs";import{join as aIe}from"node:path";function cIe(t){let{cwd:e="."}=t;return ge(e,tS,r=>lIe(r,e))}function lIe(t,e){let r=new Set((t.features??[]).map(i=>i.id)),n=[];for(let i of Rp(e).docs){for(let o of i.doc_links)sIe(aIe(e,o))||n.push({detector:tS,severity:"error",path:i.doc,message:`doc '${i.doc}' links to missing file '${o}'`});for(let o of i.features)r.has(o)||n.push({detector:tS,severity:"warn",path:i.doc,message:`doc '${i.doc}' references unknown feature '${o}' \u2014 archived/renamed? If it is an illustrative example, add a \`clad-doc-links: ignore\` marker to the doc.`})}return n}var tS,rS,uC=y(()=>{"use strict";eS();wt();tS="DOC_LINK_INTEGRITY";rS={name:tS,run:cIe}});function uIe(t){let{cwd:e="."}=t;return ge(e,Ip,r=>dIe(r))}function dIe(t){let e=[],r=t.features.length,n=t.scenarios??[],i=r>=j5,o=t.project.onboarding_seeded===!0&&!i;r>=j5&&n.length===0&&e.push({detector:Ip,severity:"warn",path:"spec/scenarios/",message:`${r} features but no scenarios declared \u2014 cross-feature user-journey flows are not captured. Author at least one with \`clad_create_scenario\`.`});for(let a of n)(a.features??[]).length===0&&e.push({detector:Ip,severity:o?"info":"warn",path:"spec/scenarios/",message:o?`scenario ${a.id} binds no features yet \u2014 retained as future onboarding intent; bind it when a matching feature lands.`:`scenario ${a.id} binds no features (features: []) \u2014 a scenario must cover at least one feature's flow, or it should be removed.`});let s=new Map(t.features.filter(a=>typeof a.slug=="string"&&a.slug.length>0).map(a=>[a.slug,a.id]));for(let a of n){if(!a.flow)continue;let c=new Set(a.features??[]),l=new Map;for(let u of a.flow.matchAll(/\(([^)]+)\)/g))for(let d of u[1].split(/[,/·]/)){let f=d.trim(),p=s.get(f);p&&!c.has(p)&&l.set(f,p)}if(l.size>0){let u=[...l].map(([d,f])=>`${d} (${f})`).join(", ");e.push({detector:Ip,severity:"warn",path:"spec/scenarios/",message:`scenario ${a.id} flow references ${u} but features[] does not bind ${l.size===1?"it":"them"} \u2014 bind every feature the flow walks, or trim the flow so coverage is not under-stated.`})}}return e}var Ip,j5,M5,F5=y(()=>{"use strict";wt();Ip="SCENARIO_COVERAGE",j5=8;M5={name:Ip,run:uIe}});import{createHash as fIe}from"node:crypto";function pIe(t){return!Number.isFinite(t)||t<=0?0:t>=1?1:t}function Pp(t,e=0){if(t.oracle_policy){let r=t.oracle_policy;return{mandateActive:!0,reportOnly:!1,exhaustive:!1,alwaysEars:new Set(r.always_ears??L5),sample:pIe(r.sample??0)}}return t.require_oracles===!0?{mandateActive:!0,reportOnly:!1,exhaustive:!0,alwaysEars:new Set,sample:1}:t.require_oracles===void 0&&e>=8?{mandateActive:!0,reportOnly:!0,exhaustive:!1,alwaysEars:new Set(L5),sample:0}:{mandateActive:!1,reportOnly:!1,exhaustive:!1,alwaysEars:new Set,sample:0}}function Cp(t){return(t.features??[]).filter(e=>e.status==="done").length}function mIe(t,e){return e<=0?!1:e>=1?!0:parseInt(fIe("sha256").update(t).digest("hex").slice(0,8),16)%1e40})}return r}var L5,nS=y(()=>{"use strict";L5=["unwanted"]});import{chmodSync as hIe,existsSync as U5,readFileSync as gIe,readdirSync as yIe,statSync as q5,unlinkSync as _Ie,utimesSync as bIe,writeFileSync as vIe}from"node:fs";import{join as B5}from"node:path";import H5 from"node:process";function SIe(t){return eJ(t).map(e=>{try{let r=q5(e);return r.isFile()?{path:e,body:gIe(e),mode:r.mode,atime:r.atime,mtime:r.mtime}:{path:e,nonFile:!0}}catch(r){if(r.code==="ENOENT")return{path:e};throw r}})}function wIe(t){let e=[];for(let r of t)if(!r.nonFile)try{if(r.body===void 0){if(!U5(r.path))continue;if(!q5(r.path).isFile()){e.push(`${r.path}: scoped oracle run created a non-file report candidate`);continue}_Ie(r.path);continue}vIe(r.path,r.body),r.mode!==void 0&&hIe(r.path,r.mode),r.atime&&r.mtime&&bIe(r.path,r.atime,r.mtime)}catch(n){e.push(`${r.path}: ${n.message}`)}return e}function xIe(t){let e=!1,r=n=>{for(let i of yIe(n,{withFileTypes:!0})){if(e)return;let o=B5(n,i.name);i.isDirectory()?r(o):(/\.(test|spec)\.[cm]?[jt]sx?$/.test(i.name)||/_test\.py$/.test(i.name))&&(e=!0)}};try{r(t)}catch{}return e}function dC(t={}){let{cwd:e="."}=t,r=B5(e,bs);if(!U5(r)||!xIe(r))return{stage:Ka,pass:!1,exitCode:2,stderr:`no spec-conformance oracles under ${bs}/ \u2014 skipped`};let n=dt(e),i=n.gates.test;if(!i?.cmd||!i.args)return{stage:Ka,pass:!1,exitCode:2,stderr:`no test runner registered for language '${n.language}'`};let o;try{o=SIe(e)}catch(d){return{stage:Ka,pass:!1,exitCode:1,stderr:`could not preserve the full test report before the scoped oracle run: ${d.message}`}}let s,a,c=[...i.args,bs];try{s=We(i.cmd,c,{cwd:e,reject:!1})}catch(d){a=d}let l=wIe(o);if(l.length>0)return{stage:Ka,pass:!1,exitCode:1,stderr:`could not restore the full test report after the scoped oracle run: ${l.join("; ")}`};if(a||!s)return{stage:Ka,pass:!1,exitCode:1,stderr:`oracle runner failed to start: ${a?.message??"unknown error"}`};let u=Nt(Ka,i.cmd,s,c);return u||Yt(Ka,s)}var Ka,bs,$Ie,fC=y(()=>{"use strict";Mr();sn();dp();Rn();Ka="stage_2.3",bs="tests/oracle";$Ie=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${H5.argv[1]}`;if($Ie){let t=dC();console.log(JSON.stringify(t)),H5.exit(t.exitCode)}});import{existsSync as kIe}from"node:fs";import{join as EIe}from"node:path";function AIe(t){let{cwd:e="."}=t;return ge(e,ii,r=>TIe(r,e))}function TIe(t,e){let r=[],n=Pp(t.project,Cp(t)),i=n.reportOnly?"info":"error",o=n.mandateActive?In(e):[],s=o.filter(l=>l.kind==="oracle"),a=new Set(["agent:developer","agent:specialists"]),c=l=>o.find(u=>u.featureId===l&&a.has(u.stage))?.identity.name;for(let l of t.features)if(l.status==="done")for(let u of l.acceptance_criteria??[]){let d=u.oracle_refs??[];if(Dp(n,l.id,u)&&d.length===0){let f=n.exhaustive?"project.require_oracles is set":u.ears&&n.alwaysEars.has(u.ears)?`oracle_policy.always_ears includes '${u.ears}'`:"selected by oracle_policy.sample";r.push({detector:ii,severity:i,message:`${l.id}.${u.id} done AC lacks a spec-conformance oracle (${f}; declare oracle_refs under ${bs}/)`+(n.reportOnly?" [report-only \u2014 the graduated default enforces in 0.7]":"")})}for(let f of d){if(!kIe(EIe(e,f))){r.push({detector:ii,severity:"error",path:f,message:`${l.id}.${u.id} oracle_ref '${f}' resolves to nothing on disk`});continue}if(f.startsWith(`${bs}/`)||r.push({detector:ii,severity:"warn",path:f,message:`${l.id}.${u.id} oracle_ref '${f}' lives outside ${bs}/ \u2014 stage_2.3 only runs ${bs}/, so this oracle will not execute`}),!n.mandateActive)continue;let p=s.find(g=>g.featureId===l.id&&g.acId===u.id&&g.artifact===f);if(!p){r.push({detector:ii,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' has no authoring-provenance record \u2014 author it via 'clad oracle' (or clad_author_oracle) so impl-blindness can be verified`});continue}let m=c(l.id);m&&p.identity.name===m?r.push({detector:ii,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' is NOT impl-blind: authored by the implementer ('${m}')`}):m||r.push({detector:ii,severity:"info",message:`${l.id}.${u.id} oracle author\u2260implementer not verified \u2014 no implementer identity recorded (no clad run history to compare)`});let h=(p.readManifest??[]).filter(g=>(l.modules??[]).includes(g));h.length>0&&r.push({detector:ii,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' is NOT impl-blind: author read implementation file(s) the feature owns (${h.join(", ")})`}),p.blind===!1&&r.push({detector:ii,severity:"info",message:`${l.id}.${u.id} oracle '${f}' provenance is self-reported (host-protocol), not cladding-controlled \u2014 manifest checked, blindness unproven`})}}if(n.mandateActive&&!n.exhaustive){let l=t.features.filter(u=>u.status==="done").flatMap(u=>u.acceptance_criteria??[]).filter(u=>!u.ears).length;l>0&&r.push({detector:ii,severity:"info",message:`${l} done AC(s) carry no EARS tag and are invisible to the risk-weighted oracle mandate \u2014 tag them (ubiquitous/event/state/optional/unwanted/complex) for the mandate to mean anything.`})}return r}var ii,G5,Z5=y(()=>{"use strict";ni();nS();fC();wt();ii="SPEC_CONFORMANCE";G5={name:ii,run:AIe}});function OIe(t){let{cwd:e="."}=t,r=In(e);if(r.length===0)return[{detector:pC,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=Date.now(),i=[];for(let o of r){let s=Date.parse(o.identity.timestamp);if(Number.isNaN(s))continue;let a=(n-s)/(1e3*60*60*24);a>V5&&i.push({detector:pC,severity:"warn",message:`evidence ${o.id} is ${Math.round(a)} days old (floor ${V5})`})}return i}var pC,V5,W5,K5=y(()=>{"use strict";ni();pC="STALE_EVIDENCE",V5=90;W5={name:pC,run:OIe}});import{existsSync as J5}from"node:fs";import{join as Y5}from"node:path";function RIe(t){let{cwd:e="."}=t;return ge(e,Kl,r=>IIe(r,e))}function IIe(t,e){let r=[];for(let n of t.features){if(n.archived_at&&n.status!=="archived"&&r.push({detector:Kl,severity:"warn",message:`feature ${n.id} has archived_at but status='${n.status}' (expected 'archived')`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:`archived_at already set but status is '${n.status}'`}}}),n.superseded_by&&!n.archived_at&&r.push({detector:Kl,severity:"warn",message:`feature ${n.id} has superseded_by but no archived_at`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:`superseded by ${n.superseded_by} but missing archived_at`}}}),n.status==="archived"){let i=(n.modules??[]).filter(o=>J5(Y5(e,o)));i.length>0&&r.push({detector:Kl,severity:"warn",message:`feature ${n.id} is archived but ${i.length} module(s) still exist: ${i.join(", ")}`})}Wl(n.status)&&(n.modules?.length??0)>0&&!(n.modules??[]).some(i=>J5(Y5(e,i)))&&r.push({detector:Kl,severity:"info",message:`feature ${n.id} (status='${n.status}') declares ${n.modules?.length??0} module(s) that aren't built yet \u2014 the normal state while implementing (not stale)`})}return r}var Kl,iS,mC=y(()=>{"use strict";Wv();wt();Kl="STALE_SPECIFICATION";iS={name:Kl,run:RIe}});import{existsSync as X5,statSync as Q5}from"node:fs";import{join as eY}from"node:path";function CIe(t,e){let r=0;for(let n of e){let i=eY(t,n);if(!X5(i))continue;let o=Q5(i).mtimeMs;o>r&&(r=o)}return r}function DIe(t){let{cwd:e="."}=t;return ge(e,hC,r=>NIe(r,e))}function NIe(t,e){let r=Fi(e,t.project?.language),n=t.features.flatMap(a=>a.modules??[]),i=CIe(e,n);if(i===0)return[];let o=ys([...r.testGlobs],{cwd:e,dot:!1});if(o.length===0)return[];let s=[];for(let a of o){let c=eY(e,a);if(!X5(c))continue;let l=Q5(c).mtimeMs,u=(i-l)/(1e3*60*60*24);u>PIe&&s.push({detector:hC,severity:"warn",path:a,message:`${a} is ${Math.round(u)} days older than newest source module`})}return s}var hC,PIe,oS,gC=y(()=>{"use strict";vp();Ba();wt();hC="STALE_TESTS",PIe=30;oS={name:hC,run:DIe}});import{existsSync as jIe}from"node:fs";import{join as MIe}from"node:path";function FIe(t){let{cwd:e="."}=t;return ge(e,Np,r=>LIe(r,e))}function LIe(t,e){let r=[];for(let n of t.features){let i=n.modules??[],o=n.acceptance_criteria??[];if(n.status==="done"&&i.length===0&&o.length===0){r.push({detector:Np,severity:"error",message:`feature ${n.id} status='done' but declares no modules and no acceptance_criteria \u2014 nothing to verify (hollow completion)`});continue}if(i.length===0)continue;let s=i.filter(a=>!jIe(MIe(e,a)));s.length!==0&&(n.status==="done"?r.push({detector:Np,severity:"error",message:`feature ${n.id} status='done' but ${s.length}/${i.length} module(s) missing: ${s.join(", ")}`}):n.status==="in_progress"&&s.length===i.length&&r.push({detector:Np,severity:Wl(n.status)?"info":"warn",message:`feature ${n.id} is in progress and none of its declared modules are built yet \u2014 the normal state while implementing`}))}return r}var Np,sS,yC=y(()=>{"use strict";Wv();wt();Np="STATUS_DRIFT";sS={name:Np,run:FIe}});function zIe(t){let{cwd:e="."}=t;return ge(e,aS,r=>UIe(r,e))}function UIe(t,e){let r=dt(e).language;return r==="unknown"?[{detector:aS,severity:"info",message:"no manifest matched \u2014 language cannot be cross-checked"}]:t.project.language===r?[]:[{detector:aS,severity:"warn",message:`spec.project.language='${t.project.language}' but the manifest chain detects '${r}'`}]}var aS,tY,rY=y(()=>{"use strict";sn();wt();aS="TECH_STACK_MISMATCH";tY={name:aS,run:zIe}});function GIe(t){if((t.features??[]).length`${i}/${o}/**/*.${n}`)}function ZIe(t){let{cwd:e="."}=t;return ge(e,_C,r=>VIe(r,e))}function VIe(t,e){let r=new Set;for(let o of t.features)for(let s of o.modules??[])r.add(s);let n=ys([...GIe(t)],{cwd:e,dot:!1}),i=[];for(let o of n)r.has(o)||i.push({detector:_C,severity:"error",path:o,message:`file '${o}' is not claimed by any feature in spec.yaml`});return i}var _C,nY,qIe,BIe,HIe,cS,bC=y(()=>{"use strict";vp();BP();wt();_C="UNMAPPED_ARTIFACT",nY=["src/stages/**/*.ts","src/spec/**/*.ts"],qIe={typescript:"ts",javascript:"js",python:"py",rust:"rs",go:"go",kotlin:"kt"},BIe={kotlin:"src/main/kotlin"},HIe=8;cS={name:_C,run:ZIe}});import{existsSync as iY}from"node:fs";import{join as oY}from"node:path";function KIe(t){return WIe.some(e=>t.startsWith(e))}function JIe(t){let{cwd:e="."}=t;return ge(e,vC,r=>YIe(r,e))}function YIe(t,e){let r=[];for(let n of t.features)if(n.status==="done")for(let i of n.acceptance_criteria??[])for(let o of i.test_refs??[]){if(KIe(o))continue;let s=o.split("#",1)[0];iY(oY(e,o))||s&&iY(oY(e,s))||r.push({detector:vC,severity:"error",path:o,message:`${n.id}.${i.id} test_ref '${o}' resolves to nothing on disk \u2014 a test_ref must be a real file path (e.g. 'tests/x.test.ts', optionally with a '#' anchor) or a 'self-dogfood: +`}function jx(t){return`${JSON.stringify(t,null,2)} +`}function ite(t){let e=new Map(t.nodes.map(s=>[s.id,s])),r=new Map,n=new Map;for(let s of t.edges)(r.get(s.from)??r.set(s.from,[]).get(s.from)).push({other:s.to,kind:s.kind}),(n.get(s.to)??n.set(s.to,[]).get(s.to)).push({other:s.from,kind:s.kind});let i=s=>{let a=e.get(s);return a?`[[${ete(a)}|${a.label.replace(/[[\]|]/g," ")}]]`:`[[${s.replace(/[[\]|]/g," ")}]]`},o=new Map;for(let s of t.nodes){let a=["---",`kind: ${s.kind}`,...s.tier?[`tier: ${s.tier}`]:[],...s.status?[`status: ${s.status}`]:[],`id: ${JSON.stringify(s.id)}`,"---",`# ${s.label}`,""],c=(r.get(s.id)??[]).slice().sort(tte);if(c.length>0){a.push("## Links");for(let u of c)a.push(`- ${u.kind} \u2192 ${i(u.other)}`);a.push("")}let l=(n.get(s.id)??[]).slice().sort(tte);if(l.length>0){a.push("## Backlinks");for(let u of l)a.push(`- ${i(u.other)} \u2192 ${u.kind}`);a.push("")}o.set(`${s.kind}/${ete(s)}.md`,`${a.join(` +`)}`)}return o}function tte(t,e){return t.kind.localeCompare(e.kind)||t.other.localeCompare(e.other)}import{readFileSync as GUe}from"node:fs";import{dirname as ZUe,join as kj}from"node:path";import{fileURLToPath as VUe}from"node:url";var Ej=ZUe(VUe(import.meta.url));function ote(t){for(let e of[kj(Ej,"viewer",t),kj(Ej,"..","graph","viewer",t),kj(Ej,"..","..","dist","viewer",t)])try{return GUe(e,"utf8")}catch{}throw new Error(`cladding: viewer asset not found: ${t}`)}function ste(t){return JSON.stringify(t).replace(/0?` `:"";return` @@ -895,21 +896,21 @@ ${n.report.remainingQuestions} question(s) left. continue with \`clad clarify ${n} -`}VP();uC();rC();iC();cC();ZP();gC();yC();bC();SC();Km();lC();Ue();var GUe=[Yv,lS,Jv,cS,Qv,rS,Gv,sS,oS,Hv];function ZUe(t,e){if(t.path){let n=t.path.split("#")[0].trim(),i=[qe.module(n),qe.test(n),qe.doc(n)].filter(o=>e.has(o));if(i.length>0)return i}let r=Tp().exec(t.message??"");return r&&e.has(qe.feature(r[0]))?[qe.feature(r[0])]:[]}function Mx(t,e="."){let r=new Set(t.nodes.map(o=>o.id)),n={};try{Ea(e,B(e))}catch{}try{for(let o of GUe){let s=[];try{s=o.run({cwd:e})}catch{continue}for(let a of s)if(!(a.severity!=="error"&&a.severity!=="warn"))for(let c of ZUe(a,r)){let l=n[c]??(n[c]={severity:"warn",count:0,detectors:new Set});l.count+=1,l.detectors.add(a.detector),a.severity==="error"&&(l.severity="error")}}}finally{Ea(e,null)}let i={};for(let o of Object.keys(n).sort()){let s=n[o];i[o]={severity:s.severity,count:s.count,detectors:[...s.detectors].sort()}}return i}Ej();Ue();Ii();var WUe=new Set(["mermaid","dot","json","obsidian","html"]);function ate(t={}){try{let e=t.format??"mermaid";if(!WUe.has(e)){L("fail","graph",`unknown --format '${e}' \u2014 use mermaid | dot | json | obsidian | html`),process.exit(1);return}let r=e,n=B(),i=wc(n,".");if(t.focus){let s=Ix(n,i,t.focus);if(s.length===0){L("fail","graph",`no node matches '${t.focus}' \u2014 try a feature id (F-\u2026), slug, or module path`),process.exit(1);return}let a=t.depth!==void 0?Number(t.depth):1/0;if(Number.isNaN(a)||a<0){L("fail","graph",`--depth must be a non-negative number, got '${t.depth}'`),process.exit(1);return}i=Rx(i,s,a)}if(r==="obsidian"){let s=t.out??".cladding/graph",a=nte(i);for(let[c,l]of a){let u=VUe(s,c);Aj(Oj(u),{recursive:!0}),Tj(u,l,"utf8")}L("pass","graph",`wrote ${a.size} note(s) to ${s} \u2014 open it as an Obsidian vault`),process.exit(0);return}if(r==="html"){if(!t.out){L("fail","graph","--format html requires --out (a single self-contained .html file)"),process.exit(1);return}let s=jx(i,Mx(i,"."));Aj(Oj(t.out),{recursive:!0}),Tj(t.out,s,"utf8"),L("pass","graph",`wrote a self-contained viewer to ${t.out} \u2014 open it in a browser (offline)`),process.exit(0);return}let o=r==="dot"?rte(i):r==="json"?Nx(i):tte(i);t.out?(Aj(Oj(t.out),{recursive:!0}),Tj(t.out,o,"utf8"),L("pass","graph",`wrote ${r} graph to ${t.out}`),process.exit(0)):process.stdout.write(o,()=>process.exit(0))}catch(e){L("fail","graph",e.message),process.exit(1)}}function cte(){try{let t=wc(B(),".");process.stdout.write(ste(Fx(t)),()=>process.exit(0))}catch(t){L("fail","graph",t.message),process.exit(1)}}Km();import{createServer as KUe}from"node:http";import{existsSync as JUe,watch as YUe}from"node:fs";import{join as XUe}from"node:path";Ue();Ii();function QUe(t={}){let e=t.cwd??".",r=new Set,n=()=>wc(B(e),e),i=()=>{for(let u of r)try{u.write(`data: refresh +`}WP();dC();nC();oC();lC();VP();yC();_C();vC();wC();Jm();uC();Ue();var WUe=[Xv,uS,Yv,lS,eS,nS,Zv,aS,sS,Gv];function KUe(t,e){if(t.path){let n=t.path.split("#")[0].trim(),i=[qe.module(n),qe.test(n),qe.doc(n)].filter(o=>e.has(o));if(i.length>0)return i}let r=Tp().exec(t.message??"");return r&&e.has(qe.feature(r[0]))?[qe.feature(r[0])]:[]}function Fx(t,e="."){let r=new Set(t.nodes.map(o=>o.id)),n={};try{Ea(e,q(e))}catch{}try{for(let o of WUe){let s=[];try{s=o.run({cwd:e})}catch{continue}for(let a of s)if(!(a.severity!=="error"&&a.severity!=="warn"))for(let c of KUe(a,r)){let l=n[c]??(n[c]={severity:"warn",count:0,detectors:new Set});l.count+=1,l.detectors.add(a.detector),a.severity==="error"&&(l.severity="error")}}}finally{Ea(e,null)}let i={};for(let o of Object.keys(n).sort()){let s=n[o];i[o]={severity:s.severity,count:s.count,detectors:[...s.detectors].sort()}}return i}Aj();Ue();Ii();var YUe=new Set(["mermaid","dot","json","obsidian","html"]);function cte(t={}){try{let e=t.format??"mermaid";if(!YUe.has(e)){L("fail","graph",`unknown --format '${e}' \u2014 use mermaid | dot | json | obsidian | html`),process.exit(1);return}let r=e,n=q(),i=wc(n,".");if(t.focus){let s=Px(n,i,t.focus);if(s.length===0){L("fail","graph",`no node matches '${t.focus}' \u2014 try a feature id (F-\u2026), slug, or module path`),process.exit(1);return}let a=t.depth!==void 0?Number(t.depth):1/0;if(Number.isNaN(a)||a<0){L("fail","graph",`--depth must be a non-negative number, got '${t.depth}'`),process.exit(1);return}i=Ix(i,s,a)}if(r==="obsidian"){let s=t.out??".cladding/graph",a=ite(i);for(let[c,l]of a){let u=JUe(s,c);Tj(Rj(u),{recursive:!0}),Oj(u,l,"utf8")}L("pass","graph",`wrote ${a.size} note(s) to ${s} \u2014 open it as an Obsidian vault`),process.exit(0);return}if(r==="html"){if(!t.out){L("fail","graph","--format html requires --out (a single self-contained .html file)"),process.exit(1);return}let s=Mx(i,Fx(i,"."));Tj(Rj(t.out),{recursive:!0}),Oj(t.out,s,"utf8"),L("pass","graph",`wrote a self-contained viewer to ${t.out} \u2014 open it in a browser (offline)`),process.exit(0);return}let o=r==="dot"?nte(i):r==="json"?jx(i):rte(i);t.out?(Tj(Rj(t.out),{recursive:!0}),Oj(t.out,o,"utf8"),L("pass","graph",`wrote ${r} graph to ${t.out}`),process.exit(0)):process.stdout.write(o,()=>process.exit(0))}catch(e){L("fail","graph",e.message),process.exit(1)}}function lte(){try{let t=wc(q(),".");process.stdout.write(ate(Lx(t)),()=>process.exit(0))}catch(t){L("fail","graph",t.message),process.exit(1)}}Jm();import{createServer as XUe}from"node:http";import{existsSync as QUe,watch as eqe}from"node:fs";import{join as tqe}from"node:path";Ue();Ii();function rqe(t={}){let e=t.cwd??".",r=new Set,n=()=>wc(q(e),e),i=()=>{for(let u of r)try{u.write(`data: refresh -`)}catch{r.delete(u)}},o=KUe((u,d)=>{let f=(u.url??"/").split("?")[0],p=(u.headers.host??"").split(":")[0];if(p&&p!=="localhost"&&p!=="127.0.0.1"&&p!=="[::1]"&&p!=="::1"){d.writeHead(403,{"Content-Type":"text/plain"}),d.end("forbidden host");return}try{if(f==="/graph.json"){let m=Nx(n());d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(m);return}if(f==="/health.json"){let m=JSON.stringify(Mx(n(),e));d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(m);return}if(f==="/events"){d.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),d.write(`: connected +`)}catch{r.delete(u)}},o=XUe((u,d)=>{let f=(u.url??"/").split("?")[0],p=(u.headers.host??"").split(":")[0];if(p&&p!=="localhost"&&p!=="127.0.0.1"&&p!=="[::1]"&&p!=="::1"){d.writeHead(403,{"Content-Type":"text/plain"}),d.end("forbidden host");return}try{if(f==="/graph.json"){let m=jx(n());d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(m);return}if(f==="/health.json"){let m=JSON.stringify(Fx(n(),e));d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(m);return}if(f==="/events"){d.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),d.write(`: connected -`),r.add(d),u.on("close",()=>r.delete(d));return}if(f==="/"||f==="/index.html"){let m=jx(n());d.writeHead(200,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),d.end(m);return}d.writeHead(404,{"Content-Type":"text/plain"}),d.end("not found")}catch(m){if(d.headersSent)try{d.end()}catch{}else{d.writeHead(503,{"Content-Type":"application/json","Cache-Control":"no-store"});try{d.end(JSON.stringify({error:m.message}))}catch{}}}}),s=null,a=()=>{s&&clearTimeout(s),s=setTimeout(i,400)},c=[];for(let u of["spec","docs"]){let d=XUe(e,u);if(JUe(d))try{let f=YUe(d,{recursive:!0},a);f.on("error",()=>{try{f.close()}catch{}}),c.push(f)}catch{}}let l=setInterval(()=>{for(let u of r)try{u.write(`: keep-alive +`),r.add(d),u.on("close",()=>r.delete(d));return}if(f==="/"||f==="/index.html"){let m=Mx(n());d.writeHead(200,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),d.end(m);return}d.writeHead(404,{"Content-Type":"text/plain"}),d.end("not found")}catch(m){if(d.headersSent)try{d.end()}catch{}else{d.writeHead(503,{"Content-Type":"application/json","Cache-Control":"no-store"});try{d.end(JSON.stringify({error:m.message}))}catch{}}}}),s=null,a=()=>{s&&clearTimeout(s),s=setTimeout(i,400)},c=[];for(let u of["spec","docs"]){let d=tqe(e,u);if(QUe(d))try{let f=eqe(d,{recursive:!0},a);f.on("error",()=>{try{f.close()}catch{}}),c.push(f)}catch{}}let l=setInterval(()=>{for(let u of r)try{u.write(`: keep-alive -`)}catch{r.delete(u)}},3e4);return typeof l.unref=="function"&&l.unref(),new Promise((u,d)=>{o.on("error",d),o.listen(t.port??0,"127.0.0.1",()=>{let f=o.address(),p=typeof f=="object"&&f?f.port:t.port??0;u({port:p,broadcast:i,close:()=>new Promise(m=>{s&&clearTimeout(s),clearInterval(l);for(let h of c)try{h.close()}catch{}for(let h of r)try{h.end()}catch{}r.clear(),o.close(()=>m()),typeof o.closeAllConnections=="function"&&o.closeAllConnections()})})})})}async function lte(t={}){let e=t.port!==void 0?Number(t.port):3e3;try{let r=await QUe({port:e,cwd:t.cwd??"."});L("pass","graph",`live graph at http://localhost:${r.port} \u2014 edit spec/ or docs/ and the view auto-reloads (Ctrl-C to stop)`)}catch(r){L("fail","graph",r.message),process.exit(1)}}var eqe=["stage_1.1","stage_2.1","stage_2.3"];function tqe(t){return(t.features??[]).filter(e=>e.status==="done")}function rqe(t,e){let r=tqe(t);switch(e){case"stage_1.1":return!t.project?.language||r.length===0?null:`project.language is '${t.project.language}' and ${r.length} feature(s) are done, but the type checker did not run (skipped) \u2014 type safety of shipped code was never verified. Install the language toolchain; under --strict, an unverifiable 'done' is not GREEN.`;case"stage_2.1":{let n=r.filter(i=>(i.acceptance_criteria??[]).some(o=>(o.test_refs??[]).length>0)).length;return n===0?null:`${n} done feature(s) declare tests but the test runner did not run (skipped) \u2014 the implementation was never verified. Install the test framework; under --strict, an unverifiable 'done' is not GREEN.`}case"stage_2.3":{let n=r.flatMap(i=>i.acceptance_criteria??[]).filter(i=>(i.oracle_refs??[]).length>0).length;return n===0?null:`${n} done AC(s) declare oracle_refs but the conformance runner did not run (skipped) \u2014 the declared oracles never executed. Under --strict, declared-but-unrun verification is not GREEN.`}}}function ute(t,e){let r=[];for(let n of eqe){if(!e.some(s=>s.stage===n&&s.status==="skip"))continue;let o=rqe(t,n);o&&r.push({stage:n,label:"Verification",message:o})}return r}SS();import dte from"node:process";function nqe(t,e){let r=e.filter(i=>i.acId===t),n=r.filter(i=>i.identity.author==="human");return n.length===0?{acId:t,pass:!1,totalEvidence:r.length,humanEvidence:0,reason:r.length===0?"no evidence at all":`${r.length} tool/LLM evidence but 0 human \u2014 anti-self-cert guard blocks`}:{acId:t,pass:!0,totalEvidence:r.length,humanEvidence:n.length}}function Lx(t){let e=new Set;for(let n of t)n.acId&&e.add(n.acId);let r=[];for(let n of e){let i=nqe(n,t);i.pass||r.push(i)}return r}ni();var Rj="stage_4.1";function Ij(t={}){let{cwd:e="."}=t,r=In(e);if(r.length===0)return{stage:Rj,pass:!1,exitCode:2,stderr:"no audit log present \u2014 record evidence before running stage_4.1"};let n=Lx(r);if(n.length===0)return{stage:Rj,pass:!0,exitCode:0};let i=n.map(o=>`${o.acId}: ${o.reason}`).join("; ");return{stage:Rj,pass:!1,exitCode:1,stderr:`anti-self-cert guard: ${i}`}}var iqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${dte.argv[1]}`;if(iqe){let t=Ij();console.log(JSON.stringify(t)),dte.exit(t.exitCode)}Sl();import{randomBytes as oqe}from"node:crypto";import{unlinkSync as sqe}from"node:fs";import{tmpdir as aqe}from"node:os";import{join as cqe,resolve as Pj}from"node:path";import lqe from"node:process";var qr=null;function fte(t){qr={cwd:Pj(t),run:null,jsonFile:null}}function Cj(){return qr!==null}function Dj(t,e){if(!qr||qr.cwd!==Pj(t))return null;if(qr.run)return qr.run;let r=cqe(aqe(),`clad-shared-vitest-${lqe.pid}-${oqe(6).toString("hex")}.json`);qr.jsonFile=r;let n=e(r);return qr.run={proc:n,jsonFile:r},qr.run}function pte(t){return!qr||qr.cwd!==Pj(t)?null:qr.run}function Nj(t){return t.pass&&t.exitCode===0?"reuse-pass":"fallback"}function mte(){let t=qr?.jsonFile;if(qr=null,t)try{sqe(t)}catch{}}Mr();import hte from"node:process";var zx="stage_1.4";function jj(t={}){let{cwd:e="."}=t,r;try{r=We("git",["status","--porcelain"],{cwd:e,reject:!1})}catch(i){if(i.code==="ENOENT")return{stage:zx,pass:!1,exitCode:2,stderr:"git binary not found"};throw i}if(r.exitCode!==0){let i=(r.stderr??"").toString().trim()||"not a git repository";return{stage:zx,pass:!1,exitCode:2,stderr:i}}let n=(r.stdout??"").toString().trim();return n.length===0?{stage:zx,pass:!0,exitCode:0}:{stage:zx,pass:!1,exitCode:1,stderr:`working tree dirty: -${n}`}}var uqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${hte.argv[1]}`;if(uqe){let t=jj();console.log(JSON.stringify(t)),hte.exit(t.exitCode)}Mr();import gte from"node:process";Jm();Rn();var Ux="stage_2.2";function Mj(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=Yi("coverage",t))}catch(c){return{stage:Ux,pass:!1,exitCode:1,stderr:c.message}}if(!r||!n)return{stage:Ux,pass:!1,exitCode:2,stderr:`no coverage runner registered for language '${i}'`};let o=pte(e),s=o?o.proc:We(r,[...n],{cwd:e,reject:!1}),a=Nt(Ux,r,s,n);return a||Yt(Ux,s)}var pqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${gte.argv[1]}`;if(pqe){let t=Mj();console.log(JSON.stringify(t)),gte.exit(t.exitCode)}Mp();Fj();Mr();sn();Rn();import _te from"node:process";var Hx="stage_3.2";function Lj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.perf,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Hx,pass:!1,exitCode:2,stderr:`no perf runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bl(e,o[o.length-1]))return{stage:Hx,pass:!1,exitCode:2,stderr:"perf npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Hx,i,s,o);return a||Yt(Hx,s)}var Cqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${_te.argv[1]}`;if(Cqe){let t=Lj();console.log(JSON.stringify(t)),_te.exit(t.exitCode)}Mr();Ue();Rn();import{existsSync as Dqe}from"node:fs";import{resolve as vte}from"node:path";import Ste from"node:process";var di="stage_2.4",zj=5e3,Nqe=3e4;function Uj(t={}){let{cwd:e="."}=t,r,n=[],i=!1,o=new Map;try{let p=B(e);r=p.project.deliverable,n=p.project.smoke??[],i=p.features.some(m=>m.status==="done"),o=new Map(p.features.map(m=>[m.id,m.status]))}catch{return{stage:di,pass:!1,exitCode:2,stderr:"spec.yaml not loaded \u2014 deliverable smoke skipped"}}if(n.length>0)return Mqe(e,n,{anyDone:i,featureStatus:o});if(!r)return{stage:di,pass:!1,exitCode:2,stderr:"no project.deliverable declared \u2014 skipped"};if(r.is_safe_to_smoke!==!0)return{stage:di,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not marked is_safe_to_smoke \u2014 skipped`};if(!i)return{stage:di,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 deliverable smoke skipped"};let s=vte(e,r.path);if(!Dqe(s))return{stage:di,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not found \u2014 see DELIVERABLE_INTEGRITY`};let a=r.timeout_ms??zj,c;try{c=We(s,[...r.smoke_args??[]],{cwd:e,reject:!1,timeout:a})}catch(p){c=p}let l=Nt(di,r.path,c);if(l)return l;if(c.timedOut)return{stage:di,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' timed out after ${a}ms (hung or too slow)`};let u=r.expect_exit??0,d=c.exitCode??1;if(d===u)return{stage:di,pass:!0,exitCode:0,disposition:"liveness"};let f=String(c.stderr??"").trim()||String(c.stdout??"").trim();return{stage:di,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' exited ${d}, expected ${u}${f?` \u2014 ${f.slice(0,200)}`:""}`}}var bte={fail:5,advisory:4,pending_env:4,liveness:3,pass:2,na:1,skip:0},jqe={pass:"\u2713",fail:"\u2717",liveness:"liveness",na:"na",pending_env:"pending_env",advisory:"advisory",skip:"skip"};function Mqe(t,e,r){let n=Math.min(e.length*zj,Nqe),i=Date.now(),o=[];for(let s of e){if(Date.now()-i>=n){o.push({argv:(s.run??[]).join(" ")||"(none)",kind:s.kind,disposition:"pending_env",detail:"stage time ceiling \u2014 not started",feature:s.feature,why:s.why});continue}o.push(Fqe(t,s,r))}return Lqe(o)}function Fqe(t,e,r){let n=(e.run??[]).join(" ")||"(none)",i=e.why;if(e.kind==="none")return{argv:"(kind:none)",kind:"none",disposition:"na",detail:"nothing to run (library/static)",why:i};let o=e.feature;if(o!==void 0){let h=r.featureStatus.get(o);if(h!=="done"){let g=h===void 0?`bound feature ${o} not found in spec \u2014 not executed`:`bound feature ${o} is ${h}, not done \u2014 not executed`;return{argv:n,kind:"cli",disposition:"na",detail:g,feature:o,why:i}}}else if(!r.anyDone)return{argv:n,kind:"cli",disposition:"skip",detail:"no done feature yet \u2014 smoke probe skipped",why:i};let s=e.run??[];if(s.length===0)return{argv:"(none)",kind:"cli",disposition:"skip",detail:"cli smoke probe has no run argv \u2014 skipped",feature:o,why:i};let[a,...c]=s,l=a.startsWith(".")||a.startsWith("/")?vte(t,a):a,u=zj,d;try{d=We(l,[...c],{cwd:t,reject:!1,timeout:u})}catch(h){d=h}if(za(d))return{argv:n,kind:"cli",disposition:"skip",detail:`'${a}' not installed`,feature:o,why:i};if(d.timedOut)return{argv:n,kind:"cli",disposition:"fail",detail:`timed out after ${u}ms`,feature:o,why:i};let f=e.expect?.exit??0,p=d.exitCode??1;if(p!==f){let h=String(d.stderr??"").trim()||String(d.stdout??"").trim();return{argv:n,kind:"cli",disposition:"fail",detail:`exited ${p}, expected ${f}${h?` \u2014 ${h.slice(0,200)}`:""}`,feature:o,why:i}}let m=e.expect?.token;return m?String(d.stdout??"").includes(m)?{argv:n,kind:"cli",disposition:"pass",detail:`ran clean (exit ${p}), stdout contains ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"fail",detail:`ran (exit ${p}) but stdout did not contain the AC token ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"liveness",detail:`ran clean (exit ${p}), no token declared \u2014 exit-only`,feature:o,why:i}}function Lqe(t){let e="skip";for(let o of t)bte[o.disposition]>bte[e]&&(e=o.disposition);let r=t.map(o=>{let s=o.why?` \xB7 ${o.why}`:"";return`${jqe[o.disposition]} ${o.argv} \xB7 ${o.detail}${s}`}).join(` -`),n=t.map((o,s)=>({id:`probe_${s+1}`,kind:o.kind,disposition:o.disposition==="skip"?"na":o.disposition,bindsFeature:o.feature,why:o.why,detail:o.detail}));if(e==="skip")return{stage:di,pass:!1,exitCode:2,stderr:r,probes:n};let i=e==="fail"||e==="pending_env"||e==="advisory";return{stage:di,pass:!i,exitCode:i?1:0,disposition:e,stderr:r,probes:n}}var zqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Ste.argv[1]}`;if(zqe){let t=Uj();console.log(JSON.stringify(t)),Ste.exit(t.exitCode)}Mr();sn();Rn();import wte from"node:process";var Gx="stage_3.1";function qj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.smoke,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Gx,pass:!1,exitCode:2,stderr:`no smoke runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bl(e,o[o.length-1]))return{stage:Gx,pass:!1,exitCode:2,stderr:"smoke npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Gx,i,s,o);return a||Yt(Gx,s)}var Uqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${wte.argv[1]}`;if(Uqe){let t=qj();console.log(JSON.stringify(t)),wte.exit(t.exitCode)}fC();Bj();Hj();Mr();qx();import{randomBytes as Wqe}from"node:crypto";import{unlinkSync as Kqe}from"node:fs";import{tmpdir as Jqe}from"node:os";import{join as Yqe}from"node:path";import Zj from"node:process";Jm();Rn();Ue();import{readFileSync as Hqe}from"node:fs";import{resolve as kte}from"node:path";function Gqe(t){let e=t.trim();if(!e.startsWith("{"))return null;let r;try{r=JSON.parse(e)}catch{return null}let n=r.testResults;if(!Array.isArray(n))return null;let i=new Map;for(let o of n){if(typeof o.name!="string"||!o.name)continue;let s=kte(o.name),a=i.get(s)??0;for(let c of o.assertionResults??[])c.status==="passed"&&(a+=1);i.set(s,a)}return i}function Zqe(t){let e=t.indexOf("#");return(e===-1?t:t.slice(0,e)).trim()}function Vqe(t,e,r){let n=[];for(let i of t.features??[]){if(i.status!=="done")continue;let o=[],s=new Set;for(let u of i.acceptance_criteria??[])for(let d of u.test_refs??[]){let f=Zqe(d);f&&!s.has(f)&&(s.add(f),o.push(f))}if(o.length===0)continue;let a=!0,c=!1;for(let u of o){let d=e.get(kte(r,u));if(d===void 0){a=!1;break}if(d>0){c=!0;break}}if(c||!a)continue;let l=i.title||i.id;n.push({detector:"VACUOUS_TESTS",severity:"warn",path:o[0],message:`Done feature "${l}" declares tests, but none of its test files executed a passing test (all skipped / todo / empty) \u2014 its behavioral proof never actually ran`})}return n}function Gj(t,e){try{let r=Gqe(Hqe(t,"utf8"));return r?Vqe(B(e),r,e):[]}catch{return[]}}var Br="stage_2.1";function Ete(t,e){return t==="vitest"||t.endsWith("/vitest")||e.includes("vitest")}function Ate(t,e){return[t,...e].some(r=>r==="pytest"||r.endsWith("/pytest"))}function Tte(t){let e=`${String(t.stdout??"")} -${String(t.stderr??"")}`,r=[],n=[/^\s*#\s*tests\s+(\d+)\s*$/gim,/^\s*ℹ\s+tests\s+(\d+)\s*$/gim,/^\s*Tests:\s+.*?\b(\d+)\s+total\b.*$/gim,/^\s*collected\s+(\d+)\s+items?\b.*$/gim];for(let i of n)for(let o of e.matchAll(i))r.push(Number(o[1]));return r.length>0&&r.every(i=>i===0)}function Xqe(t,e,r){let n,i;try{({cmd:n,args:i}=Yi("coverage",t))}catch{return null}if(!n||!i||!Ete(n,i))return null;let o=n,s=i,a=Dj(e,d=>We(o,[...s,"--reporter=default","--reporter=json",`--outputFile=${d}`],{cwd:e,reject:!1}));if(!a)return null;let{proc:c,jsonFile:l}=a;if(Nt(Br,n,c,s))return null;let u=Yt(Br,c);if(Nj(u)==="fallback")return null;if(r){let d=Gj(l,e);if(d.length>0)return{stage:Br,pass:!1,exitCode:1,findings:d,stderr:d[0].message}}return{stage:Br,pass:!0,exitCode:0}}function Qqe(t,e){let{strict:r=!1}=t,n,i;try{({cmd:n,args:i}=Yi("coverage",t))}catch{return null}if(!n||!i||!Ate(n,i))return null;let o=n,s=i,a=Dj(e,()=>We(o,[...s],{cwd:e,reject:!1}));if(!a||Nt(Br,o,a.proc,s))return null;let c=Yt(Br,a.proc);if(Nj(c)==="fallback")return null;if(r&&Tte(a.proc)){let l={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Br,pass:!1,exitCode:1,findings:[l],stderr:l.message}}return{stage:Br,pass:!0,exitCode:0}}function Vj(t={}){let{cwd:e=".",strict:r=!1}=t,n,i,o;try{({cmd:n,args:i,language:o}=Yi("test",t))}catch(d){return{stage:Br,pass:!1,exitCode:1,stderr:d.message}}if(!n||!i)return{stage:Br,pass:!1,exitCode:2,stderr:`no unit test runner registered for language '${o}'`};let s=Ete(n,i),a=Ate(n,i),c=r&&s;if(Cj()&&s){let d=Xqe(t,e,c);if(d)return d}if(Cj()&&a){let d=Qqe(t,e);if(d)return d}let l,u=i;c&&(l=Yqe(Jqe(),`clad-vitest-${Zj.pid}-${Wqe(6).toString("hex")}.json`),u=[...i,"--reporter=default","--reporter=json",`--outputFile=${l}`]);try{let d=We(n,[...u],{cwd:e,reject:!1}),f=Nt(Br,n,d,u);if(f)return f;let p=Iu("unit",Yt(Br,d),d);if(r&&p.pass&&Tte(d)){let m={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Br,pass:!1,exitCode:1,findings:[m],stderr:m.message}}if(c&&p.pass&&l){let m=Gj(l,e);if(m.length>0)return{stage:Br,pass:!1,exitCode:1,findings:m,stderr:m[0].message}}return p}finally{if(l)try{Kqe(l)}catch{}}}var e4e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Zj.argv[1]}`;if(e4e){let t=Vj();console.log(JSON.stringify(t)),Zj.exit(t.exitCode)}Mr();sn();Rn();import Ote from"node:process";var Wx="stage_3.3";function Wj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.visual,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Wx,pass:!1,exitCode:2,stderr:`no visual runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bl(e,o[o.length-1]))return{stage:Wx,pass:!1,exitCode:2,stderr:"visual npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Wx,i,s,o);return a||Yt(Wx,s)}var t4e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Ote.argv[1]}`;if(t4e){let t=Wj();console.log(JSON.stringify(t)),Ote.exit(t.exitCode)}mC();Mf();_a();Jj();kp();eS();var jte=St(er(),1);import{existsSync as Yj,readFileSync as f4e,readdirSync as Nte,statSync as p4e,writeFileSync as m4e}from"node:fs";import{basename as th,join as rh,relative as Dte}from"node:path";var h4e=["self-dogfood:","fixture:","derived:"],Mte=/\.(test|spec)\.[jt]sx?$/;function Fte(t,e=t,r=[]){let n;try{n=Nte(e)}catch{return r}for(let i of n){if(i.startsWith("."))continue;let o=rh(e,i);try{p4e(o).isDirectory()?Fte(t,o,r):Mte.test(i)&&r.push(o)}catch{continue}}return r}function Lte(t="."){let e=rh(t,"spec","features"),r=rh(t,"tests"),n=[],i=[];if(!Yj(e)||!Yj(r))return{repaired:n,suggested:i};let o=Fte(r),s=new Map;for(let a of o){let c=Dte(t,a).split("\\").join("/"),l=s.get(th(a))??[];l.push(c),s.set(th(a),l)}for(let a of Nte(e)){if(!a.endsWith(".yaml")&&!a.endsWith(".yml"))continue;let c=rh(e,a),l,u;try{l=f4e(c,"utf8"),u=(0,jte.parse)(l)}catch{continue}if(!u||u.status!=="done")continue;let d=!1;for(let h of u.acceptance_criteria??[])for(let g of h.test_refs??[]){if(h4e.some(x=>g.startsWith(x)))continue;let b=g.split("#",1)[0];if(Yj(rh(t,b)))continue;let _=s.get(th(b))??[];if(_.length!==1)continue;let S=g.replace(b,_[0]);S!==g&&l.includes(g)&&(l=l.split(g).join(S),n.push({shard:a,from:g,to:S}),d=!0)}let f=u.slug??"",p=(u.modules??[]).map(h=>th(h).replace(/\.[jt]sx?$/,"")),m=o.map(h=>Dte(t,h).split("\\").join("/")).find(h=>{let g=th(h).replace(Mte,"");return f!==""&&g===f||p.includes(g)});if(m)for(let h of u.acceptance_criteria??[]){if((h.test_refs?.length??0)>0||(h.evidence_refs?.length??0)>0||!h.id)continue;let g=new RegExp(`^(([ ]+)- id: ${h.id}\\b.*)$`,"m"),b=l.match(g);if(!b)continue;let _=b[2]+" ";l=l.replace(g,`$1 +`)}catch{r.delete(u)}},3e4);return typeof l.unref=="function"&&l.unref(),new Promise((u,d)=>{o.on("error",d),o.listen(t.port??0,"127.0.0.1",()=>{let f=o.address(),p=typeof f=="object"&&f?f.port:t.port??0;u({port:p,broadcast:i,close:()=>new Promise(m=>{s&&clearTimeout(s),clearInterval(l);for(let h of c)try{h.close()}catch{}for(let h of r)try{h.end()}catch{}r.clear(),o.close(()=>m()),typeof o.closeAllConnections=="function"&&o.closeAllConnections()})})})})}async function ute(t={}){let e=t.port!==void 0?Number(t.port):3e3;try{let r=await rqe({port:e,cwd:t.cwd??"."});L("pass","graph",`live graph at http://localhost:${r.port} \u2014 edit spec/ or docs/ and the view auto-reloads (Ctrl-C to stop)`)}catch(r){L("fail","graph",r.message),process.exit(1)}}var nqe=["stage_1.1","stage_2.1","stage_2.3"];function iqe(t){return(t.features??[]).filter(e=>e.status==="done")}function oqe(t,e){let r=iqe(t);switch(e){case"stage_1.1":return!t.project?.language||r.length===0?null:`project.language is '${t.project.language}' and ${r.length} feature(s) are done, but the type checker did not run (skipped) \u2014 type safety of shipped code was never verified. Install the language toolchain; under --strict, an unverifiable 'done' is not GREEN.`;case"stage_2.1":{let n=r.filter(i=>(i.acceptance_criteria??[]).some(o=>(o.test_refs??[]).length>0)).length;return n===0?null:`${n} done feature(s) declare tests but the test runner did not run (skipped) \u2014 the implementation was never verified. Install the test framework; under --strict, an unverifiable 'done' is not GREEN.`}case"stage_2.3":{let n=r.flatMap(i=>i.acceptance_criteria??[]).filter(i=>(i.oracle_refs??[]).length>0).length;return n===0?null:`${n} done AC(s) declare oracle_refs but the conformance runner did not run (skipped) \u2014 the declared oracles never executed. Under --strict, declared-but-unrun verification is not GREEN.`}}}function dte(t,e){let r=[];for(let n of nqe){if(!e.some(s=>s.stage===n&&s.status==="skip"))continue;let o=oqe(t,n);o&&r.push({stage:n,label:"Verification",message:o})}return r}wS();import fte from"node:process";function sqe(t,e){let r=e.filter(i=>i.acId===t),n=r.filter(i=>i.identity.author==="human");return n.length===0?{acId:t,pass:!1,totalEvidence:r.length,humanEvidence:0,reason:r.length===0?"no evidence at all":`${r.length} tool/LLM evidence but 0 human \u2014 anti-self-cert guard blocks`}:{acId:t,pass:!0,totalEvidence:r.length,humanEvidence:n.length}}function zx(t){let e=new Set;for(let n of t)n.acId&&e.add(n.acId);let r=[];for(let n of e){let i=sqe(n,t);i.pass||r.push(i)}return r}ni();var Ij="stage_4.1";function Pj(t={}){let{cwd:e="."}=t,r=In(e);if(r.length===0)return{stage:Ij,pass:!1,exitCode:2,stderr:"no audit log present \u2014 record evidence before running stage_4.1"};let n=zx(r);if(n.length===0)return{stage:Ij,pass:!0,exitCode:0};let i=n.map(o=>`${o.acId}: ${o.reason}`).join("; ");return{stage:Ij,pass:!1,exitCode:1,stderr:`anti-self-cert guard: ${i}`}}var aqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${fte.argv[1]}`;if(aqe){let t=Pj();console.log(JSON.stringify(t)),fte.exit(t.exitCode)}Sl();import{randomBytes as cqe}from"node:crypto";import{unlinkSync as lqe}from"node:fs";import{tmpdir as uqe}from"node:os";import{join as dqe,resolve as Cj}from"node:path";import fqe from"node:process";var qr=null;function pte(t){qr={cwd:Cj(t),run:null,jsonFile:null}}function Dj(){return qr!==null}function Nj(t,e){if(!qr||qr.cwd!==Cj(t))return null;if(qr.run)return qr.run;let r=dqe(uqe(),`clad-shared-vitest-${fqe.pid}-${cqe(6).toString("hex")}.json`);qr.jsonFile=r;let n=e(r);return qr.run={proc:n,jsonFile:r},qr.run}function mte(t){return!qr||qr.cwd!==Cj(t)?null:qr.run}function jj(t){return t.pass&&t.exitCode===0?"reuse-pass":"fallback"}function hte(){let t=qr?.jsonFile;if(qr=null,t)try{lqe(t)}catch{}}Mr();import gte from"node:process";var Ux="stage_1.4";function Mj(t={}){let{cwd:e="."}=t,r;try{r=We("git",["status","--porcelain"],{cwd:e,reject:!1})}catch(i){if(i.code==="ENOENT")return{stage:Ux,pass:!1,exitCode:2,stderr:"git binary not found"};throw i}if(r.exitCode!==0){let i=(r.stderr??"").toString().trim()||"not a git repository";return{stage:Ux,pass:!1,exitCode:2,stderr:i}}let n=(r.stdout??"").toString().trim();return n.length===0?{stage:Ux,pass:!0,exitCode:0}:{stage:Ux,pass:!1,exitCode:1,stderr:`working tree dirty: +${n}`}}var pqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${gte.argv[1]}`;if(pqe){let t=Mj();console.log(JSON.stringify(t)),gte.exit(t.exitCode)}Mr();import yte from"node:process";Ym();Rn();var qx="stage_2.2";function Fj(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=Yi("coverage",t))}catch(c){return{stage:qx,pass:!1,exitCode:1,stderr:c.message}}if(!r||!n)return{stage:qx,pass:!1,exitCode:2,stderr:`no coverage runner registered for language '${i}'`};let o=mte(e),s=o?o.proc:We(r,[...n],{cwd:e,reject:!1}),a=Nt(qx,r,s,n);return a||Yt(qx,s)}var gqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${yte.argv[1]}`;if(gqe){let t=Fj();console.log(JSON.stringify(t)),yte.exit(t.exitCode)}Mp();Lj();Mr();sn();Rn();import bte from"node:process";var Gx="stage_3.2";function zj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.perf,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Gx,pass:!1,exitCode:2,stderr:`no perf runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bl(e,o[o.length-1]))return{stage:Gx,pass:!1,exitCode:2,stderr:"perf npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Gx,i,s,o);return a||Yt(Gx,s)}var jqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${bte.argv[1]}`;if(jqe){let t=zj();console.log(JSON.stringify(t)),bte.exit(t.exitCode)}Mr();Ue();Rn();import{existsSync as Mqe}from"node:fs";import{resolve as Ste}from"node:path";import wte from"node:process";var di="stage_2.4",Uj=5e3,Fqe=3e4;function qj(t={}){let{cwd:e="."}=t,r,n=[],i=!1,o=new Map;try{let p=q(e);r=p.project.deliverable,n=p.project.smoke??[],i=p.features.some(m=>m.status==="done"),o=new Map(p.features.map(m=>[m.id,m.status]))}catch{return{stage:di,pass:!1,exitCode:2,stderr:"spec.yaml not loaded \u2014 deliverable smoke skipped"}}if(n.length>0)return zqe(e,n,{anyDone:i,featureStatus:o});if(!r)return{stage:di,pass:!1,exitCode:2,stderr:"no project.deliverable declared \u2014 skipped"};if(r.is_safe_to_smoke!==!0)return{stage:di,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not marked is_safe_to_smoke \u2014 skipped`};if(!i)return{stage:di,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 deliverable smoke skipped"};let s=Ste(e,r.path);if(!Mqe(s))return{stage:di,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not found \u2014 see DELIVERABLE_INTEGRITY`};let a=r.timeout_ms??Uj,c;try{c=We(s,[...r.smoke_args??[]],{cwd:e,reject:!1,timeout:a})}catch(p){c=p}let l=Nt(di,r.path,c);if(l)return l;if(c.timedOut)return{stage:di,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' timed out after ${a}ms (hung or too slow)`};let u=r.expect_exit??0,d=c.exitCode??1;if(d===u)return{stage:di,pass:!0,exitCode:0,disposition:"liveness"};let f=String(c.stderr??"").trim()||String(c.stdout??"").trim();return{stage:di,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' exited ${d}, expected ${u}${f?` \u2014 ${f.slice(0,200)}`:""}`}}var vte={fail:5,advisory:4,pending_env:4,liveness:3,pass:2,na:1,skip:0},Lqe={pass:"\u2713",fail:"\u2717",liveness:"liveness",na:"na",pending_env:"pending_env",advisory:"advisory",skip:"skip"};function zqe(t,e,r){let n=Math.min(e.length*Uj,Fqe),i=Date.now(),o=[];for(let s of e){if(Date.now()-i>=n){o.push({argv:(s.run??[]).join(" ")||"(none)",kind:s.kind,disposition:"pending_env",detail:"stage time ceiling \u2014 not started",feature:s.feature,why:s.why});continue}o.push(Uqe(t,s,r))}return qqe(o)}function Uqe(t,e,r){let n=(e.run??[]).join(" ")||"(none)",i=e.why;if(e.kind==="none")return{argv:"(kind:none)",kind:"none",disposition:"na",detail:"nothing to run (library/static)",why:i};let o=e.feature;if(o!==void 0){let h=r.featureStatus.get(o);if(h!=="done"){let g=h===void 0?`bound feature ${o} not found in spec \u2014 not executed`:`bound feature ${o} is ${h}, not done \u2014 not executed`;return{argv:n,kind:"cli",disposition:"na",detail:g,feature:o,why:i}}}else if(!r.anyDone)return{argv:n,kind:"cli",disposition:"skip",detail:"no done feature yet \u2014 smoke probe skipped",why:i};let s=e.run??[];if(s.length===0)return{argv:"(none)",kind:"cli",disposition:"skip",detail:"cli smoke probe has no run argv \u2014 skipped",feature:o,why:i};let[a,...c]=s,l=a.startsWith(".")||a.startsWith("/")?Ste(t,a):a,u=Uj,d;try{d=We(l,[...c],{cwd:t,reject:!1,timeout:u})}catch(h){d=h}if(za(d))return{argv:n,kind:"cli",disposition:"skip",detail:`'${a}' not installed`,feature:o,why:i};if(d.timedOut)return{argv:n,kind:"cli",disposition:"fail",detail:`timed out after ${u}ms`,feature:o,why:i};let f=e.expect?.exit??0,p=d.exitCode??1;if(p!==f){let h=String(d.stderr??"").trim()||String(d.stdout??"").trim();return{argv:n,kind:"cli",disposition:"fail",detail:`exited ${p}, expected ${f}${h?` \u2014 ${h.slice(0,200)}`:""}`,feature:o,why:i}}let m=e.expect?.token;return m?String(d.stdout??"").includes(m)?{argv:n,kind:"cli",disposition:"pass",detail:`ran clean (exit ${p}), stdout contains ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"fail",detail:`ran (exit ${p}) but stdout did not contain the AC token ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"liveness",detail:`ran clean (exit ${p}), no token declared \u2014 exit-only`,feature:o,why:i}}function qqe(t){let e="skip";for(let o of t)vte[o.disposition]>vte[e]&&(e=o.disposition);let r=t.map(o=>{let s=o.why?` \xB7 ${o.why}`:"";return`${Lqe[o.disposition]} ${o.argv} \xB7 ${o.detail}${s}`}).join(` +`),n=t.map((o,s)=>({id:`probe_${s+1}`,kind:o.kind,disposition:o.disposition==="skip"?"na":o.disposition,bindsFeature:o.feature,why:o.why,detail:o.detail}));if(e==="skip")return{stage:di,pass:!1,exitCode:2,stderr:r,probes:n};let i=e==="fail"||e==="pending_env"||e==="advisory";return{stage:di,pass:!i,exitCode:i?1:0,disposition:e,stderr:r,probes:n}}var Bqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${wte.argv[1]}`;if(Bqe){let t=qj();console.log(JSON.stringify(t)),wte.exit(t.exitCode)}Mr();sn();Rn();import xte from"node:process";var Zx="stage_3.1";function Bj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.smoke,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Zx,pass:!1,exitCode:2,stderr:`no smoke runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bl(e,o[o.length-1]))return{stage:Zx,pass:!1,exitCode:2,stderr:"smoke npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Zx,i,s,o);return a||Yt(Zx,s)}var Hqe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${xte.argv[1]}`;if(Hqe){let t=Bj();console.log(JSON.stringify(t)),xte.exit(t.exitCode)}pC();Hj();Gj();Mr();Bx();import{randomBytes as Yqe}from"node:crypto";import{unlinkSync as Xqe}from"node:fs";import{tmpdir as Qqe}from"node:os";import{join as e4e}from"node:path";import Vj from"node:process";Ym();Rn();Ue();import{readFileSync as Vqe}from"node:fs";import{resolve as Ete}from"node:path";function Wqe(t){let e=t.trim();if(!e.startsWith("{"))return null;let r;try{r=JSON.parse(e)}catch{return null}let n=r.testResults;if(!Array.isArray(n))return null;let i=new Map;for(let o of n){if(typeof o.name!="string"||!o.name)continue;let s=Ete(o.name),a=i.get(s)??0;for(let c of o.assertionResults??[])c.status==="passed"&&(a+=1);i.set(s,a)}return i}function Kqe(t){let e=t.indexOf("#");return(e===-1?t:t.slice(0,e)).trim()}function Jqe(t,e,r){let n=[];for(let i of t.features??[]){if(i.status!=="done")continue;let o=[],s=new Set;for(let u of i.acceptance_criteria??[])for(let d of u.test_refs??[]){let f=Kqe(d);f&&!s.has(f)&&(s.add(f),o.push(f))}if(o.length===0)continue;let a=!0,c=!1;for(let u of o){let d=e.get(Ete(r,u));if(d===void 0){a=!1;break}if(d>0){c=!0;break}}if(c||!a)continue;let l=i.title||i.id;n.push({detector:"VACUOUS_TESTS",severity:"warn",path:o[0],message:`Done feature "${l}" declares tests, but none of its test files executed a passing test (all skipped / todo / empty) \u2014 its behavioral proof never actually ran`})}return n}function Zj(t,e){try{let r=Wqe(Vqe(t,"utf8"));return r?Jqe(q(e),r,e):[]}catch{return[]}}var Br="stage_2.1";function Ate(t,e){return t==="vitest"||t.endsWith("/vitest")||e.includes("vitest")}function Tte(t,e){return[t,...e].some(r=>r==="pytest"||r.endsWith("/pytest"))}function Ote(t){let e=`${String(t.stdout??"")} +${String(t.stderr??"")}`,r=[],n=[/^\s*#\s*tests\s+(\d+)\s*$/gim,/^\s*ℹ\s+tests\s+(\d+)\s*$/gim,/^\s*Tests:\s+.*?\b(\d+)\s+total\b.*$/gim,/^\s*collected\s+(\d+)\s+items?\b.*$/gim];for(let i of n)for(let o of e.matchAll(i))r.push(Number(o[1]));return r.length>0&&r.every(i=>i===0)}function t4e(t,e,r){let n,i;try{({cmd:n,args:i}=Yi("coverage",t))}catch{return null}if(!n||!i||!Ate(n,i))return null;let o=n,s=i,a=Nj(e,d=>We(o,[...s,"--reporter=default","--reporter=json",`--outputFile=${d}`],{cwd:e,reject:!1}));if(!a)return null;let{proc:c,jsonFile:l}=a;if(Nt(Br,n,c,s))return null;let u=Yt(Br,c);if(jj(u)==="fallback")return null;if(r){let d=Zj(l,e);if(d.length>0)return{stage:Br,pass:!1,exitCode:1,findings:d,stderr:d[0].message}}return{stage:Br,pass:!0,exitCode:0}}function r4e(t,e){let{strict:r=!1}=t,n,i;try{({cmd:n,args:i}=Yi("coverage",t))}catch{return null}if(!n||!i||!Tte(n,i))return null;let o=n,s=i,a=Nj(e,()=>We(o,[...s],{cwd:e,reject:!1}));if(!a||Nt(Br,o,a.proc,s))return null;let c=Yt(Br,a.proc);if(jj(c)==="fallback")return null;if(r&&Ote(a.proc)){let l={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Br,pass:!1,exitCode:1,findings:[l],stderr:l.message}}return{stage:Br,pass:!0,exitCode:0}}function Wj(t={}){let{cwd:e=".",strict:r=!1}=t,n,i,o;try{({cmd:n,args:i,language:o}=Yi("test",t))}catch(d){return{stage:Br,pass:!1,exitCode:1,stderr:d.message}}if(!n||!i)return{stage:Br,pass:!1,exitCode:2,stderr:`no unit test runner registered for language '${o}'`};let s=Ate(n,i),a=Tte(n,i),c=r&&s;if(Dj()&&s){let d=t4e(t,e,c);if(d)return d}if(Dj()&&a){let d=r4e(t,e);if(d)return d}let l,u=i;c&&(l=e4e(Qqe(),`clad-vitest-${Vj.pid}-${Yqe(6).toString("hex")}.json`),u=[...i,"--reporter=default","--reporter=json",`--outputFile=${l}`]);try{let d=We(n,[...u],{cwd:e,reject:!1}),f=Nt(Br,n,d,u);if(f)return f;let p=Iu("unit",Yt(Br,d),d);if(r&&p.pass&&Ote(d)){let m={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Br,pass:!1,exitCode:1,findings:[m],stderr:m.message}}if(c&&p.pass&&l){let m=Zj(l,e);if(m.length>0)return{stage:Br,pass:!1,exitCode:1,findings:m,stderr:m[0].message}}return p}finally{if(l)try{Xqe(l)}catch{}}}var n4e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Vj.argv[1]}`;if(n4e){let t=Wj();console.log(JSON.stringify(t)),Vj.exit(t.exitCode)}Mr();sn();Rn();import Rte from"node:process";var Kx="stage_3.3";function Kj(t={}){let{cwd:e="."}=t,r=dt(e),n=r.gates.visual,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:Kx,pass:!1,exitCode:2,stderr:`no visual runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bl(e,o[o.length-1]))return{stage:Kx,pass:!1,exitCode:2,stderr:"visual npm script not defined"};let s=We(i,[...o],{cwd:e,reject:!1}),a=Nt(Kx,i,s,o);return a||Yt(Kx,s)}var i4e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Rte.argv[1]}`;if(i4e){let t=Kj();console.log(JSON.stringify(t)),Rte.exit(t.exitCode)}hC();Mf();_a();Yj();kp();tS();var Mte=St(er(),1);import{existsSync as Xj,readFileSync as h4e,readdirSync as jte,statSync as g4e,writeFileSync as y4e}from"node:fs";import{basename as rh,join as nh,relative as Nte}from"node:path";var _4e=["self-dogfood:","fixture:","derived:"],Fte=/\.(test|spec)\.[jt]sx?$/;function Lte(t,e=t,r=[]){let n;try{n=jte(e)}catch{return r}for(let i of n){if(i.startsWith("."))continue;let o=nh(e,i);try{g4e(o).isDirectory()?Lte(t,o,r):Fte.test(i)&&r.push(o)}catch{continue}}return r}function zte(t="."){let e=nh(t,"spec","features"),r=nh(t,"tests"),n=[],i=[];if(!Xj(e)||!Xj(r))return{repaired:n,suggested:i};let o=Lte(r),s=new Map;for(let a of o){let c=Nte(t,a).split("\\").join("/"),l=s.get(rh(a))??[];l.push(c),s.set(rh(a),l)}for(let a of jte(e)){if(!a.endsWith(".yaml")&&!a.endsWith(".yml"))continue;let c=nh(e,a),l,u;try{l=h4e(c,"utf8"),u=(0,Mte.parse)(l)}catch{continue}if(!u||u.status!=="done")continue;let d=!1;for(let h of u.acceptance_criteria??[])for(let g of h.test_refs??[]){if(_4e.some(x=>g.startsWith(x)))continue;let b=g.split("#",1)[0];if(Xj(nh(t,b)))continue;let _=s.get(rh(b))??[];if(_.length!==1)continue;let S=g.replace(b,_[0]);S!==g&&l.includes(g)&&(l=l.split(g).join(S),n.push({shard:a,from:g,to:S}),d=!0)}let f=u.slug??"",p=(u.modules??[]).map(h=>rh(h).replace(/\.[jt]sx?$/,"")),m=o.map(h=>Nte(t,h).split("\\").join("/")).find(h=>{let g=rh(h).replace(Fte,"");return f!==""&&g===f||p.includes(g)});if(m)for(let h of u.acceptance_criteria??[]){if((h.test_refs?.length??0)>0||(h.evidence_refs?.length??0)>0||!h.id)continue;let g=new RegExp(`^(([ ]+)- id: ${h.id}\\b.*)$`,"m"),b=l.match(g);if(!b)continue;let _=b[2]+" ";l=l.replace(g,`$1 ${_}test_refs: -${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&m4e(c,l,"utf8")}return{repaired:n,suggested:i}}vl();import{existsSync as g4e,readFileSync as y4e}from"node:fs";import{join as _4e}from"node:path";function b4e(t,e){let r=_4e(t,e);if(!g4e(r))return[];let n=[];for(let i of y4e(r,"utf8").split(/\r?\n/)){let o=i.trim();if(!/^export\s+(?:async\s+)?(?:abstract\s+)?(?:function|const|let|class|interface|type|enum)\b/.test(o))continue;let s=o.replace(/\s*[{=].*$/s,"").trim();s&&n.push(s)}return n}function zte(t,e,r,n){let i=t.features.find(c=>c.id===e);if(!i)return null;let o=(i.acceptance_criteria??[]).filter(c=>!r||c.id===r),s=i.modules??[],a=s.flatMap(c=>b4e(n,c).map(l=>`${c}: ${l}`));return{featureId:e,featureTitle:i.title,acs:o.map(c=>({id:c.id,ears:c.ears,condition:c.condition,action:c.action,response:c.response,text:c.text})),modules:s,signatures:a,readManifest:[...s.map(c=>`signatures-of:${c}`),"spec:acceptance_criteria"]}}function Ute(t){let e=[];e.push(`# Impl-blind oracle brief \u2014 ${t.featureId}: ${t.featureTitle}`),e.push("#"),e.push("# Author a conformance TEST SUITE from THIS SPECIFICATION ONLY. You have NOT been"),e.push("# shown the implementation and MUST NOT read it. Assert ONLY what the acceptance"),e.push("# criteria literally require; when the spec is silent on an edge, write a WEAKER"),e.push("# assertion, not a stronger guess (an over-strict oracle falsely fails correct code)."),e.push(""),e.push("## Acceptance criteria (the spec)");for(let r of t.acs)e.push(`- ${r.id}${r.ears?` [${r.ears}]`:""}: ${r.text??""}`.trimEnd()),r.condition&&e.push(` when: ${r.condition}`),r.action&&e.push(` system shall: ${r.action}`),r.response&&e.push(` so that: ${r.response}`);e.push(""),e.push("## Public surface to call (signatures only \u2014 NO implementation shown)"),t.signatures.length===0&&e.push(" (no export signatures extracted \u2014 call the API exactly as the criteria describe)");for(let r of t.signatures)e.push(` ${r}`);return e.push(""),e.push("## Write the suite under tests/oracle/ (the dir stage_2.3 runs), then record it with"),e.push("## the clad_author_oracle MCP tool so its impl-blind provenance is gate-verified."),e.join(` -`)}nS();Ue();Ii();ni();vl();var Xj=["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"],v4e=[...Xj,"att"];function S4e(t,e,r){if(e.startsWith("stage_4")){let n=In(r);if(n.length===0)return"\xB7";let i=(t.acceptance_criteria??[]).map(s=>s.id);return Lx(n).filter(s=>i.includes(s.acId)).length>0?"\u2717":"\u2713"}return"-"}function w4e(t,e,r){let n=t.modules??[];return t.status!=="done"||n.length===0?"\xB7":e===null?"-":B_(e,r,t).state==="fresh"?"\u2713":"!"}function Xx(t,e="."){let r=as(e),n=t.features.map(i=>({featureId:i.id,title:i.title||i.id,status:i.status,cells:[...Xj.map(o=>S4e(i,o,e)),w4e(i,r,e)]}));return{columns:v4e,rows:n}}function qte(t,e=".",r={}){let n=r.internal??!1,i=Xx(t,e),o=[...Xj.map(c=>n?c.replace("stage_",""):x4e(c)),"att"],s=n?`feature ${o.join(" ")}`:`feature${" ".repeat(28)}${o.join(" ")}`,a=i.rows.map(c=>{let l=c.cells.join(" ");return n?`${c.featureId.padEnd(12)} ${l} ${c.title}`:`${c.title.padEnd(35).slice(0,35)} ${l}`});return[s,...a].join(` -`)}function x4e(t){return Ta(t).slice(0,3)}async function J8e(t){let[{buildServer:e},{StdioServerTransport:r},{setHostMcpServer:n}]=await Promise.all([Promise.resolve().then(()=>(nde(),rde)),Promise.resolve().then(()=>(cde(),ade)),Promise.resolve().then(()=>(Xp(),_7))]),i=e({cwd:t.cwd,onboarding:{renderDraft:s=>Vee(s),prepareInit:({cwd:s,mode:a,intent:c})=>Gee(s,a,c),initialize:pj,prepareClarify:(s,{cwd:a})=>Zee(a,s),clarify:yj,resolveReview:(s,{cwd:a})=>Uee(s,{cwd:a})}});n(i.server);let o=new r;G.stderr.write(`\xB7 serve stdio transport \xB7 cwd=${t.cwd??"."} -`),await i.connect(o)}async function Y8e(t,e){let r=t&&t.length>0?t.join(" ").trim():void 0,n=await pj({projectName:e.name,force:e.force,scan:e.scan,noLlm:e.noLlm,roots:e.roots?e.roots.split(",").map(o=>o.trim()).filter(Boolean):void 0,intent:r,withHook:e.withHook,withCi:e.withCi});if(e.json){G.stdout.write(`${JSON.stringify(n,null,2)} +${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&y4e(c,l,"utf8")}return{repaired:n,suggested:i}}vl();import{existsSync as b4e,readFileSync as v4e}from"node:fs";import{join as S4e}from"node:path";function w4e(t,e){let r=S4e(t,e);if(!b4e(r))return[];let n=[];for(let i of v4e(r,"utf8").split(/\r?\n/)){let o=i.trim();if(!/^export\s+(?:async\s+)?(?:abstract\s+)?(?:function|const|let|class|interface|type|enum)\b/.test(o))continue;let s=o.replace(/\s*[{=].*$/s,"").trim();s&&n.push(s)}return n}function Ute(t,e,r,n){let i=t.features.find(c=>c.id===e);if(!i)return null;let o=(i.acceptance_criteria??[]).filter(c=>!r||c.id===r),s=i.modules??[],a=s.flatMap(c=>w4e(n,c).map(l=>`${c}: ${l}`));return{featureId:e,featureTitle:i.title,acs:o.map(c=>({id:c.id,ears:c.ears,condition:c.condition,action:c.action,response:c.response,text:c.text})),modules:s,signatures:a,readManifest:[...s.map(c=>`signatures-of:${c}`),"spec:acceptance_criteria"]}}function qte(t){let e=[];e.push(`# Impl-blind oracle brief \u2014 ${t.featureId}: ${t.featureTitle}`),e.push("#"),e.push("# Author a conformance TEST SUITE from THIS SPECIFICATION ONLY. You have NOT been"),e.push("# shown the implementation and MUST NOT read it. Assert ONLY what the acceptance"),e.push("# criteria literally require; when the spec is silent on an edge, write a WEAKER"),e.push("# assertion, not a stronger guess (an over-strict oracle falsely fails correct code)."),e.push(""),e.push("## Acceptance criteria (the spec)");for(let r of t.acs)e.push(`- ${r.id}${r.ears?` [${r.ears}]`:""}: ${r.text??""}`.trimEnd()),r.condition&&e.push(` when: ${r.condition}`),r.action&&e.push(` system shall: ${r.action}`),r.response&&e.push(` so that: ${r.response}`);e.push(""),e.push("## Public surface to call (signatures only \u2014 NO implementation shown)"),t.signatures.length===0&&e.push(" (no export signatures extracted \u2014 call the API exactly as the criteria describe)");for(let r of t.signatures)e.push(` ${r}`);return e.push(""),e.push("## Write the suite under tests/oracle/ (the dir stage_2.3 runs), then record it with"),e.push("## the clad_author_oracle MCP tool so its impl-blind provenance is gate-verified."),e.join(` +`)}iS();Ue();Ii();ni();vl();var Qj=["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"],x4e=[...Qj,"att"];function $4e(t,e,r){if(e.startsWith("stage_4")){let n=In(r);if(n.length===0)return"\xB7";let i=(t.acceptance_criteria??[]).map(s=>s.id);return zx(n).filter(s=>i.includes(s.acId)).length>0?"\u2717":"\u2713"}return"-"}function k4e(t,e,r){let n=t.modules??[];return t.status!=="done"||n.length===0?"\xB7":e===null?"-":H_(e,r,t).state==="fresh"?"\u2713":"!"}function Qx(t,e="."){let r=as(e),n=t.features.map(i=>({featureId:i.id,title:i.title||i.id,status:i.status,cells:[...Qj.map(o=>$4e(i,o,e)),k4e(i,r,e)]}));return{columns:x4e,rows:n}}function Bte(t,e=".",r={}){let n=r.internal??!1,i=Qx(t,e),o=[...Qj.map(c=>n?c.replace("stage_",""):E4e(c)),"att"],s=n?`feature ${o.join(" ")}`:`feature${" ".repeat(28)}${o.join(" ")}`,a=i.rows.map(c=>{let l=c.cells.join(" ");return n?`${c.featureId.padEnd(12)} ${l} ${c.title}`:`${c.title.padEnd(35).slice(0,35)} ${l}`});return[s,...a].join(` +`)}function E4e(t){return Ta(t).slice(0,3)}async function Q8e(t){let[{buildServer:e},{StdioServerTransport:r},{setHostMcpServer:n}]=await Promise.all([Promise.resolve().then(()=>(ide(),nde)),Promise.resolve().then(()=>(lde(),cde)),Promise.resolve().then(()=>(Qp(),b7))]),i=e({cwd:t.cwd,onboarding:{renderDraft:s=>Wee(s),prepareInit:({cwd:s,mode:a,intent:c})=>Zee(s,a,c),initialize:mj,prepareClarify:(s,{cwd:a})=>Vee(a,s),clarify:_j,resolveReview:(s,{cwd:a})=>qee(s,{cwd:a})}});n(i.server);let o=new r;G.stderr.write(`\xB7 serve stdio transport \xB7 cwd=${t.cwd??"."} +`),await i.connect(o)}async function e5e(t,e){let r=t&&t.length>0?t.join(" ").trim():void 0,n=await mj({projectName:e.name,force:e.force,scan:e.scan,noLlm:e.noLlm,roots:e.roots?e.roots.split(",").map(o=>o.trim()).filter(Boolean):void 0,intent:r,withHook:e.withHook,withCi:e.withCi});if(e.json){G.stdout.write(`${JSON.stringify(n,null,2)} `),G.exit(0);return}for(let o of n.created)L("pass",`created ${o}`);for(let o of n.skipped)L("skip",o);for(let o of n.proposals??[])L("note","proposal",o);let i=n.onboardingMode?`language: ${n.language} \xB7 mode: ${n.onboardingMode}`:`language: ${n.language}`;if(L("note","init done",i),n.clarifyingQuestions&&n.clarifyingQuestions.length>0){G.stdout.write(` \u{1F4A1} A few more details would sharpen the spec: `);for(let[o,s]of n.clarifyingQuestions.entries())G.stdout.write(` ${o+1}. ${s} @@ -920,32 +921,32 @@ ${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&m4e(c,l,"u `),G.stdout.write(` e.g. clad init payment SaaS for B2B `),G.stdout.write(` The existing seeds divert to .cladding/scan/*.proposal. -`));G.exit(0)}async function X8e(t,e){L("note","run","EXPERIMENTAL \u2014 prefer the host-delegated path (clad serve + your AI host). See docs/feature-cycle.md \xA7 Execution surface.");let{runDriveLoop:r}=await Promise.resolve().then(()=>(Cde(),Pde)),n=await r({cwd:e.cwd,goal:t,budget:{maxIterations:Number(e.maxIterations),maxWallClockMs:Number(e.maxWallClockMs),maxRetriesPerFeature:Number(e.maxRetries)}}),i=n.halt.class==="ALL_FEATURES_DONE"?"pass":"note";if(e.json)L(i,"run",`halt=${n.halt.class} iter=${n.iterations} features=${n.featuresTouched.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`),G.stdout.write(`${JSON.stringify(n,null,2)} -`);else{let s=B(e.cwd??"."),a=n.featuresTouched.map(l=>iR(l,s)),c=`${fG(n.halt,s)} iter=${n.iterations} features=${a.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`;L(i,"run",c),a.length>0&&G.stdout.write(`Touched: ${a.join(", ")} -`)}let o=n.stubsCreated.length>0;o&&L("fail","run",`produced ${n.stubsCreated.length} empty auto-stub(s) and implemented nothing \u2014 the headless code-author needs a real LLM transport (set ANTHROPIC_API_KEY) or use the host-delegated path (clad serve + your AI host). This run did NOT do the work.`),G.exit(n.halt.class==="ALL_FEATURES_DONE"&&!o?0:1)}function Q8e(t={}){try{let e=B();if(ya("."))L("note","sync","derived-file writes deferred \u2014 git operation in progress; re-run after the merge/rebase completes.");else{let r=_s(".");Vl(".",r),Wa("."),N5(".");let n=tu(".");n==="created"?L("note","agents.md","wrote a spec-driven AGENTS.md so non-Claude agents share the same guidance."):n==="updated"&&L("note","agents.md","refreshed the AGENTS.md managed block from the current spec.");let i=Lte(".");for(let s of i.repaired)L("note","test_refs",`repaired ${s.from} \u2192 ${s.to} (${s.shard})`);for(let s of i.suggested)L("note","test_refs",`suggested ${s.ref} (${s.shard}) \u2014 confirm by removing the 'derived:' prefix`);let o=Yx(".");o&&L("note","deliverable",`auto-detected entry '${o.path}' \u2014 the gate now smoke-tests it. Opt out with is_safe_to_smoke: false.`)}if(t.proposeArchive){let n=iS.run({cwd:"."}).filter(i=>i.suggestion?.action==="propose-archive");if(n.length===0){L("pass","sync",`${e.features.length} features \xB7 0 archive candidates`),G.exit(0);return}for(let i of n){let o=i.suggestion?.args??{},s=String(o.featureId??"?"),a=String(o.reason??i.message);L("note",`propose-archive \xB7 ${s}`,a)}L("pass","sync",`${e.features.length} features \xB7 ${n.length} archive candidate(s)`),G.exit(0);return}L("pass","sync",`${e.features.length} features valid`),G.exit(0)}catch(e){L("fail","sync",e.message),G.exit(1)}}function e5e(t){if(!t){L("fail","checkpoint","feature id required (e.g. clad checkpoint F-001)"),G.exit(2);return}let e=E_(".",t),r=e.gitHead?e.gitHead.slice(0,12):"(no git)";L("pass",`checkpoint \xB7 ${t}`,`head=${r} digest=${e.specDigest.slice(0,12)}`),G.exit(0)}function t5e(t,e={}){if(!t){L("fail","rollback","feature id required (e.g. clad rollback F-001)"),G.exit(2);return}let r=A_(".",t);if(!r){L("fail",`rollback \xB7 ${t}`,"no prior checkpoint recorded"),G.exit(1);return}T_(".",t,r,e.reason);let n=r.gitHead?r.gitHead.slice(0,12):"(no git)";L("note",`rollback \xB7 ${t}`,`recorded \u2014 run the printed command to apply (cladding does not execute git) \xB7 target head=${n} ts=${r.timestamp}`),r.gitHead?G.stdout.write(`Run: git checkout ${r.gitHead} +`));G.exit(0)}async function t5e(t,e){L("note","run","EXPERIMENTAL \u2014 prefer the host-delegated path (clad serve + your AI host). See docs/feature-cycle.md \xA7 Execution surface.");let{runDriveLoop:r}=await Promise.resolve().then(()=>(Dde(),Cde)),n=await r({cwd:e.cwd,goal:t,budget:{maxIterations:Number(e.maxIterations),maxWallClockMs:Number(e.maxWallClockMs),maxRetriesPerFeature:Number(e.maxRetries)}}),i=n.halt.class==="ALL_FEATURES_DONE"?"pass":"note";if(e.json)L(i,"run",`halt=${n.halt.class} iter=${n.iterations} features=${n.featuresTouched.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`),G.stdout.write(`${JSON.stringify(n,null,2)} +`);else{let s=q(e.cwd??"."),a=n.featuresTouched.map(l=>oR(l,s)),c=`${pG(n.halt,s)} iter=${n.iterations} features=${a.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`;L(i,"run",c),a.length>0&&G.stdout.write(`Touched: ${a.join(", ")} +`)}let o=n.stubsCreated.length>0;o&&L("fail","run",`produced ${n.stubsCreated.length} empty auto-stub(s) and implemented nothing \u2014 the headless code-author needs a real LLM transport (set ANTHROPIC_API_KEY) or use the host-delegated path (clad serve + your AI host). This run did NOT do the work.`),G.exit(n.halt.class==="ALL_FEATURES_DONE"&&!o?0:1)}function r5e(t={}){try{let e=q();if(ya("."))L("note","sync","derived-file writes deferred \u2014 git operation in progress; re-run after the merge/rebase completes.");else{let r=_s(".");Vl(".",r),Wa("."),j5(".");let n=tu(".");n==="created"?L("note","agents.md","wrote a spec-driven AGENTS.md so non-Claude agents share the same guidance."):n==="updated"&&L("note","agents.md","refreshed the AGENTS.md managed block from the current spec.");let i=zte(".");for(let s of i.repaired)L("note","test_refs",`repaired ${s.from} \u2192 ${s.to} (${s.shard})`);for(let s of i.suggested)L("note","test_refs",`suggested ${s.ref} (${s.shard}) \u2014 confirm by removing the 'derived:' prefix`);let o=Xx(".");o&&L("note","deliverable",`auto-detected entry '${o.path}' \u2014 the gate now smoke-tests it. Opt out with is_safe_to_smoke: false.`)}if(t.proposeArchive){let n=oS.run({cwd:"."}).filter(i=>i.suggestion?.action==="propose-archive");if(n.length===0){L("pass","sync",`${e.features.length} features \xB7 0 archive candidates`),G.exit(0);return}for(let i of n){let o=i.suggestion?.args??{},s=String(o.featureId??"?"),a=String(o.reason??i.message);L("note",`propose-archive \xB7 ${s}`,a)}L("pass","sync",`${e.features.length} features \xB7 ${n.length} archive candidate(s)`),G.exit(0);return}L("pass","sync",`${e.features.length} features valid`),G.exit(0)}catch(e){L("fail","sync",e.message),G.exit(1)}}function n5e(t){if(!t){L("fail","checkpoint","feature id required (e.g. clad checkpoint F-001)"),G.exit(2);return}let e=A_(".",t),r=e.gitHead?e.gitHead.slice(0,12):"(no git)";L("pass",`checkpoint \xB7 ${t}`,`head=${r} digest=${e.specDigest.slice(0,12)}`),G.exit(0)}function i5e(t,e={}){if(!t){L("fail","rollback","feature id required (e.g. clad rollback F-001)"),G.exit(2);return}let r=T_(".",t);if(!r){L("fail",`rollback \xB7 ${t}`,"no prior checkpoint recorded"),G.exit(1);return}O_(".",t,r,e.reason);let n=r.gitHead?r.gitHead.slice(0,12):"(no git)";L("note",`rollback \xB7 ${t}`,`recorded \u2014 run the printed command to apply (cladding does not execute git) \xB7 target head=${n} ts=${r.timestamp}`),r.gitHead?G.stdout.write(`Run: git checkout ${r.gitHead} `):G.stdout.write(`No git head pinned \u2014 restore spec.yaml manually from VCS history. -`),G.exit(0)}async function r5e(t){let e=t.host?t.host==="all"?["claude","codex","gemini","antigravity","cursor"].slice():[t.host]:void 0,r=await VC({force:t.force,quiet:t.quiet,projectRoot:t.project,hosts:e});G.exit(r.errors.length>0?1:0)}async function n5e(){L("note","update","reconciling the current project after the engine upgrade");let t=await FX(".",{wireHosts:async()=>(await VC({quiet:!0,projectRoot:"."})).errors.length});if(!t.isProject){L("skip","update","no spec.yaml here \u2014 nothing re-wired. Run `clad update` inside a cladding project, or `clad init` to start one."),G.exit(t.code);return}L(t.wiringErrors>0?"fail":"pass","hosts",t.wiringErrors>0?`${t.wiringErrors} wiring error(s)`:"re-wired"),t.inventoryDeferred?L("note","spec",`inventory + index writes deferred \u2014 git operation in progress; re-run \`clad update\` after it completes (${t.features} features seen).`):L("pass","spec",`inventory synced \xB7 ${t.features} features`),L(t.claudeMd==="refreshed-stale"?"note":"pass","CLAUDE.md",t.claudeMd),L(t.agentsMd==="refreshed-stale"?"note":"pass","AGENTS.md",t.agentsMd);for(let r of t.deprecations)L("note","deprecated",r);G.stdout.write(` +`),G.exit(0)}async function o5e(t){let e=t.host?t.host==="all"?["claude","codex","gemini","antigravity","cursor"].slice():[t.host]:void 0,r=await WC({force:t.force,quiet:t.quiet,projectRoot:t.project,hosts:e});G.exit(r.errors.length>0?1:0)}async function s5e(){L("note","update","reconciling the current project after the engine upgrade");let t=await BX(".",{wireHosts:async()=>(await WC({quiet:!0,projectRoot:"."})).errors.length});if(!t.isProject){L("skip","update","no spec.yaml here \u2014 nothing re-wired. Run `clad update` inside a cladding project, or `clad init` to start one."),G.exit(t.code);return}L(t.wiringErrors>0?"fail":"pass","hosts",t.wiringErrors>0?`${t.wiringErrors} wiring error(s)`:"re-wired"),t.inventoryDeferred?L("note","spec",`inventory + index writes deferred \u2014 git operation in progress; re-run \`clad update\` after it completes (${t.features} features seen).`):L("pass","spec",`inventory synced \xB7 ${t.features} features`),L(t.claudeMd==="refreshed-stale"?"note":"pass","CLAUDE.md",t.claudeMd),L(t.agentsMd==="refreshed-stale"?"note":"pass","AGENTS.md",t.agentsMd);for(let r of t.deprecations)L("note","deprecated",r);G.stdout.write(` \u2192 drift check (report-only \xB7 does not block, does not edit your spec): -`),$A({tier:"pre-commit",strict:!0}).anyFailed?G.stdout.write("\n\u2139 The findings above are the bar this upgrade raised \u2014 not a failed update. Reconcile them in YOUR spec when ready (`clad check --strict` for the full gate).\n"):L("pass","drift","clean against the stricter detectors"),G.exit(t.code)}var i5e={"pre-commit":["stage_1.3","stage_1.5","stage_1.6"],"pre-push":["stage_1.1","stage_1.2","stage_1.3","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4"],all:["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"]};function $A(t){let e=t.tier??"all",r=t.silent===!0,n=i5e[e];if(!n)return t.json&&!r?G.stdout.write(`${JSON.stringify({tier:e,error:`unknown tier '${e}'`,worst:2,anyFailed:!0,stages:[]},null,2)} -`):r||L("fail","check",`unknown --tier '${e}' (expected: pre-commit | pre-push | all)`),{worst:2,anyFailed:!0,stages:[]};let i={focusModules:t.focusModules},s=[["stage_1.1",()=>Qm(i)],["stage_1.2",()=>Xm(i)],["stage_1.3",()=>oi({...i,strict:t.strict})],["stage_1.4",jj],["stage_1.5",rc],["stage_1.6",Gp],["stage_2.1",()=>Vj({...i,strict:t.strict})],["stage_2.2",()=>Mj(i)],["stage_2.3",dC],["stage_2.4",Uj],["stage_3.1",qj],["stage_3.2",Lj],["stage_3.3",Wj],["stage_4.1",Ij],["stage_4.2",eh]].filter(([d])=>n.includes(d)),a=0,c=!1,l=d=>d==="pass"?"pass":d==="liveness"?"note":d==="na"?"skip":ci(d)?"fail":"skip",u=[];H_("."),fte(".");try{for(let[d,f]of s){let p=f({}),m=t.internal?d:Ta(d),h=kX(p);ci(h)&&(c=!0,a=Math.max(a,EX(p,h))),u.push({stage:d,label:m,status:h,exitCode:p.exitCode,stderr:p.stderr,findings:p.findings}),!t.json&&!r&&(L(l(h),m),ci(h)&&f5e(p))}}finally{Z_(),mte()}if(t.strict)try{let d=B();for(let f of ute(d,u))a=Math.max(a,1),c=!0,u.push({stage:f.stage,label:f.label,status:"fail",exitCode:1,stderr:f.message}),!t.json&&!r&&L("fail",f.label,f.message)}catch{}if(t.strict&&(e==="pre-push"||e==="all")){let d=u.find(h=>h.stage==="stage_1.3"),f=(d?.findings??[]).filter(h=>h.severity==="error"||h.severity==="warn"),p=d?.status==="fail"&&f.length>0&&f.every(h=>h.detector==="STALE_ATTESTATION"),m=u.every(h=>h.stage==="stage_1.3"||!ci(h.status));if(p&&m&&d&&(d.status="pass",d.exitCode=0,d.stderr="stale attestation exempted \u2014 this run re-verified and re-attests",c=u.some(h=>ci(h.status)),a=c?Math.max(1,a):0,!t.json&&!r&&L("note","attestation","stale entries re-verified by this run \u2014 re-attesting")),!c&&!r)if(ya("."))t.json||L("note","attestation","deferred \u2014 git operation in progress; run the gate again after the merge/rebase completes.");else try{PG(".",B())&&(t.json||L("note","attestation","spec/attestation.yaml refreshed (verified tree stamped)"))}catch{}}return t.json&&!r?G.stdout.write(`${JSON.stringify({tier:e,worst:a,anyFailed:c,stages:u},null,2)} -`):c&&!r&&G.stdout.write("\n\u2139 Run `clad doctor` for the event log, or `clad sync` to check the spec. The findings above say what drifted and why.\n"),tr(".","gate_run",{tier:e,strict:t.strict===!0,worst:a,anyFailed:c}),{worst:a,anyFailed:c,stages:u}}function o5e(t){try{let e=B(),r=fl(e,t);G.stdout.write(`${JSON.stringify(r,null,2)} -`),G.exit("not_found"in r?1:0)}catch(e){L("fail","context",e.message),G.exit(1)}}function s5e(t,e={}){try{let r=B(),n=e.depth!==void 0?Number(e.depth):void 0,i=vr(r,t,{depth:n});G.stdout.write(`${JSON.stringify(i,null,2)} -`),G.exit("not_found"in i?1:0)}catch(r){L("fail","impact",r.message),G.exit(1)}}function a5e(t={}){try{let e=B(),r=t.ambiguity!==void 0?Number(t.ambiguity):void 0,i=uS(e,o=>{try{return Nde(o,"utf8")}catch{return null}},r!==void 0?{maxOwnerAmbiguity:r}:{});G.stdout.write(`${JSON.stringify({suggestions:i.suggestions,new_edges:i.edges.length,already_declared:i.alreadyDeclared.length,dynamic_import_files:i.dynamicImportFiles},null,2)} -`),G.exit(0)}catch(e){L("fail","infer-deps",e.message),G.exit(1)}}function c5e(t={}){try{if(t.sessions){Jee(t);return}if(t.trend!==void 0&&t.trend!==!1){Yee(t);return}let e=B(),n=IH(e,o=>{try{return Nde(o,"utf8")}catch{return null}},"."),i=CH(".",n);if(t.json)G.stdout.write(`${JSON.stringify(n,null,2)} +`),kA({tier:"pre-commit",strict:!0}).anyFailed?G.stdout.write("\n\u2139 The findings above are the bar this upgrade raised \u2014 not a failed update. Reconcile them in YOUR spec when ready (`clad check --strict` for the full gate).\n"):L("pass","drift","clean against the stricter detectors"),G.exit(t.code)}var a5e={"pre-commit":["stage_1.3","stage_1.5","stage_1.6"],"pre-push":["stage_1.1","stage_1.2","stage_1.3","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4"],all:["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"]};function kA(t){let e=t.tier??"all",r=t.silent===!0,n=a5e[e];if(!n)return t.json&&!r?G.stdout.write(`${JSON.stringify({tier:e,error:`unknown tier '${e}'`,worst:2,anyFailed:!0,stages:[]},null,2)} +`):r||L("fail","check",`unknown --tier '${e}' (expected: pre-commit | pre-push | all)`),{worst:2,anyFailed:!0,stages:[]};let i={focusModules:t.focusModules},s=[["stage_1.1",()=>eh(i)],["stage_1.2",()=>Qm(i)],["stage_1.3",()=>oi({...i,strict:t.strict})],["stage_1.4",Mj],["stage_1.5",rc],["stage_1.6",Zp],["stage_2.1",()=>Wj({...i,strict:t.strict})],["stage_2.2",()=>Fj(i)],["stage_2.3",fC],["stage_2.4",qj],["stage_3.1",Bj],["stage_3.2",zj],["stage_3.3",Kj],["stage_4.1",Pj],["stage_4.2",th]].filter(([d])=>n.includes(d)),a=0,c=!1,l=d=>d==="pass"?"pass":d==="liveness"?"note":d==="na"?"skip":ci(d)?"fail":"skip",u=[];G_("."),pte(".");try{for(let[d,f]of s){let p=f({}),m=t.internal?d:Ta(d),h=RX(p);ci(h)&&(c=!0,a=Math.max(a,IX(p,h))),u.push({stage:d,label:m,status:h,exitCode:p.exitCode,stderr:p.stderr,findings:p.findings}),!t.json&&!r&&(L(l(h),m),ci(h)&&h5e(p))}}finally{V_(),hte()}if(t.strict)try{let d=q();for(let f of dte(d,u))a=Math.max(a,1),c=!0,u.push({stage:f.stage,label:f.label,status:"fail",exitCode:1,stderr:f.message}),!t.json&&!r&&L("fail",f.label,f.message)}catch{}if(t.strict&&(e==="pre-push"||e==="all")){let d=u.find(h=>h.stage==="stage_1.3"),f=(d?.findings??[]).filter(h=>h.severity==="error"||h.severity==="warn"),p=d?.status==="fail"&&f.length>0&&f.every(h=>h.detector==="STALE_ATTESTATION"),m=u.every(h=>h.stage==="stage_1.3"||!ci(h.status));if(p&&m&&d&&(d.status="pass",d.exitCode=0,d.stderr="stale attestation exempted \u2014 this run re-verified and re-attests",c=u.some(h=>ci(h.status)),a=c?Math.max(1,a):0,!t.json&&!r&&L("note","attestation","stale entries re-verified by this run \u2014 re-attesting")),!c&&!r)if(ya("."))t.json||L("note","attestation","deferred \u2014 git operation in progress; run the gate again after the merge/rebase completes.");else try{CG(".",q())&&(t.json||L("note","attestation","spec/attestation.yaml refreshed (verified tree stamped)"))}catch{}}return t.json&&!r?G.stdout.write(`${JSON.stringify({tier:e,worst:a,anyFailed:c,stages:u},null,2)} +`):c&&!r&&G.stdout.write("\n\u2139 Run `clad doctor` for the event log, or `clad sync` to check the spec. The findings above say what drifted and why.\n"),tr(".","gate_run",{tier:e,strict:t.strict===!0,worst:a,anyFailed:c}),{worst:a,anyFailed:c,stages:u}}function c5e(t){try{let e=q(),r=fl(e,t);G.stdout.write(`${JSON.stringify(r,null,2)} +`),G.exit("not_found"in r?1:0)}catch(e){L("fail","context",e.message),G.exit(1)}}function l5e(t,e={}){try{let r=q(),n=e.depth!==void 0?Number(e.depth):void 0,i=vr(r,t,{depth:n});G.stdout.write(`${JSON.stringify(i,null,2)} +`),G.exit("not_found"in i?1:0)}catch(r){L("fail","impact",r.message),G.exit(1)}}function u5e(t={}){try{let e=q(),r=t.ambiguity!==void 0?Number(t.ambiguity):void 0,i=dS(e,o=>{try{return jde(o,"utf8")}catch{return null}},r!==void 0?{maxOwnerAmbiguity:r}:{});G.stdout.write(`${JSON.stringify({suggestions:i.suggestions,new_edges:i.edges.length,already_declared:i.alreadyDeclared.length,dynamic_import_files:i.dynamicImportFiles},null,2)} +`),G.exit(0)}catch(e){L("fail","infer-deps",e.message),G.exit(1)}}function d5e(t={}){try{if(t.sessions){Yee(t);return}if(t.trend!==void 0&&t.trend!==!1){Xee(t);return}let e=q(),n=PH(e,o=>{try{return jde(o,"utf8")}catch{return null}},"."),i=DH(".",n);if(t.json)G.stdout.write(`${JSON.stringify(n,null,2)} `);else{let o=n.context,s=o.truncatedCount>0?`budget enforces ${o.medianShrinkTruncated}x on ${o.truncatedCount} capped feature(s) (cap-driven)`:"no feature hit the budget cap",a=o.fitsCount>0?`${o.medianShrinkFit}x on ${o.fitsCount} fitting`:"none fit untruncated",c=[`graph efficiency \xB7 ${n.measured}/${n.featureCount} features`,` context: working-set ${o.medianSliceTokens} tok vs naive ${o.medianNaiveTokens} tok \u2014 ${s}, ${a}`,` uncapped structural slice = ${o.medianStructuralRatio}x of naive \u2014 the value is the guaranteed budget + wired needs/breaks/verify, not raw shrink`,` search: median ${n.search.medianDepth} hop(s) resolved (p95 ${n.search.p95Depth}), median ${n.search.medianEdges} edge(s)/feature (max hub ${n.search.maxEdges})`,` stability: median blast-radius coverage ${n.stability.medianCoverage}, median ${n.stability.medianRegressionTests} regression test(s) surfaced; stops ${JSON.stringify(n.stability.byStopReason)}`,` ${pl}`];G.stdout.write(`${c.join(` `)} -`),i.appended?L("note","measure","snapshot recorded to .cladding/measure.jsonl \u2014 see `clad measure --trend`"):i.reason==="deduped"?L("note","measure","commit+spec state unchanged since last snapshot \u2014 not recorded"):i.reason==="no_head"&&L("note","measure","no git HEAD \u2014 snapshot not recorded (commit first; a head-less line has no reproduce target)")}G.exit(0)}catch(e){L("fail","measure",e.message),G.exit(1)}}function l5e(t){let e;if(t.feature)try{let i=(B().features??[]).find(o=>o.id===t.feature||o.slug===t.feature);i||(L("fail","check",`no feature '${t.feature}' in spec \u2014 cannot scope gate`),G.exit(1)),e=i.modules}catch(n){L("fail","check",n.message),G.exit(1)}let r=$A({...t,focusModules:e});if(!t.json){let n=oX(".");n&&G.stdout.write(`\u2139 ${n} -`)}G.exitCode=r.worst}function u5e(t){let e=QY(".",t,{checkStages:$A,onIndex:Wa,gitOpInProgress:$O});L(e.ok?"pass":"fail",`done \xB7 ${t}`,e.reason),G.exit(e.code)}function d5e(t,e={}){let r=e.cwd??".",n;try{n=B(r)}catch(o){L("fail","oracle",`spec not loaded: ${o.message}`),G.exit(1);return}if(e.required){t&&G.stdout.write(`(note: --required lists the whole-project worklist; ignoring '${t}') -`);let o=z5(n);if(o.length===0){G.stdout.write(`No oracles required \u2014 set project.oracle_policy or require_oracles, or no done ACs match the policy. +`),i.appended?L("note","measure","snapshot recorded to .cladding/measure.jsonl \u2014 see `clad measure --trend`"):i.reason==="deduped"?L("note","measure","commit+spec state unchanged since last snapshot \u2014 not recorded"):i.reason==="no_head"&&L("note","measure","no git HEAD \u2014 snapshot not recorded (commit first; a head-less line has no reproduce target)")}G.exit(0)}catch(e){L("fail","measure",e.message),G.exit(1)}}function f5e(t){let e;if(t.feature)try{let i=(q().features??[]).find(o=>o.id===t.feature||o.slug===t.feature);i||(L("fail","check",`no feature '${t.feature}' in spec \u2014 cannot scope gate`),G.exit(1)),e=i.modules}catch(n){L("fail","check",n.message),G.exit(1)}let r=kA({...t,focusModules:e});if(!t.json){let n=uX(".");n&&G.stdout.write(`\u2139 ${n} +`)}G.exitCode=r.worst}function p5e(t){let e=eX(".",t,{checkStages:kA,onIndex:Wa,gitOpInProgress:kO});L(e.ok?"pass":"fail",`done \xB7 ${t}`,e.reason),G.exit(e.code)}function m5e(t,e={}){let r=e.cwd??".",n;try{n=q(r)}catch(o){L("fail","oracle",`spec not loaded: ${o.message}`),G.exit(1);return}if(e.required){t&&G.stdout.write(`(note: --required lists the whole-project worklist; ignoring '${t}') +`);let o=U5(n);if(o.length===0){G.stdout.write(`No oracles required \u2014 set project.oracle_policy or require_oracles, or no done ACs match the policy. `),G.exit(0);return}let s=o.filter(a=>!a.hasOracle);for(let a of o){let c=a.hasOracle?"\u2713":"\xB7",l=a.hasOracle?"":" \u2190 needs an impl-blind oracle";G.stdout.write(` ${c} ${a.featureId}.${a.acId} [${a.reason}${a.ears?`:${a.ears}`:""}]${l} `)}G.stdout.write(` ${o.length} AC(s) required, ${s.length} missing an oracle. -`),G.exit(s.length>0?1:0);return}if(!t){L("fail","oracle","provide a to print its blind brief, or --required to list the ACs the policy needs an oracle for"),G.exit(1);return}let i=zte(n,t,e.ac,r);if(!i||i.acs.length===0){L("fail","oracle",`no acceptance criteria for ${t}${e.ac?`.${e.ac}`:""} \u2014 nothing to author a blind oracle from`),G.exit(1);return}G.stdout.write(`${Ute(i)} -`),G.exit(0)}function f5e(t){if(t.findings&&t.findings.length>0){let e=t.findings.filter(i=>i.severity==="error"),r=t.findings.filter(i=>i.severity==="warn"),n=e.length>0?e:r;for(let i of n.slice(0,3)){let o=Dde(_l(i.detector,i.message),140),s=i.path?` \u2014 ${i.path}`:"";G.stdout.write(` ${o}${s} [${i.detector}] +`),G.exit(s.length>0?1:0);return}if(!t){L("fail","oracle","provide a to print its blind brief, or --required to list the ACs the policy needs an oracle for"),G.exit(1);return}let i=Ute(n,t,e.ac,r);if(!i||i.acs.length===0){L("fail","oracle",`no acceptance criteria for ${t}${e.ac?`.${e.ac}`:""} \u2014 nothing to author a blind oracle from`),G.exit(1);return}G.stdout.write(`${qte(i)} +`),G.exit(0)}function h5e(t){if(t.findings&&t.findings.length>0){let e=t.findings.filter(i=>i.severity==="error"),r=t.findings.filter(i=>i.severity==="warn"),n=e.length>0?e:r;for(let i of n.slice(0,3)){let o=Nde(_l(i.detector,i.message),140),s=i.path?` \u2014 ${i.path}`:"";G.stdout.write(` ${o}${s} [${i.detector}] `)}n.length>3&&G.stdout.write(` \u2026 and ${n.length-3} more finding(s) `),t.hint&&G.stdout.write(` fix: run \`${t.hint}\` `);return}if(t.stderr&&t.stderr.trim().length>0){let e=t.stderr.split(` -`).find(r=>r.trim().length>0);e&&G.stdout.write(` ${Dde(e.trim(),160)} -`)}}function Dde(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function p5e(t){let e=B();if(t.json){G.stdout.write(`${JSON.stringify(Xx(e,"."),null,2)} -`),G.exitCode=0;return}G.stdout.write(`${qte(e,".",{internal:t.internal})} -`),G.exit(0)}function m5e(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function h5e(t){let e=t.cwd??".",r=(t.out??"").trim();if(r.length===0){L("fail","bundle","missing --out \u2014 the bundle needs a destination path"),G.exit(1);return}let n;try{let i=B(e),o=Xx(i,e),s={gitHead:va(e),version:Xl(),generatedAt:t.now??new Date().toISOString()},a=gl(i),c;try{let l=t.since??rs(e),u=ns(e,l);c={kind:"present",sinceRef:l,changelogMarkdown:ml(u),auditMarkdown:hl(u,i,e)}}catch(l){c={kind:"omitted",reason:l.message}}n=$G({spec:i,panel:o,provenance:s,catalogMarkdown:a,changes:c})}catch(i){L("fail","bundle",i.message),G.exit(1);return}try{K8e(r,n,"utf8")}catch(i){L("fail","bundle",`could not write ${r}: ${i.message}`),G.exit(1);return}L("pass","bundle",`${r} \xB7 ${m5e(Buffer.byteLength(n,"utf8"))}`),G.exit(0)}function g5e(t){let e=BA(t);L("note",`route \u2192 ${e}`,t),G.exit(e==="unknown"?1:0)}function y5e(){let t=new w4;t.name("clad").description("Reference Ironclad CLI").version("0.9.0"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init payment SaaS for B2B` \u2014 free text in any language) to drive intent-aware onboarding \u2014 the LLM dispatcher then produces domain-aware capabilities/architecture/project-context plus product-level follow-up questions. Bare `clad init` keeps the v0.3.42 behaviour (greenfield seeds, or observed scan when \u22653 source files exist).").option("-n, --name ","Project name (default: cwd basename)").option("-f, --force","Overwrite existing spec.yaml").option("--scan","Force-walk the existing codebase. Default auto-detects (\u22653 source files trigger scan). Use --no-scan to skip even when source is present.").option("--no-llm","Force the deterministic interpreter (skip the LLM dispatcher chain). Intent text falls back to a deterministic quote in project-context.md.").option("--roots ","Override scanner source roots, comma-separated (e.g. packages/a/src,packages/b/src). Otherwise inferred from manifests + directory heuristics.").option("--with-hook","Install git pre-commit (cheap tier) AND pre-push (strict tier) hooks. Opt-in; cladding never touches .git without it.").option("--with-ci","Scaffold .github/workflows/cladding.yml running the strict pre-push gate \u2014 the authoritative enforcement layer.").option("--json","emit the raw InitResult for tooling; default is the human-readable surface").action(Y8e),t.command("run [goal]").description("(experimental) Headless autonomous loop \u2014 iterate ready features, dispatch developer + reviewer personas, run L1 gates, record evidence. The supported, exercised path is host-delegated (clad serve + your AI host loops the cadence); this loop needs a real LLM transport and is not auto-invoked").option("--cwd ","target project directory (default cwd)").option("--max-iterations ","cap iterations (default 50)","50").option("--max-wall-clock-ms ","cap wall clock (default 600000)","600000").option("--max-retries ","cap retries per feature (default 3)","3").option("--json","emit the raw internal result (Iron Core view); default is a plain Soft Shell summary").action(X8e),t.command("sync").description("Validate spec.yaml against schema and report").option("--propose-archive","list STALE_SPECIFICATION findings whose suggestion.action is propose-archive (Phased Decommissioning Tier 2)").action(Q8e),t.command("setup").description("Activate Cladding only for the current project (Claude Code / Codex / Gemini / Antigravity / Cursor)").option("--project ","activate a project other than the current directory").option("--host ","activate detected hosts (default), all, or one of: claude, codex, gemini, antigravity, cursor").option("--force","replace an existing conflicting cladding-owned project entry").option("--quiet","suppress stdout output").action(r5e),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: refresh project host wiring + sync inventory + refresh managed CLAUDE.md/AGENTS.md, then report stricter detector findings").action(n5e),t.command("check").description("Run every Iron Law stage and the drift detector suite").option("--internal","show stage codes (`stage_1.1`) instead of names (`Type`)").option("--strict","promote warn-severity drift findings to errors (CI / pre-publish gate)").option("--tier ","run only the stages for a trigger: pre-commit (drift/arch/secret) | pre-push (+ type/lint/unit/cov/spec-conformance/deliverable-smoke) | all (default; full 15-stage gate, used by CI)").option("--json","emit structured per-stage results (machine-readable: findings with file/line/suggestion, untruncated) \u2014 for agents/CI; cuts RED\u2192fix round-trips").option("--feature ","scope the gate to this feature's modules[] (Gradle monorepos): runs only :project: tasks instead of the root aggregate. No-op for non-Gradle repos or modules-less features").action(l5e),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(e5e),t.command("done ").description("Mark a feature done ONLY if `clad check --tier=pre-push --strict` is GREEN (flip \u2192 gate \u2192 revert-on-red). Keeps `done` honest.").action(u5e),t.command("oracle [featureId]").description("Print the impl-blind oracle authoring brief (acceptance criteria + signatures, never the implementation). Hand it to a fresh blind sub-agent; record the result with clad_author_oracle. cladding calls no LLM. Use --required to list which done ACs the project policy needs an oracle for.").option("--ac ","restrict the brief to a single acceptance criterion").option("--required","list the done ACs the oracle_policy / require_oracles requires an oracle for (worklist), instead of a brief").option("--cwd ","project root (defaults to .)").action((r,n)=>d5e(r,n)),t.command("rollback ").description("Record a rollback event and print the maintainer-runnable git command for the latest checkpoint").option("-r, --reason ","optional free-text reason recorded on the event payload").action(t5e),t.command("status").description("Render the feature \xD7 stage integrity matrix (business titles; use --internal for raw F-NNN ids)").option("--internal","show internal F-NNN ids and stage codes").option("--json","emit the row model as JSON \u2014 the same feature \xD7 stage integrity matrix rendered to the terminal (columns + per-feature glyph cells), one SSoT for terminal, JSON, and the audit bundle").action(p5e),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(o5e),t.command("impact ").description("Print the blast radius for a change \u2014 what depends on a feature/file + the tests to re-run (F-7794a6bc)").option("--depth ","bound the dependent walk to N hops (default: the full transitive radius)").action((r,n)=>s5e(r,n)),t.command("verdict").description("One-poll loop decision: DONE|ITERATE|ESCALATE|BLOCKED|BOOTSTRAP over the pre-push strict gate + feature statuses (F-2e28cc72). Single gate touch; DONE requires \u22651 non-liveness proof.").option("--json","emit the verdict object as JSON").option("--tier ","gate tier (default pre-push)").action(r=>CX(r,{checkStages:$A})),t.command("infer-deps").description("Suggest feature depends_on edges from the code import graph \u2014 the dependency edges cladding never auto-produced (F-2be3e3bb). Prints reviewable suggestions; does not write the spec.").option("--ambiguity ","emit edges for imports owned by \u2264 N features (default 1 = unambiguous single-owner only)").action(r=>a5e(r)),t.command("measure").description("Report the search + context efficiency the graph provides per feature \u2014 working-set tokens vs the naive baseline, dependency depth/edges resolved, regression-set coverage (F-16138071). Deterministic; no agent.").option("--json","emit the full report as JSON").option("--sessions","summarize recorded value-delivery telemetry instead \u2014 impact-card fire rate over eligible edits, the per-reason skip histogram, and MCP read-serve counts. Measures DELIVERY (did the surfaces fire), NOT adoption (F-6ba22c5c).").option("--trend [n]","render the last N (default 5) recorded measure snapshots with signed deltas \u2014 spot efficiency drift over time from the deduped .cladding/measure.jsonl ledger (F-39609db4)").action(r=>c5e(r));let e=t.command("graph").description("Render the spec\u2194code\u2194doc knowledge graph for a viewer, or report its shape (F-569f4b37)");return e.command("export").description("Export the graph: mermaid/dot/json to stdout, or an Obsidian vault to --out").option("--format ","mermaid | dot | json | obsidian | html (default: mermaid). html = a single self-contained offline viewer (requires --out)").option("--focus ","restrict to a feature/file node\u2019s neighborhood (id, slug, or module path)").option("--depth ","neighborhood radius around --focus (default: unbounded)").option("--out ","write to a file (or, for obsidian, a vault dir \u2014 default .cladding/graph)").action(r=>ate(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>cte()),e.command("serve").description("Serve a LIVE graph at localhost \u2014 recomputes on each load + auto-reloads on spec/doc changes (F-64a5c159)").option("--port ","port to listen on (default 3000)").action(r=>{lte(r)}),t.command("changelog").description("Render shipped changes since a git ref into human-facing documents (F-904495a5). Default: capability-grouped markdown from feature titles + acceptance sentences (no internal ids). --json emits the deterministic manifest hosts render release notes from; --audit the id-keeping verification table; --catalog the full capability \u2192 feature \u2192 acceptance catalog.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--json","print the deterministic ChangelogManifest as JSON (byte-identical across runs on the same state)").option("--audit","print the audit table \u2014 feature | AC | EARS | verification refs, each marked resolved \u2713/\u2717").option("--catalog","print the full capability \u2192 feature \u2192 acceptance listing of the living spec (no git range)").option("--measure","embed the release's own re-derivable measurement \u2014 but ONLY a snapshot taken at the current HEAD; no match renders a not-measured notice, never an older snapshot (F-ede6fa75)").action(r=>dG(r)),t.command("report").description("Render one deterministic review packet for a git range (F-f6cc5e5a) \u2014 spec-shard movement (from the changelog), changed source files resolved to their owning features via the reverse index, the deduped regression set, and gate + attestation state. For PR reviewers, team-leads, and auditors: it RENDERS, it gates nothing. Byte-identical across two runs on the same repository state.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--format ","md (default, the four-section markdown packet) | sarif (SARIF 2.1.0 \u2014 one result per error/warn drift finding, for code-scanning UIs) | json (the raw deterministic model)").action(r=>SY(r)),t.command("bundle").description("Write ONE self-contained HTML audit bundle (F-e940fffe) a non-coder can double-click \u2014 offline, zero network, no CDN, no scripts. Contains the project header + inventory, the feature \xD7 stage matrix, the capability catalog, shipped changes for the range, the audit table with resolved refs, and the attestation summary, under a provenance banner (git HEAD, date, version). Deterministic modulo the date stamp. If no anchor ref resolves, the changelog + audit sections show an omitted notice while the rest still renders.").requiredOption("--out ","destination path for the HTML bundle").option("--since ","git ref to diff shipped changes from (default: the latest tag via `git describe --tags --abbrev=0`)").action(r=>h5e(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(g5e),t.command("hook ").description("Host hook protocol adapter \u2014 consume one host lifecycle event (SessionStart | UserPromptSubmit | PreToolUse | PostToolUse | Stop) as stdin JSON and print the protocol response on stdout. Always exits 0 so a hook failure never bricks the host session.").action($X),t.command("serve").description("Run cladding as an MCP server over stdio \u2014 tools/resources/prompts for any MCP client").option("--cwd ","project directory exposed to the client (default cwd)").action(J8e),t.command("doctor").description("Summarise .cladding/events.log.jsonl \u2014 sentinel-miss frequency by phase/cause/fallback plus the top missed sentinels (LLM dispatcher health check)").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").option("--hosts","smoke-test host CLIs (Claude Code / Gemini / Antigravity / Codex / Cursor) and project wiring \u2192 dated artifact + docs/dogfood/matrix.md. Live LLM prompts run only with consent (CLAD_HOST_SMOKE=1 or --yes); otherwise not-run").option("--yes","grant live-run consent for --hosts (equivalent to CLAD_HOST_SMOKE=1)").option("--matrix-only","regenerate docs/dogfood/matrix.md from the newest host-smoke artifact without any probing").action(r=>{if(r.hosts||r.matrixOnly){JY({cwd:r.cwd,yes:r.yes,matrixOnly:r.matrixOnly});return}$Y(r)}),t.command("clarify [answer...]").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, free text in any language, e.g. `clad clarify B2B only`); the LLM refines spec/docs based on the full Q-A history and may emit new follow-up questions. Reads/writes `.cladding/onboarding/state.yaml`. Requires `clad init ` to have started a session first.").option("--cwd ","project directory containing .cladding/onboarding/state.yaml (default cwd)").option("--no-llm","force the deterministic interpreter (preserves current artifacts, logs the answer)").option("--json","emit the raw RefineReport for tooling; default is the human-readable surface").action(Hee),t}var _5e=!!globalThis.__CLADDING_BUNDLED,b5e=_5e||import.meta.url===`file://${G.argv[1]}`;b5e&&y5e().parse();export{i5e as TIER_STAGES,y5e as createProgram,h5e as runBundleCommand,l5e as runCheckCommand,$A as runCheckStages,e5e as runCheckpointCommand,o5e as runContextCommand,u5e as runDoneCommand,s5e as runImpactCommand,a5e as runInferDepsCommand,Y8e as runInitCommand,c5e as runMeasureCommand,d5e as runOracleCommand,t5e as runRollbackCommand,g5e as runRouteCommand,X8e as runRunCommand,J8e as runServeCommand,r5e as runSetupCommand,p5e as runStatusCommand,Q8e as runSyncCommand,n5e as runUpdateCommand}; +`).find(r=>r.trim().length>0);e&&G.stdout.write(` ${Nde(e.trim(),160)} +`)}}function Nde(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function g5e(t){let e=q();if(t.json){G.stdout.write(`${JSON.stringify(Qx(e,"."),null,2)} +`),G.exitCode=0;return}G.stdout.write(`${Bte(e,".",{internal:t.internal})} +`),G.exit(0)}function y5e(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function _5e(t){let e=t.cwd??".",r=(t.out??"").trim();if(r.length===0){L("fail","bundle","missing --out \u2014 the bundle needs a destination path"),G.exit(1);return}let n;try{let i=q(e),o=Qx(i,e),s={gitHead:va(e),version:Xl(),generatedAt:t.now??new Date().toISOString()},a=gl(i),c;try{let l=t.since??rs(e),u=ns(e,l);c={kind:"present",sinceRef:l,changelogMarkdown:ml(u),auditMarkdown:hl(u,i,e)}}catch(l){c={kind:"omitted",reason:l.message}}n=kG({spec:i,panel:o,provenance:s,catalogMarkdown:a,changes:c})}catch(i){L("fail","bundle",i.message),G.exit(1);return}try{X8e(r,n,"utf8")}catch(i){L("fail","bundle",`could not write ${r}: ${i.message}`),G.exit(1);return}L("pass","bundle",`${r} \xB7 ${y5e(Buffer.byteLength(n,"utf8"))}`),G.exit(0)}function b5e(t){let e=HA(t);L("note",`route \u2192 ${e}`,t),G.exit(e==="unknown"?1:0)}function v5e(){let t=new x4;t.name("clad").description("Reference Ironclad CLI").version("0.9.0"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init payment SaaS for B2B` \u2014 free text in any language) to drive intent-aware onboarding \u2014 the LLM dispatcher then produces domain-aware capabilities/architecture/project-context plus product-level follow-up questions. Bare `clad init` keeps the v0.3.42 behaviour (greenfield seeds, or observed scan when \u22653 source files exist).").option("-n, --name ","Project name (default: cwd basename)").option("-f, --force","Overwrite existing spec.yaml").option("--scan","Force-walk the existing codebase. Default auto-detects (\u22653 source files trigger scan). Use --no-scan to skip even when source is present.").option("--no-llm","Force the deterministic interpreter (skip the LLM dispatcher chain). Intent text falls back to a deterministic quote in project-context.md.").option("--roots ","Override scanner source roots, comma-separated (e.g. packages/a/src,packages/b/src). Otherwise inferred from manifests + directory heuristics.").option("--with-hook","Install git pre-commit (cheap tier) AND pre-push (strict tier) hooks. Opt-in; cladding never touches .git without it.").option("--with-ci","Scaffold .github/workflows/cladding.yml running the strict pre-push gate \u2014 the authoritative enforcement layer.").option("--json","emit the raw InitResult for tooling; default is the human-readable surface").action(e5e),t.command("run [goal]").description("(experimental) Headless autonomous loop \u2014 iterate ready features, dispatch developer + reviewer personas, run L1 gates, record evidence. The supported, exercised path is host-delegated (clad serve + your AI host loops the cadence); this loop needs a real LLM transport and is not auto-invoked").option("--cwd ","target project directory (default cwd)").option("--max-iterations ","cap iterations (default 50)","50").option("--max-wall-clock-ms ","cap wall clock (default 600000)","600000").option("--max-retries ","cap retries per feature (default 3)","3").option("--json","emit the raw internal result (Iron Core view); default is a plain Soft Shell summary").action(t5e),t.command("sync").description("Validate spec.yaml against schema and report").option("--propose-archive","list STALE_SPECIFICATION findings whose suggestion.action is propose-archive (Phased Decommissioning Tier 2)").action(r5e),t.command("setup").description("Activate Cladding only for the current project (Claude Code / Codex / Gemini / Antigravity / Cursor)").option("--project ","activate a project other than the current directory").option("--host ","activate detected hosts (default), all, or one of: claude, codex, gemini, antigravity, cursor").option("--force","replace an existing conflicting cladding-owned project entry").option("--quiet","suppress stdout output").action(o5e),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: refresh project host wiring + sync inventory + refresh managed CLAUDE.md/AGENTS.md, then report stricter detector findings").action(s5e),t.command("check").description("Run every Iron Law stage and the drift detector suite").option("--internal","show stage codes (`stage_1.1`) instead of names (`Type`)").option("--strict","promote warn-severity drift findings to errors (CI / pre-publish gate)").option("--tier ","run only the stages for a trigger: pre-commit (drift/arch/secret) | pre-push (+ type/lint/unit/cov/spec-conformance/deliverable-smoke) | all (default; full 15-stage gate, used by CI)").option("--json","emit structured per-stage results (machine-readable: findings with file/line/suggestion, untruncated) \u2014 for agents/CI; cuts RED\u2192fix round-trips").option("--feature ","scope the gate to this feature's modules[] (Gradle monorepos): runs only :project: tasks instead of the root aggregate. No-op for non-Gradle repos or modules-less features").action(f5e),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(n5e),t.command("done ").description("Mark a feature done ONLY if `clad check --tier=pre-push --strict` is GREEN (flip \u2192 gate \u2192 revert-on-red). Keeps `done` honest.").action(p5e),t.command("oracle [featureId]").description("Print the impl-blind oracle authoring brief (acceptance criteria + signatures, never the implementation). Hand it to a fresh blind sub-agent; record the result with clad_author_oracle. cladding calls no LLM. Use --required to list which done ACs the project policy needs an oracle for.").option("--ac ","restrict the brief to a single acceptance criterion").option("--required","list the done ACs the oracle_policy / require_oracles requires an oracle for (worklist), instead of a brief").option("--cwd ","project root (defaults to .)").action((r,n)=>m5e(r,n)),t.command("rollback ").description("Record a rollback event and print the maintainer-runnable git command for the latest checkpoint").option("-r, --reason ","optional free-text reason recorded on the event payload").action(i5e),t.command("status").description("Render the feature \xD7 stage integrity matrix (business titles; use --internal for raw F-NNN ids)").option("--internal","show internal F-NNN ids and stage codes").option("--json","emit the row model as JSON \u2014 the same feature \xD7 stage integrity matrix rendered to the terminal (columns + per-feature glyph cells), one SSoT for terminal, JSON, and the audit bundle").action(g5e),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(c5e),t.command("impact ").description("Print the blast radius for a change \u2014 what depends on a feature/file + the tests to re-run (F-7794a6bc)").option("--depth ","bound the dependent walk to N hops (default: the full transitive radius)").action((r,n)=>l5e(r,n)),t.command("verdict").description("One-poll loop decision: DONE|ITERATE|ESCALATE|BLOCKED|BOOTSTRAP over the pre-push strict gate + feature statuses (F-2e28cc72). Single gate touch; DONE requires \u22651 non-liveness proof.").option("--json","emit the verdict object as JSON").option("--tier ","gate tier (default pre-push)").action(r=>FX(r,{checkStages:kA})),t.command("infer-deps").description("Suggest feature depends_on edges from the code import graph \u2014 the dependency edges cladding never auto-produced (F-2be3e3bb). Prints reviewable suggestions; does not write the spec.").option("--ambiguity ","emit edges for imports owned by \u2264 N features (default 1 = unambiguous single-owner only)").action(r=>u5e(r)),t.command("measure").description("Report the search + context efficiency the graph provides per feature \u2014 working-set tokens vs the naive baseline, dependency depth/edges resolved, regression-set coverage (F-16138071). Deterministic; no agent.").option("--json","emit the full report as JSON").option("--sessions","summarize recorded value-delivery telemetry instead \u2014 impact-card fire rate over eligible edits, the per-reason skip histogram, and MCP read-serve counts. Measures DELIVERY (did the surfaces fire), NOT adoption (F-6ba22c5c).").option("--trend [n]","render the last N (default 5) recorded measure snapshots with signed deltas \u2014 spot efficiency drift over time from the deduped .cladding/measure.jsonl ledger (F-39609db4)").action(r=>d5e(r));let e=t.command("graph").description("Render the spec\u2194code\u2194doc knowledge graph for a viewer, or report its shape (F-569f4b37)");return e.command("export").description("Export the graph: mermaid/dot/json to stdout, or an Obsidian vault to --out").option("--format ","mermaid | dot | json | obsidian | html (default: mermaid). html = a single self-contained offline viewer (requires --out)").option("--focus ","restrict to a feature/file node\u2019s neighborhood (id, slug, or module path)").option("--depth ","neighborhood radius around --focus (default: unbounded)").option("--out ","write to a file (or, for obsidian, a vault dir \u2014 default .cladding/graph)").action(r=>cte(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>lte()),e.command("serve").description("Serve a LIVE graph at localhost \u2014 recomputes on each load + auto-reloads on spec/doc changes (F-64a5c159)").option("--port ","port to listen on (default 3000)").action(r=>{ute(r)}),t.command("changelog").description("Render shipped changes since a git ref into human-facing documents (F-904495a5). Default: capability-grouped markdown from feature titles + acceptance sentences (no internal ids). --json emits the deterministic manifest hosts render release notes from; --audit the id-keeping verification table; --catalog the full capability \u2192 feature \u2192 acceptance catalog.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--json","print the deterministic ChangelogManifest as JSON (byte-identical across runs on the same state)").option("--audit","print the audit table \u2014 feature | AC | EARS | verification refs, each marked resolved \u2713/\u2717").option("--catalog","print the full capability \u2192 feature \u2192 acceptance listing of the living spec (no git range)").option("--measure","embed the release's own re-derivable measurement \u2014 but ONLY a snapshot taken at the current HEAD; no match renders a not-measured notice, never an older snapshot (F-ede6fa75)").action(r=>fG(r)),t.command("report").description("Render one deterministic review packet for a git range (F-f6cc5e5a) \u2014 spec-shard movement (from the changelog), changed source files resolved to their owning features via the reverse index, the deduped regression set, and gate + attestation state. For PR reviewers, team-leads, and auditors: it RENDERS, it gates nothing. Byte-identical across two runs on the same repository state.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--format ","md (default, the four-section markdown packet) | sarif (SARIF 2.1.0 \u2014 one result per error/warn drift finding, for code-scanning UIs) | json (the raw deterministic model)").action(r=>wY(r)),t.command("bundle").description("Write ONE self-contained HTML audit bundle (F-e940fffe) a non-coder can double-click \u2014 offline, zero network, no CDN, no scripts. Contains the project header + inventory, the feature \xD7 stage matrix, the capability catalog, shipped changes for the range, the audit table with resolved refs, and the attestation summary, under a provenance banner (git HEAD, date, version). Deterministic modulo the date stamp. If no anchor ref resolves, the changelog + audit sections show an omitted notice while the rest still renders.").requiredOption("--out ","destination path for the HTML bundle").option("--since ","git ref to diff shipped changes from (default: the latest tag via `git describe --tags --abbrev=0`)").action(r=>_5e(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(b5e),t.command("hook ").description("Host hook protocol adapter \u2014 consume one host lifecycle event (SessionStart | UserPromptSubmit | PreToolUse | PostToolUse | Stop) as stdin JSON and print the protocol response on stdout. Always exits 0 so a hook failure never bricks the host session.").action(OX),t.command("serve").description("Run cladding as an MCP server over stdio \u2014 tools/resources/prompts for any MCP client").option("--cwd ","project directory exposed to the client (default cwd)").action(Q8e),t.command("doctor").description("Summarise .cladding/events.log.jsonl \u2014 sentinel-miss frequency by phase/cause/fallback plus the top missed sentinels (LLM dispatcher health check)").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").option("--hosts","smoke-test host CLIs (Claude Code / Gemini / Antigravity / Codex / Cursor) and project wiring \u2192 dated artifact + docs/dogfood/matrix.md. Live LLM prompts run only with consent (CLAD_HOST_SMOKE=1 or --yes); otherwise not-run").option("--yes","grant live-run consent for --hosts (equivalent to CLAD_HOST_SMOKE=1)").option("--matrix-only","regenerate docs/dogfood/matrix.md from the newest host-smoke artifact without any probing").action(r=>{if(r.hosts||r.matrixOnly){YY({cwd:r.cwd,yes:r.yes,matrixOnly:r.matrixOnly});return}kY(r)}),t.command("clarify [answer...]").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, free text in any language, e.g. `clad clarify B2B only`); the LLM refines spec/docs based on the full Q-A history and may emit new follow-up questions. Reads/writes `.cladding/onboarding/state.yaml`. Requires `clad init ` to have started a session first.").option("--cwd ","project directory containing .cladding/onboarding/state.yaml (default cwd)").option("--no-llm","force the deterministic interpreter (preserves current artifacts, logs the answer)").option("--json","emit the raw RefineReport for tooling; default is the human-readable surface").action(Gee),t}var S5e=!!globalThis.__CLADDING_BUNDLED,w5e=S5e||import.meta.url===`file://${G.argv[1]}`;w5e&&v5e().parse();export{a5e as TIER_STAGES,v5e as createProgram,_5e as runBundleCommand,f5e as runCheckCommand,kA as runCheckStages,n5e as runCheckpointCommand,c5e as runContextCommand,p5e as runDoneCommand,l5e as runImpactCommand,u5e as runInferDepsCommand,e5e as runInitCommand,d5e as runMeasureCommand,m5e as runOracleCommand,i5e as runRollbackCommand,b5e as runRouteCommand,t5e as runRunCommand,Q8e as runServeCommand,o5e as runSetupCommand,g5e as runStatusCommand,r5e as runSyncCommand,s5e as runUpdateCommand}; diff --git a/plugins/codex/skills/init/SKILL.md b/plugins/codex/skills/init/SKILL.md index 1de064d..a7cb315 100644 --- a/plugins/codex/skills/init/SKILL.md +++ b/plugins/codex/skills/init/SKILL.md @@ -19,7 +19,7 @@ If the current user message itself matches `APPLY CLADDING XXXXXX`, do not call 3. Read the returned prompt and observations. Draft the structured object required by `clad_init` using the current host model, then call `clad_stage_init` with the preparation token and that draft. Staging validates the draft and stores only ignored runtime state under `.cladding/host/`; it does not modify authored project files. 4. Show `plannedChanges`, the staged `confirmationQuestion`, and its one-time `approvalChallenge` to the user, then stop and wait for a separate reply. The original initialization request is not confirmation. 5. Only when the user's separate reply exactly matches `approvalChallenge`, call `clad_init` with the entire reply verbatim as `confirmation`—never strip the `APPLY CLADDING` prefix. Include the draft and token when the host retained them; process-per-turn hosts may omit both because Cladding resolves the exact staged draft from its short-lived machine-local cache. Questions, paraphrases, and generic acknowledgements are not approval. -6. If `nextQuestion` is present, show it verbatim and end the assistant turn immediately. Never answer it, infer an answer, or call either clarify tool during the initialization-approval turn. Continue with the Cladding clarify workflow only after a new user message supplies the answer. If no question remains, report that ordinary development can begin. +6. If `nextQuestion` is present, show it verbatim and end the assistant turn immediately. Never answer it, infer an answer, or call either clarify tool during the initialization-approval turn. Continue with the Cladding clarify workflow only after a new user message supplies the answer. If no question remains, report that onboarding is complete and that the next step is to author the first feature's spec — its acceptance criteria and the files it will cover — before writing any code; the feature cycle starts there, not with scaffolding. Do not run `clad init` in a shell from an AI-host onboarding session. Do not use MCP sampling. If the MCP tools are absent, tell the user to run `clad setup`, restart the AI host in the project directory, and stop without writing project files. diff --git a/plugins/gemini-cli/commands/init.toml b/plugins/gemini-cli/commands/init.toml index 9548cf1..760cf3d 100644 --- a/plugins/gemini-cli/commands/init.toml +++ b/plugins/gemini-cli/commands/init.toml @@ -16,7 +16,7 @@ If the current user message itself matches `APPLY CLADDING XXXXXX`, do not call 3. Read the returned prompt and observations. Draft the structured object required by `clad_init` using the current host model, then call `clad_stage_init` with the preparation token and that draft. Staging validates the draft and stores only ignored runtime state under `.cladding/host/`; it does not modify authored project files. 4. Show `plannedChanges`, the staged `confirmationQuestion`, and its one-time `approvalChallenge` to the user, then stop and wait for a separate reply. The original initialization request is not confirmation. 5. Only when the user's separate reply exactly matches `approvalChallenge`, call `clad_init` with the entire reply verbatim as `confirmation`—never strip the `APPLY CLADDING` prefix. Include the draft and token when the host retained them; process-per-turn hosts may omit both because Cladding resolves the exact staged draft from its short-lived machine-local cache. Questions, paraphrases, and generic acknowledgements are not approval. -6. If `nextQuestion` is present, show it verbatim and end the assistant turn immediately. Never answer it, infer an answer, or call either clarify tool during the initialization-approval turn. Continue with the Cladding clarify workflow only after a new user message supplies the answer. If no question remains, report that ordinary development can begin. +6. If `nextQuestion` is present, show it verbatim and end the assistant turn immediately. Never answer it, infer an answer, or call either clarify tool during the initialization-approval turn. Continue with the Cladding clarify workflow only after a new user message supplies the answer. If no question remains, report that onboarding is complete and that the next step is to author the first feature's spec — its acceptance criteria and the files it will cover — before writing any code; the feature cycle starts there, not with scaffolding. Do not run `clad init` in a shell from an AI-host onboarding session. Do not use MCP sampling. If the MCP tools are absent, tell the user to run `clad setup`, restart the AI host in the project directory, and stop without writing project files. diff --git a/skills/init/SKILL.md b/skills/init/SKILL.md index 1de064d..a7cb315 100644 --- a/skills/init/SKILL.md +++ b/skills/init/SKILL.md @@ -19,7 +19,7 @@ If the current user message itself matches `APPLY CLADDING XXXXXX`, do not call 3. Read the returned prompt and observations. Draft the structured object required by `clad_init` using the current host model, then call `clad_stage_init` with the preparation token and that draft. Staging validates the draft and stores only ignored runtime state under `.cladding/host/`; it does not modify authored project files. 4. Show `plannedChanges`, the staged `confirmationQuestion`, and its one-time `approvalChallenge` to the user, then stop and wait for a separate reply. The original initialization request is not confirmation. 5. Only when the user's separate reply exactly matches `approvalChallenge`, call `clad_init` with the entire reply verbatim as `confirmation`—never strip the `APPLY CLADDING` prefix. Include the draft and token when the host retained them; process-per-turn hosts may omit both because Cladding resolves the exact staged draft from its short-lived machine-local cache. Questions, paraphrases, and generic acknowledgements are not approval. -6. If `nextQuestion` is present, show it verbatim and end the assistant turn immediately. Never answer it, infer an answer, or call either clarify tool during the initialization-approval turn. Continue with the Cladding clarify workflow only after a new user message supplies the answer. If no question remains, report that ordinary development can begin. +6. If `nextQuestion` is present, show it verbatim and end the assistant turn immediately. Never answer it, infer an answer, or call either clarify tool during the initialization-approval turn. Continue with the Cladding clarify workflow only after a new user message supplies the answer. If no question remains, report that onboarding is complete and that the next step is to author the first feature's spec — its acceptance criteria and the files it will cover — before writing any code; the feature cycle starts there, not with scaffolding. Do not run `clad init` in a shell from an AI-host onboarding session. Do not use MCP sampling. If the MCP tools are absent, tell the user to run `clad setup`, restart the AI host in the project directory, and stop without writing project files. diff --git a/spec.yaml b/spec.yaml index 4e60e9e..c7ee704 100644 --- a/spec.yaml +++ b/spec.yaml @@ -54,7 +54,7 @@ project: # Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand. inventory: - features: 259 + features: 261 scenarios: 2 capabilities: 6 - test_files: 241 + test_files: 243 diff --git a/spec/attestation.yaml b/spec/attestation.yaml index 9c30a21..6d68a09 100644 --- a/spec/attestation.yaml +++ b/spec/attestation.yaml @@ -20,12 +20,12 @@ attested_modules: CHANGELOG.md: 9580bab8d2c2d6f3 CLAUDE.md: 16212c1749e6005d GOVERNANCE.md: 21cc28eaaf637a20 - README.html: 3197384b3b9b62fb - README.ja.md: 764f0146b5e91a4d - README.ko.html: 529cb8fa2ef27a4e - README.ko.md: a97a9dc37e486bff - README.md: 303d3546af18e97d - README.zh.md: 6566893a50fc81ef + README.html: f9378f61e0073367 + README.ja.md: 1b94669e076dd9c9 + README.ko.html: 9209820dc1e7a57a + README.ko.md: 160a0845e8775bf6 + README.md: 81c9c6691e1ce51b + README.zh.md: 1572f023debba60d SECURITY.md: df1d0c80304b2f28 bin/clad: 77b80666665dd1b0 conformance/fixtures.yaml: 4b1b94dae1cd20b0 @@ -75,13 +75,13 @@ attested_modules: plugins/claude-code/agents/orchestrator.md: 443c6e13ade590cf plugins/claude-code/agents/planner.md: 5750002ebdfb43f1 plugins/claude-code/agents/reviewer.md: 9c4e095e60040473 - plugins/claude-code/commands/init.md: bf567f3b4e22069a + plugins/claude-code/commands/init.md: 5529b13d0f1ab4bf plugins/claude-code/hooks/hooks.json: 42321ead26fb1da8 plugins/codex/.codex-plugin/plugin.json: 26d1bc595d1b996a plugins/codex/.mcp.json: 43e3f4b2af24aa18 plugins/codex/skills/check/SKILL.md: 6a665422af510e72 plugins/codex/skills/developer/SKILL.md: 40af2943253f6c72 - plugins/codex/skills/init/SKILL.md: bf567f3b4e22069a + plugins/codex/skills/init/SKILL.md: 5529b13d0f1ab4bf plugins/codex/skills/observability/SKILL.md: 5ea8f14b1c9b4a61 plugins/codex/skills/orchestrator/SKILL.md: 443c6e13ade590cf plugins/codex/skills/planner/SKILL.md: 5750002ebdfb43f1 @@ -92,7 +92,7 @@ attested_modules: plugins/codex/skills/sync/SKILL.md: 775c0f990a52a3d9 plugins/gemini-cli/GEMINI.md: ba08eaf2cd557a65 plugins/gemini-cli/commands/README.md: 3527d771578431bd - plugins/gemini-cli/commands/init.toml: e44c7ead9bd927b2 + plugins/gemini-cli/commands/init.toml: e7f310fd7af23f95 plugins/gemini-cli/gemini-extension.json: 9d2f839716b55869 scripts/build-plugin.mjs: 7fabe2b6301b142a scripts/build.mjs: 3a4b204063024ef1 @@ -105,7 +105,7 @@ attested_modules: skills/checkpoint/SKILL.md: f723e8cfb8286a64 skills/clarify/SKILL.md: 5d08bbb821258d03 skills/doctor/SKILL.md: 6581c6c900c72d68 - skills/init/SKILL.md: bf567f3b4e22069a + skills/init/SKILL.md: 5529b13d0f1ab4bf skills/oracle/SKILL.md: 11e111ac0a4963c1 skills/rollback/SKILL.md: d472dc3a562b347b skills/route/SKILL.md: 5958830fef280c67 @@ -113,7 +113,7 @@ attested_modules: skills/serve/SKILL.md: f08bbdbbfeb05041 skills/status/SKILL.md: 09faadc50b3449da skills/sync/SKILL.md: 775c0f990a52a3d9 - spec.yaml: 587a14fca8bdcd03 + spec.yaml: b5dd1d4db56a1938 spec/README.md: 7c257426396d435c spec/architecture.yaml: f0888480405a13a8 spec/features/: a4d0f0eb87fed960 @@ -146,15 +146,15 @@ attested_modules: src/cli: a4d0f0eb87fed960 src/cli/benchmark.ts: 77f84d2a898d724f src/cli/changelog.ts: 2de1adb009b89ab4 - src/cli/clad.ts: 2f11ce5f158a44da - src/cli/clarify.ts: 393cc93a6feb698a + src/cli/clad.ts: 6a45fa2924292697 + src/cli/clarify.ts: f17177969d5b75ff src/cli/doctor-hosts.ts: 1f0c2cec5a310b81 src/cli/doctor.ts: b98b955fe75e7f7e src/cli/done.ts: 7eba807b6ec5a1aa - src/cli/enforcement-advisory.ts: 554a7b56475981c3 + src/cli/enforcement-advisory.ts: 395c5be696e88b5c src/cli/graph-serve.ts: 23e6e389225d0f98 src/cli/graph.ts: bab410061b8c746a - src/cli/hook.ts: 19a40c6254d139a0 + src/cli/hook.ts: 59d5fddd52d330ac src/cli/host-onboarding.ts: b046571d4be7280c src/cli/init.ts: fbd96fa32906313c src/cli/intent-from-path.ts: e69862821d979f22 @@ -530,6 +530,7 @@ attested_features: F-16746b: ok F-17df0a: ok F-18e951: ok + F-195cb59e: ok F-1c9166: ok F-1d23a6: ok F-1e7a10c3: ok @@ -642,6 +643,7 @@ attested_features: F-bc8ad013: ok F-bd07d7: ok F-bdcd90: ok + F-be5306eb: ok F-c037ae: ok F-c2c996: ok F-c3747d7d: ok diff --git a/spec/features/cold-start-cycle-signal-be5306eb.yaml b/spec/features/cold-start-cycle-signal-be5306eb.yaml new file mode 100644 index 0000000..fd0c196 --- /dev/null +++ b/spec/features/cold-start-cycle-signal-be5306eb.yaml @@ -0,0 +1,41 @@ +id: F-be5306eb +slug: cold-start-cycle-signal +title: "signal when a project has code but no feature specs — the cycle hasn't started" +status: done +modules: + - src/cli/enforcement-advisory.ts + - src/cli/hook.ts + - src/cli/clad.ts +acceptance_criteria: + - id: AC-a0e5840a + test_refs: + - tests/cli/enforcement-advisory.test.ts + ears: event + condition: "when a project has source code on disk but zero feature specs" + response: "return a non-blocking advisory that the feature cycle has not started, pointing to authoring the first feature's spec" + text: "When a project has source code on disk but zero feature specs, the system shall return a non-blocking advisory that the feature cycle has not started and that the next step is to author the first feature's spec so the code is governed rather than running ahead of the spec." + notes: "The ungoverned-code resting state: onboarding done, features: [], code scaffolded. Neither the unbound-edit nudge (reactive, source-edit-triggered) nor the enforcement advisory (needs undone>0) caught it. Source presence is detected with the scan walker (vendor dirs ignored, early exit)." + - id: AC-4e780c47 + test_refs: + - tests/cli/enforcement-advisory.test.ts + ears: unwanted + condition: "if the project has no source code yet, or already has one or more feature specs" + response: "return no cold-start advisory" + text: "If the project has no source code yet (fresh onboarding), or already has at least one feature spec, the system shall return no cold-start advisory, so a clean greenfield is never nagged and an active project is not mislabeled as un-started." + notes: "features.length === 0 AND source exists is the precise trigger; either suppressor silences it." + - id: AC-babf927c + test_refs: + - tests/cli/cold-start-signal.test.ts + ears: state + condition: "while a session starts in a project that has code but no feature specs" + response: "surface the cold-start signal in the SessionStart card" + text: "While a session starts in a project that has source code but no feature specs, the SessionStart card shall surface the cold-start signal, so the resting state is caught every session regardless of how it was reached." + notes: "SessionStart is the always-on net: it does not depend on catching the edit stream and survives across sessions." + - id: AC-7cf9593d + test_refs: + - tests/cli/enforcement-advisory.test.ts + ears: state + condition: "while clad check evaluates feature-cycle health" + response: "return the cold-start advisory when un-started, else the enforcement advisory, from one graduated evaluator, informational only" + text: "While clad check evaluates feature-cycle health, a single graduated evaluator shall return the cold-start advisory when the cycle is un-started, otherwise the enforcement advisory, and it shall be informational only — never changing the exit status." + notes: "featureCycleAdvisory = coldStartAdvisory ?? enforcementAdvisory. The existing F-f4e184f7 enforcementAdvisory stays unchanged; clad check calls the graduated wrapper." diff --git a/spec/features/onboarding-handoff-steer-195cb59e.yaml b/spec/features/onboarding-handoff-steer-195cb59e.yaml new file mode 100644 index 0000000..03320e2 --- /dev/null +++ b/spec/features/onboarding-handoff-steer-195cb59e.yaml @@ -0,0 +1,32 @@ +id: F-195cb59e +slug: onboarding-handoff-steer +title: "onboarding hands off to authoring the first feature spec, not straight to code" +status: done +modules: + - skills/init/SKILL.md + - src/cli/clarify.ts +acceptance_criteria: + - id: AC-f75cc3de + test_refs: + - tests/cli/onboarding-handoff-steer.test.ts + ears: state + condition: "while reporting that onboarding has no questions remaining" + response: "instruct the host that the next step is to author the first feature's spec before writing code, not that ordinary development can begin" + text: "While reporting onboarding completion, the init host instruction shall state that the next step is to author the first feature's spec before writing code — it shall not tell the host that ordinary development can simply begin." + notes: "Root cause of the ungoverned-code case: skills/init/SKILL.md said 'report that ordinary development can begin', so the host read it as 'write code now' and scaffolded a whole project with features: []. The handoff is where the feature cycle must be pointed at." + - id: AC-3b2026e1 + test_refs: + - tests/cli/clarify.test.ts + ears: state + condition: "while the CLI reports onboarding complete" + response: "tell the user to author the first feature's spec before writing code" + text: "While the CLI reports onboarding complete, its message shall tell the user that the next step is to author the first feature's spec before writing code, so the spec-first cycle is triggered at the handoff." + notes: "src/cli/clarify.ts final message previously ended at 'onboarding complete' with no next-step steer." + - id: AC-d21ead41 + test_refs: + - tests/cli/onboarding-handoff-steer.test.ts + ears: state + condition: "while steering to the first feature spec" + response: "name what the spec contains — its acceptance criteria and the files it will cover" + text: "While steering to the first feature spec, the message shall name what that spec contains — its acceptance criteria (the testable promises) and the files it will cover — so 'author a spec' is never vague about what to write." + notes: "Closes the audit gap that no user-facing string bundled 'what it must do (acceptance criteria) + which files it covers'. Plain language: no 'shard', no MCP tool name." diff --git a/spec/index.yaml b/spec/index.yaml index 3a0d0d9..a9a1b7f 100644 --- a/spec/index.yaml +++ b/spec/index.yaml @@ -102,6 +102,7 @@ features: F-16746b: {slug: enforcement-triggers, status: done, modules: 3} F-17df0a: {slug: scan-artifacts-llm-refinement, status: done, modules: 3} F-18e951: {slug: drift-baseline-cleanup, status: done, modules: 7} + F-195cb59e: {slug: onboarding-handoff-steer, status: done, modules: 2} F-1c9166: {slug: readme-capability-sync, status: done, modules: 2} F-1d23a6: {slug: host-hooks, status: done, modules: 5} F-1e7a10c3: {slug: adoption-report-surface, status: done, modules: 2} @@ -216,6 +217,7 @@ features: F-bc8ad013: {slug: mcp-description-diet, status: done, modules: 2} F-bd07d7: {slug: greenfield-seeds, status: done, modules: 5} F-bdcd90: {slug: oracle-policy-risk-weighted, status: done, modules: 8} + F-be5306eb: {slug: cold-start-cycle-signal, status: done, modules: 3} F-c037ae: {slug: test-refs-repair, status: done, modules: 4} F-c2c996: {slug: checkpoint-events, status: done, modules: 3} F-c3747d7d: {slug: spec-first-window-complete, status: done, modules: 5} diff --git a/src/cli/clad.ts b/src/cli/clad.ts index f658030..227f165 100644 --- a/src/cli/clad.ts +++ b/src/cli/clad.ts @@ -20,7 +20,7 @@ import {runReportCommand} from './report.js'; import {runDoctorCommand} from './doctor.js'; import {runDoctorHosts} from './doctor-hosts.js'; import {runDone} from './done.js'; -import {enforcementAdvisory} from './enforcement-advisory.js'; +import {featureCycleAdvisory} from './enforcement-advisory.js'; import {runHookCommand} from './hook.js'; import {runVerdictCommand} from './verdict.js'; import {runUpdate} from './update.js'; @@ -824,10 +824,11 @@ export function runCheckCommand(opts: {internal?: boolean; strict?: boolean; tie } } const result = runCheckStages({...opts, focusModules}); - // F-f4e184f7: a non-blocking advisory when the feature cycle has undone features - // but neither a hook nor CI enforces the checks. Suppressed under --json. + // F-f4e184f7 + F-be5306eb: a non-blocking advisory when the feature cycle isn't + // being driven — code with no feature specs (cold-start), or undone features with + // no hook/CI. Suppressed under --json. if (!opts.json) { - const advisory = enforcementAdvisory('.'); + const advisory = featureCycleAdvisory('.'); if (advisory) process.stdout.write(`ℹ ${advisory}\n`); } // Set process.exitCode rather than process.exit(): the machine-output mode diff --git a/src/cli/clarify.ts b/src/cli/clarify.ts index 71e522c..b541d2e 100644 --- a/src/cli/clarify.ts +++ b/src/cli/clarify.ts @@ -351,7 +351,10 @@ export async function runClarifyCommand( process.stdout.write(`\n${outcome.report!.remainingQuestions} question(s) left · continue with \`clad clarify \`.\n\n`); } } else if (outcome.report?.status === 'done') { - process.stdout.write('\n✓ All questions answered — onboarding complete. state.yaml status: done.\n\n'); + process.stdout.write( + '\n✓ All questions answered — onboarding complete.\n' + + " Next: author your first feature's spec — its acceptance criteria (the testable promises) and the files it will cover — before writing code. The feature cycle starts there.\n\n", + ); } else if ((outcome.report?.remainingQuestions ?? 0) > 0) { process.stdout.write(`\n${outcome.report!.remainingQuestions} question(s) left. continue with \`clad clarify \`.\n\n`); } diff --git a/src/cli/enforcement-advisory.ts b/src/cli/enforcement-advisory.ts index fba8e40..03bc807 100644 --- a/src/cli/enforcement-advisory.ts +++ b/src/cli/enforcement-advisory.ts @@ -1,15 +1,18 @@ -// Cladding · enforcement advisory (F-f4e184f7) +// Cladding · feature-cycle advisory (F-f4e184f7 enforcement + F-be5306eb cold-start) // -// A project can run for months with authored-but-undone features while every -// commit stays green: the pre-commit tier is not --strict, and if no hook and no -// CI are wired, the gate runs only when someone types `clad check`. Nothing tells -// the user the feature cycle isn't being enforced. This computes a single -// non-blocking advisory for `clad check` to print — derived from cwd alone, never -// from the gate outcome, so it can only inform, never change pass/fail. +// Non-blocking, cwd-derived advisories that tell the user the feature cycle isn't +// being driven. Two graduated cases: +// 1. COLD-START (F-be5306eb): the project has source code but zero feature specs +// — code is running ahead of the spec; the cycle never started. +// 2. ENFORCEMENT (F-f4e184f7): features are in flight but no hook/CI enforce the +// gate, so the checks run only when asked. +// Both are derived from cwd alone (never the gate outcome), so they can only +// inform — never change pass/fail. import {existsSync} from 'node:fs'; import {join} from 'node:path'; +import {walk} from './scan/walker.js'; import {enforcingHookInstalled} from '../init/git-hook.js'; import {loadSpec} from '../spec/load.js'; @@ -18,15 +21,43 @@ function ciWorkflowPresent(cwd: string): boolean { return existsSync(join(cwd, '.github', 'workflows')); } +/** True when at least one source file exists (vendor dirs / dotfiles ignored, early exit). */ +function hasSourceCode(cwd: string): boolean { + try { + return walk({root: cwd, maxFiles: 1}).length > 0; + } catch { + return false; + } +} + // Statuses of a feature still moving through the cycle. This is the advisory's own // "work in flight" notion (a UX cadence count), NOT the detectors' spec-first // severity window (isSpecFirstWindow, F-c3747d7d) — kept separate on purpose. const UNDONE_STATUSES: ReadonlySet = new Set(['planned', 'in_progress']); /** - * A one-line advisory when the feature cycle has undone features but no local hook - * and no CI enforce the checks — else `undefined`. Any ONE of {enforcing hook, CI - * workflow, zero undone features, unreadable spec} suppresses it. + * Cold-start advisory (F-be5306eb): the project has source code but zero feature + * specs, so the feature cycle never started — else `undefined`. Either suppressor + * (a feature already exists, or no source code yet) silences it. + */ +export function coldStartAdvisory(cwd = '.'): string | undefined { + try { + if ((loadSpec(cwd).features ?? []).length > 0) return undefined; // cycle already started + } catch { + return undefined; // no / invalid spec → onboarding not done; not this check's place + } + if (!hasSourceCode(cwd)) return undefined; // clean greenfield — nothing to nag + return ( + "This project has source code but no feature specs yet — the feature cycle hasn't started. " + + "Author your first feature's spec (its acceptance criteria and the files it covers) so the code " + + 'is governed by the spec, not running ahead of it.' + ); +} + +/** + * Enforcement advisory (F-f4e184f7): undone features but no local hook and no CI + * enforce the checks — else `undefined`. Any ONE of {enforcing hook, CI workflow, + * zero undone features, unreadable spec} suppresses it. */ export function enforcementAdvisory(cwd = '.'): string | undefined { let undone: number; @@ -44,3 +75,11 @@ export function enforcementAdvisory(cwd = '.'): string | undefined { 'Wire it with `clad init --with-hook`, or add a CI workflow.' ); } + +/** + * Graduated feature-cycle advisory: the cold-start signal when the cycle is + * un-started, otherwise the enforcement signal. One source for clad check to print. + */ +export function featureCycleAdvisory(cwd = '.'): string | undefined { + return coldStartAdvisory(cwd) ?? enforcementAdvisory(cwd); +} diff --git a/src/cli/hook.ts b/src/cli/hook.ts index 33541bb..0fa688f 100644 --- a/src/cli/hook.ts +++ b/src/cli/hook.ts @@ -47,6 +47,7 @@ import {dependSegment, formatWorkingSetCard, formatPushOneLiner, guardSegment, U import {estTokens} from '../optimizer/code-excerpt.js'; import {loadSpec} from '../spec/load.js'; import {WATCHED_EXTENSIONS} from '../stages/toolchain/language-config.js'; +import {coldStartAdvisory} from './enforcement-advisory.js'; import {driftNudge, plainFinding, plainLead, stopBlockMessage} from '../ui/softShell.js'; // --- shared helpers ---------------------------------------------------- @@ -187,6 +188,10 @@ function renderSessionStartCard(cwd: string): string { ? 'cladding: spec.yaml present but unparseable — counts unavailable (run clad check)' : `cladding: ${total} features (${done} done, ${inProgress.length} in progress) · ${scenarios} scenarios`, ]; + // F-be5306eb: code exists but no feature specs → the cycle never started. Only + // fires at zero features, so it never pushes the card past the line cap. + const coldStart = coldStartAdvisory(cwd); + if (coldStart) lines.push(`cladding: ${coldStart}`); if (inProgress.length > 0) { lines.push(`in progress: ${inProgress.slice(0, 3).map((f) => `${f.id} ${f.slug}`).join(', ')}`); } diff --git a/tests/cli/clarify.test.ts b/tests/cli/clarify.test.ts index 3026b90..55b9117 100644 --- a/tests/cli/clarify.test.ts +++ b/tests/cli/clarify.test.ts @@ -192,6 +192,12 @@ describe('runClarifyCommand', () => { expect(exitCalls).toEqual([0]); const after = loadState(dir)!; expect(after.status).toBe('done'); + // F-195cb59e AC-3b2026e1 — the completion message steers to authoring the + // first feature's spec (with its acceptance criteria + files) before code. + const out = stdoutChunks.join(''); + expect(out).toContain('first feature'); + expect(out).toContain('acceptance criteria'); + expect(out).toContain('before writing code'); }); test('--json emits a RefineReport', async () => { diff --git a/tests/cli/cold-start-signal.test.ts b/tests/cli/cold-start-signal.test.ts new file mode 100644 index 0000000..abcb143 --- /dev/null +++ b/tests/cli/cold-start-signal.test.ts @@ -0,0 +1,49 @@ +// Cladding · F-be5306eb AC-babf927c — SessionStart surfaces the cold-start signal. +// +// The always-on net: when a session starts in a project that has source code but +// zero feature specs, the SessionStart card says the feature cycle hasn't started — +// regardless of how that state was reached. + +import {mkdirSync, mkdtempSync, rmSync, writeFileSync} from 'node:fs'; +import {tmpdir} from 'node:os'; +import {join} from 'node:path'; + +import {afterEach, beforeEach, describe, expect, test, vi} from 'vitest'; + +vi.mock('../../src/stages/drift.js', () => ({runDrift: () => ({pass: true, exitCode: 0, findings: []})})); +vi.mock('../../src/stages/arch.js', () => ({runArch: () => ({pass: true, exitCode: 0})})); +vi.mock('../../src/stages/secret.js', () => ({runSecret: () => ({pass: true, exitCode: 0})})); + +const {runHookEvent} = await import('../../src/cli/hook.js'); + +let cwd: string; +beforeEach(() => { + cwd = mkdtempSync(join(tmpdir(), 'clad-cold-')); +}); +afterEach(() => { + rmSync(cwd, {recursive: true, force: true}); + vi.clearAllMocks(); +}); + +function writeSpec(features: string): void { + writeFileSync(join(cwd, 'spec.yaml'), `schema: "0.1"\nproject: {name: t, language: typescript}\nfeatures: ${features}\n`, 'utf8'); +} +function writeSource(): void { + mkdirSync(join(cwd, 'src'), {recursive: true}); + writeFileSync(join(cwd, 'src', 'foo.ts'), 'export const x = 1;\n'); +} + +describe('F-be5306eb AC-babf927c — SessionStart cold-start signal', () => { + test('code but zero feature specs → the card carries the cold-start line', () => { + writeSpec('[]'); + writeSource(); + const card = runHookEvent('SessionStart', {}, cwd); + expect(card).toContain("feature cycle hasn't started"); + }); + + test('a fresh project with no source code → no cold-start line', () => { + writeSpec('[]'); // no source written + const card = runHookEvent('SessionStart', {}, cwd); + expect(card).not.toContain("hasn't started"); + }); +}); diff --git a/tests/cli/enforcement-advisory.test.ts b/tests/cli/enforcement-advisory.test.ts index 9621454..bcb3708 100644 --- a/tests/cli/enforcement-advisory.test.ts +++ b/tests/cli/enforcement-advisory.test.ts @@ -11,7 +11,7 @@ import {join} from 'node:path'; import {afterEach, beforeEach, describe, expect, test} from 'vitest'; -import {enforcementAdvisory} from '../../src/cli/enforcement-advisory.js'; +import {coldStartAdvisory, enforcementAdvisory, featureCycleAdvisory} from '../../src/cli/enforcement-advisory.js'; const spec = (status: string): string => [ @@ -100,3 +100,46 @@ describe('F-f4e184f7 — enforcement advisory', () => { expect(enforcementAdvisory(cwd)).toContain('not yet done'); }); }); + +describe('F-be5306eb — cold-start / graduated feature-cycle advisory', () => { + const emptySpec = (): void => + writeFileSync(join(cwd, 'spec.yaml'), 'schema: "0.1"\nproject: {name: t, language: typescript}\nfeatures: []\n', 'utf8'); + const writeSource = (): void => { + mkdirSync(join(cwd, 'src'), {recursive: true}); + writeFileSync(join(cwd, 'src', 'foo.ts'), 'export const x = 1;\n'); + }; + + test('AC-a0e5840a — source code but zero feature specs → cold-start advisory', () => { + emptySpec(); + writeSource(); + const out = coldStartAdvisory(cwd); + expect(out).toBeTypeOf('string'); + expect(out).toContain("feature cycle hasn't started"); + expect(out).toContain('first feature'); + }); + + test('AC-4e780c47 — no source code yet (fresh onboarding) → no cold-start advisory', () => { + emptySpec(); // no source written + expect(coldStartAdvisory(cwd)).toBeUndefined(); + }); + + test('AC-4e780c47 — a feature already exists → no cold-start advisory even with code', () => { + writeSpec('in_progress'); // one feature + writeSource(); + expect(coldStartAdvisory(cwd)).toBeUndefined(); + }); + + test('AC-7cf9593d — graduated: cold-start wins when the cycle is un-started', () => { + emptySpec(); + writeSource(); + expect(featureCycleAdvisory(cwd)).toBe(coldStartAdvisory(cwd)); + expect(featureCycleAdvisory(cwd)).toContain("hasn't started"); + }); + + test('AC-7cf9593d — graduated: falls through to enforcement when features exist + no hook/CI', () => { + writeSpec('in_progress'); // undone feature, no hook, no CI + const out = featureCycleAdvisory(cwd); + expect(out).toContain('not yet done'); // enforcement message, not cold-start + expect(out).not.toContain("hasn't started"); + }); +}); diff --git a/tests/cli/onboarding-handoff-steer.test.ts b/tests/cli/onboarding-handoff-steer.test.ts new file mode 100644 index 0000000..52d9cc5 --- /dev/null +++ b/tests/cli/onboarding-handoff-steer.test.ts @@ -0,0 +1,33 @@ +// Cladding · F-195cb59e — the onboarding→development handoff steers to the first +// feature's spec, not straight to code. +// +// The ungoverned-code case (a whole project scaffolded with features: []) traced +// to the init host instruction: "report that ordinary development can begin". This +// pins the corrected instruction so the handoff points at the spec-first cycle. + +import {readFileSync} from 'node:fs'; +import {join} from 'node:path'; + +import {describe, expect, test} from 'vitest'; + +const SKILL = readFileSync(join(process.cwd(), 'skills', 'init', 'SKILL.md'), 'utf8'); + +describe('F-195cb59e — onboarding handoff steer (init SKILL.md)', () => { + test('AC-f75cc3de — the completion instruction steers to authoring the first feature spec, not bare "ordinary development can begin"', () => { + expect(SKILL).not.toContain('ordinary development can begin'); + expect(SKILL).toMatch(/author the first feature'?s spec/i); + expect(SKILL).toMatch(/before writing (any )?code/i); + }); + + test('AC-d21ead41 — the steer names what the spec contains (acceptance criteria + the files it covers) and stays plain', () => { + // isolate the steer SENTENCE (the init skill legitimately names clad_* tools + // elsewhere — that is agent-facing protocol, not the user-facing steer). + const start = SKILL.indexOf('author the first feature'); + const steer = SKILL.slice(start, SKILL.indexOf('scaffolding', start) + 'scaffolding'.length); + // names WHAT to write — not vague + expect(steer).toContain('acceptance criteria'); + expect(steer).toMatch(/files it will cover/i); + // plain: the steer never says "shard" + expect(steer).not.toMatch(/\bshard\b/i); + }); +}); From f9839d591eff16ac7c179abe1945484a6f794f5a Mon Sep 17 00:00:00 2001 From: qwerfunch Date: Tue, 21 Jul 2026 11:51:42 +0900 Subject: [PATCH 5/6] chore: reconcile derived files after rebase onto develop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rebasing this branch onto develop — which now carries the 0.9.1 adoption-capabilities fix (#245) — left the harness-written files holding their pre-rebase versions. Re-derived them against the merged tree: rebuilt the dist bundle, re-synced the spec inventory, regenerated the case-existing-adoption A/B report (capabilities-body byte-count shift), and re-stamped the attestation. Strict pre-push gate GREEN across 2602 tests. Co-Authored-By: Claude Opus 4.8 --- docs/ab-evaluation/case-existing-adoption.md | 10 +++--- plugins/claude-code/dist/clad.js | 32 ++++++++++---------- spec.yaml | 2 +- spec/attestation.yaml | 6 ++-- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/docs/ab-evaluation/case-existing-adoption.md b/docs/ab-evaluation/case-existing-adoption.md index 918a367..f062637 100644 --- a/docs/ab-evaluation/case-existing-adoption.md +++ b/docs/ab-evaluation/case-existing-adoption.md @@ -51,8 +51,8 @@ No spec, no architecture invariants — just code on the existing tree. | Test files | 1 | 1 | +0 | | Test LoC | 14 | 14 | +0 | | Test cases | 1 | 1 | +0 | -| Total chars (artifacts + code) | 11160 | 3864 | +7296 | -| Estimated tokens | 2792 | 967 | +1825 | +| Total chars (artifacts + code) | 11104 | 3864 | +7240 | +| Estimated tokens | 2778 | 967 | +1811 | **Detector outcomes** (META_INTEGRITY + HARDCODED_SECRET excluded — toolchain-only checks): @@ -90,8 +90,8 @@ B (Vanilla) — errors: 1 warns: 3 infos: 28 | Test files | 2 | 2 | +0 | | Test LoC | 27 | 27 | +0 | | Test cases | 3 | 3 | +0 | -| Total chars (artifacts + code) | 12703 | 5115 | +7588 | -| Estimated tokens | 3178 | 1280 | +1898 | +| Total chars (artifacts + code) | 12624 | 5115 | +7509 | +| Estimated tokens | 3158 | 1280 | +1878 | **Detector outcomes** (META_INTEGRITY + HARDCODED_SECRET excluded — toolchain-only checks): @@ -111,7 +111,7 @@ B (Vanilla) — errors: 1 warns: 3 infos: 28 - **Spec ↔ code traceability**: cladding emits 1 feature(s), 2 AC(s), 1 scenario(s), 3 capability(s); vanilla has 0 of each. - **Architecture enforcement**: cladding declares 3 layer(s) with 0 forbidden-import rule(s); vanilla has 0. - **Detector behavior**: cladding-managed tree → 1 error(s) / 1 warn(s) / 11 info(s). Vanilla tree → 1 / 3 / 28. The detectors that gate against spec (REFERENCE_INTEGRITY, MISSING_IMPLEMENTATION, ARCHITECTURE_FROM_SPEC, CAPABILITIES_FEATURE_MAPPING) need cladding's artifacts to evaluate — without them they silently pass. The "0 errors on vanilla" therefore is **absence of signal**, not absence of drift. -- **Token cost**: cladding's cumulative artifact + code consumes ~3178 tokens vs vanilla's ~1280 (heuristic chars/4) — Δ ≈ 1898 tokens, the price of structure. +- **Token cost**: cladding's cumulative artifact + code consumes ~3158 tokens vs vanilla's ~1280 (heuristic chars/4) — Δ ≈ 1878 tokens, the price of structure. - **Code surface**: vanilla writes 9 source file(s) / 144 LoC + 2 test file(s) / 3 test case(s); cladding writes 9 / 128 + 2 / 3. (Vanilla front-loads code, cladding front-loads spec — both converge by M2.) ## Outcome Quality (F-ba2e05) diff --git a/plugins/claude-code/dist/clad.js b/plugins/claude-code/dist/clad.js index 8fec559..2ee95e5 100755 --- a/plugins/claude-code/dist/clad.js +++ b/plugins/claude-code/dist/clad.js @@ -70,7 +70,7 @@ ${gf.indentComment(T,r.indent)}`}w===""&&!r.inFlow?O===` `):O+=` ${r.indent}`}else if(!p&&mo.isCollection(e)){let T=w[0],A=w.indexOf(` -`),D=A!==-1,$=r.inFlow??e.flow??e.items.length===0;if(D||!$){let ie=!1;if(D&&(T==="&"||T==="!")){let K=w.indexOf(" ");T==="&"&&K!==-1&&K{"use strict";var e6=Ge("process");function tpe(t,...e){t==="debug"&&console.log(...e)}function rpe(t,e){(t==="debug"||t==="warn")&&(typeof e6.emitWarning=="function"?e6.emitWarning(e):console.warn(e))}sT.debug=tpe;sT.warn=rpe});var zy=v(Ly=>{"use strict";var Fy=De(),t6=Dt(),jy="<<",My={identify:t=>t===jy||typeof t=="symbol"&&t.description===jy,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new t6.Scalar(Symbol(jy)),{addToJSMap:r6}),stringify:()=>jy},npe=(t,e)=>(My.identify(e)||Fy.isScalar(e)&&(!e.type||e.type===t6.Scalar.PLAIN)&&My.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===My.tag&&r.default);function r6(t,e,r){let n=n6(t,r);if(Fy.isSeq(n))for(let i of n.items)cT(t,e,i);else if(Array.isArray(n))for(let i of n)cT(t,e,i);else cT(t,e,n)}function cT(t,e,r){let n=n6(t,r);if(!Fy.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function n6(t,e){return t&&Fy.isAlias(e)?e.resolve(t.doc,t):e}Ly.addMergeToJSMap=r6;Ly.isMergeKey=npe;Ly.merge=My});var uT=v(s6=>{"use strict";var ipe=aT(),i6=zy(),ope=hf(),o6=De(),lT=Zo();function spe(t,e,{key:r,value:n}){if(o6.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(i6.isMergeKey(t,r))i6.addMergeToJSMap(t,e,n);else{let i=lT.toJS(r,"",t);if(e instanceof Map)e.set(i,lT.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=ape(r,i,t),s=lT.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function ape(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(o6.isNode(t)&&r?.doc){let n=ope.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),ipe.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}s6.addPairToJSMap=spe});var Jo=v(dT=>{"use strict";var a6=uf(),cpe=Q4(),lpe=uT(),Uy=De();function upe(t,e,r){let n=a6.createNode(t,void 0,r),i=a6.createNode(e,void 0,r);return new qy(n,i)}var qy=class t{constructor(e,r=null){Object.defineProperty(this,Uy.NODE_TYPE,{value:Uy.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Uy.isNode(r)&&(r=r.clone(e)),Uy.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return lpe.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?cpe.stringifyPair(this,e,r,n):JSON.stringify(this)}};dT.Pair=qy;dT.createPair=upe});var fT=v(l6=>{"use strict";var fa=De(),c6=hf(),By=df();function dpe(t,e,r){return(e.inFlow??t.flow?ppe:fpe)(t,e,r)}function fpe({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(b+=By.lineComment(b,o,l(g))),d&&g&&(d=!1),f.push(n+b)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;m{"use strict";var ehe=Qo(),the=Of(),rhe=YT();function nhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??ehe.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=the.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&rhe.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}_B.resolveBlockSeq=nhe});var cl=v(vB=>{"use strict";function ihe(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}vB.resolveEnd=ihe});var $B=v(xB=>{"use strict";var ohe=De(),she=Jo(),SB=Xo(),ahe=Qo(),che=cl(),wB=Of(),lhe=d_(),uhe=XT(),QT="Block collections are not allowed within flow collections",eO=t=>t&&(t.type==="block-map"||t.type==="block-seq");function dhe({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?SB.YAMLMap:ahe.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g0){let g=che.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` +`+D.comment:A.comment=D.comment);let re=new she.Pair(A,$);if(r.options.keepSourceTokens&&(re.srcToken=b),s){let K=l;uhe.mapIncludes(r,K.items,A)&&i(T,"DUPLICATE_KEY","Map keys must be unique"),K.items.push(re)}else{let K=new SB.YAMLMap(r.schema);K.flow=!0,K.items.push(re);let xe=($??A).range;K.range=[A.range[0],xe[1],xe[2]],l.items.push(K)}d=$?$.range[2]:D.end}}let f=s?"}":"]",[p,...m]=n.end,h=d;if(p?.source===f)h=p.offset+p.source.length;else{let g=a[0].toUpperCase()+a.substring(1),b=u?`${g} must end with a ${f}`:`${g} in block collection must be sufficiently indented and end with a ${f}`;i(d,u?"MISSING_CHAR":"BAD_INDENT",b),p&&p.source.length!==1&&m.unshift(p)}if(m.length>0){let g=che.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` `+g.comment:l.comment=g.comment),l.range=[n.offset,h,g.offset]}else l.range=[n.offset,h,h];return l}xB.resolveFlowCollection=dhe});var EB=v(kB=>{"use strict";var fhe=De(),phe=Dt(),mhe=Xo(),hhe=Qo(),ghe=yB(),yhe=bB(),_he=$B();function tO(t,e,r,n,i,o){let s=r.type==="block-map"?ghe.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?yhe.resolveBlockSeq(t,e,r,n,o):_he.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function bhe(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,m=f&&o?f.offset>o.offset?f:o:f??o;m&&(!p||p.offsetf.tag===s&&f.collection===a);if(!c){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),tO(t,e,r,i,s)}let l=tO(t,e,r,i,s,c),u=c.resolve?.(l,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??l,d=fhe.isNode(u)?u:new phe.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}kB.composeCollection=bhe});var nO=v(AB=>{"use strict";var rO=Dt();function vhe(t,e,r){let n=e.offset,i=She(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?rO.Scalar.BLOCK_FOLDED:rO.Scalar.BLOCK_LITERAL,s=e.source?whe(e.source):[],a=s.length;for(let h=s.length-1;h>=0;--h){let g=s[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&s.length>0?` `.repeat(Math.max(1,s.length-1)):"",g=n+i.length;return e.source&&(g+=e.source.length),{value:h,type:o,comment:i.comment,range:[n,g,g]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let h=0;hc&&(c=g.length);else{g.length=a;--h)s[h][0].length>c&&(a=h+1);let d="",f="",p=!1;for(let h=0;hr.length>0).map(r=>JSON.parse(r))}function ba(t){return RO(PO(t))}function E_(t){return[...RO(IO(t,_H,bH)),...RO(PO(t))]}function en(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function iye(t){let e;try{e=yH("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=eye().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function oye(t){try{return yH("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function jf(t,e){try{let r=ba(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function tr(t,e,r){try{let n=oye(t),i=iye(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=jf(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Qr(t,en(e,o))}catch{}}var _H,rye,bH,nye,Nr=y(()=>{"use strict";_H=".cladding",rye="events.log.jsonl",bH="events.log.1.jsonl",nye=5*1024*1024});import{execFileSync as sye}from"node:child_process";import{existsSync as vH,readdirSync as aye,readFileSync as cye,statSync as SH}from"node:fs";import{createHash as lye}from"node:crypto";import{join as CO}from"node:path";function va(t){try{return sye("git",["rev-parse","HEAD"],{cwd:t,stdio:["ignore","pipe","ignore"]}).toString("utf8").trim()||null}catch{return null}}function DO(t){let e=[],r=CO(t,"spec.yaml");vH(r)&&SH(r).isFile()&&e.push(r);for(let i of["features","scenarios"]){let o=CO(t,"spec",i);if(!(!vH(o)||!SH(o).isDirectory()))for(let s of aye(o))s.endsWith(".yaml")&&e.push(CO(o,s))}e.sort();let n=lye("sha256");for(let i of e){let o=i.slice(t.length+1);n.update(`${o}\0`),n.update(cye(i)),n.update("\0")}return n.digest("hex")}function A_(t,e){let r={featureId:e,gitHead:va(t),specDigest:DO(t),timestamp:new Date().toISOString()};return Qr(t,en("feature_checkpoint",{feature:e,git_head:r.gitHead,spec_digest:r.specDigest})),r}function T_(t,e){let r=ba(t);for(let n=r.length-1;n>=0;n--){let i=r[n];if(i.type==="feature_checkpoint"&&i.payload.feature===e)return{featureId:e,gitHead:i.payload.git_head??null,specDigest:String(i.payload.spec_digest??""),timestamp:i.timestamp}}return null}function O_(t,e,r,n){let i=en("feature_rolled_back",{feature:e,to_git_head:r.gitHead,to_spec_digest:r.specDigest,to_checkpoint_at:r.timestamp,reason:n??null});return Qr(t,i),i}var Mf=y(()=>{"use strict";Nr()});import{readFileSync as uye,statSync as dye}from"node:fs";import{extname as fye,resolve as NO,sep as pye}from"node:path";function tn(t){return Math.ceil(t.length/4)}function gye(t,e){let r=NO(e),n=NO(r,t);return n===r||n.startsWith(r+pye)}function xH(t,e,r,n){if(!gye(t,e))return{path:t,omitted:"unsafe-path"};if(!mye.has(fye(t).toLowerCase()))return{path:t,omitted:"unsupported"};let i,o;if(n){let l=n(t);if(l==null)return{path:t,omitted:"missing"};if(i=l,o=Buffer.byteLength(l,"utf8"),o>wH)return{path:t,omitted:"too-large",bytes:o}}else{let l=NO(e,t);try{o=dye(l).size}catch{return{path:t,omitted:"missing"}}if(o>wH)return{path:t,omitted:"too-large",bytes:o};try{i=uye(l,"utf8")}catch{return{path:t,omitted:"missing",bytes:o}}}if(i.includes(hye))return{path:t,omitted:"binary",bytes:o};let s=Math.max(0,Math.floor(r));if(i.length<=s)return{path:t,text:i,bytes:o};let a=` /* ... clipped (${o} bytes total) ... */ `,c=Math.max(0,s-a.length);return{path:t,text:i.slice(0,c)+a,truncated:!0,bytes:o}}var mye,wH,hye,R_=y(()=>{"use strict";mye=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".rs",".go",".java",".kt",".kts",".cs",".rb",".php",".swift",".c",".h",".cpp",".hpp",".css",".scss",".sql",".sh",".yaml",".yml",".json",".md",".toml"]),wH=2e6,hye="\0"});function _ye(t){for(let i of yye)if(t.startsWith(i))return null;let e=t.indexOf("#"),n=(e>=0?t.slice(0,e):t).trim();return n.length>0?n:null}function jO(t,e,r){let n=t.get(e);n||(n=new Set,t.set(e,n)),n.add(r)}function bye(t){let e=new Map,r=new Map,n=new Map;for(let i of t.features??[]){let o=i.id;for(let s of i.depends_on??[])jO(e,s,o);for(let s of i.modules??[])jO(r,s,o);for(let s of i.acceptance_criteria??[])for(let a of s.test_refs??[]){let c=_ye(a);c&&jO(n,c,o)}}return{dependents:e,moduleOwners:r,testRefCitations:n}}function An(t){let e=$H.get(t);return e||(e=bye(t),$H.set(t,e)),e}var yye,$H,Sa=y(()=>{"use strict";yye=["derived:","fixture:","script:","self-dogfood:"];$H=new WeakMap});function MO(t,e,r=1/0){let n=new Set,i=new Set(t),o=[...i],s=0;for(;o.length>0&&sn.id===e)??r.find(n=>n.slug===e)??null}function vr(t,e,r={}){let n=r.depth??1/0,i=An(t),o=new Map((t.features??[]).map(_=>[_.id,_])),s=[],a,c=vye(t,e);if(c)s=[c];else{let _=i.moduleOwners.get(e);_&&_.size>0&&(a=e,s=[..._].map(S=>o.get(S)).filter(S=>!!S))}if(s.length===0)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/spec/load.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (run clad sync if missing); module paths live in each shard\u2019s modules:; if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let l=s.map(_=>_.id),u=MO(l,i.dependents,n),d=[...u].map(_=>o.get(_)).filter(_=>!!_).map(_=>({id:_.id,title:_.title,status:_.status})).sort((_,S)=>_.id.localeCompare(S.id)),f=new Set([...l,...u]),p=[...f].map(_=>o.get(_)).filter(_=>!!_),m=[...new Set(p.flatMap(_=>_.modules??[]))].sort(),h=(t.scenarios??[]).filter(_=>(_.features??[]).some(S=>f.has(S))).map(_=>({id:_.id,title:_.title})).sort((_,S)=>_.id.localeCompare(S.id)),g=[...new Set(p.flatMap(_=>(_.acceptance_criteria??[]).flatMap(S=>S.test_refs??[])))].sort();return{focus:a?{module:a,owners:[...l].sort()}:{id:s[0].id,title:s[0].title,status:s[0].status},impacted:d,impacted_modules:m,scenarios:h,test_refs:g,ledger:FO(i)}}var wa=y(()=>{"use strict";Sa()});function kH(t){return t.impacted.length}function P_(t,e,r={}){let n=r.initialDepth??I_.initialDepth,i=r.maxDepth??I_.maxDepth,o=r.coverageThreshold??I_.coverageThreshold,s=r.marginYieldThreshold??I_.marginYieldThreshold,a=An(t),c=new Map((t.features??[]).map(b=>[b.id,b])),l=[],u=(t.features??[]).find(b=>b.id===e||b.slug===e);if(u)l=[u.id];else{let b=a.moduleOwners.get(e);b&&b.size>0&&(l=[...b].filter(_=>c.has(_)))}if(l.length===0){let b=vr(t,e,{depth:1});return"not_found"in b,b}let d=MO(l,a.dependents,1/0).size;if(d===0){let b=vr(t,e,{depth:n});return"not_found"in b?b:{slice:b,depthUsed:n,stoppedBy:"no-known-dependents",analysis:{frontierExhausted:!0,coverage:null,marginalYields:[0],totalKnownDependents:0}}}let f=[],p=0,m=null;for(let b=n;b<=i;b++){let _=vr(t,e,{depth:b});if("not_found"in _)return _;m=_;let S=kH(_),x=S-p,w=S>0?x/S:0;f.push(w);let O=d>0?S/d:1,T=x===0&&b>n,A={frontierExhausted:T,coverage:O,marginalYields:[...f],totalKnownDependents:d};if(T)return{slice:_,depthUsed:b,stoppedBy:"exhaustion",analysis:A};if(O>=o)return{slice:_,depthUsed:b,stoppedBy:"coverage",analysis:A};if(f.length>=2&&f[f.length-1]0?g/d:1,marginalYields:[...f],totalKnownDependents:d}}}var I_,LO=y(()=>{"use strict";wa();Sa();I_={initialDepth:1,maxDepth:10,coverageThreshold:.9,marginYieldThreshold:.05}});function Sye(t,e){let r=new Set,n=[t];for(;n.length>0;){let i=n.pop();if(!i||r.has(i))continue;r.add(i);let o=e.get(i);for(let s of o?.depends_on??[])n.push(s)}return r}function EH(t,e){let r=new Map(t.features.map(a=>[a.id,a]));if(!r.has(e))return t;let n=Sye(e,r),i=t.features.filter(a=>n.has(a.id)),o=(t.scenarios??[]).filter(a=>(a.features??[]).some(c=>n.has(c)));return{...t,features:i,scenarios:o}}var AH=y(()=>{"use strict"});function wye(t,e){let r=t.features??[];return r.find(n=>n.id===e)??r.find(n=>n.slug===e)??r.find(n=>(n.modules??[]).includes(e))??null}function fl(t,e){let r=wye(t,e);if(!r)return{not_found:e,accepted_forms:["feature id (F-\u2026)","slug","module path (e.g. src/auth/login.ts)"],discovery:"grep spec/index.yaml \u2014 one line per feature (id, slug, status; run clad sync if missing); if the query is a file, fall back to normal code search \u2014 the graph only knows declared modules"};let n=EH(t,r.id),i=(n.features??[]).filter(c=>c.id!==r.id).map(c=>({id:c.id,title:c.title,status:c.status})).sort((c,l)=>c.id.localeCompare(l.id)),o=(n.scenarios??[]).map(c=>({id:c.id,title:c.title})).sort((c,l)=>c.id.localeCompare(l.id)),s=(t.project?.ai_hints?.preferred_patterns??[]).map(c=>({when:c.when,prefer:c.prefer,...c.over!==void 0?{over:c.over}:{}})),a=[...new Set((r.acceptance_criteria??[]).flatMap(c=>c.test_refs??[]))].sort();return{focus:r,ancestors:i,scenarios:o,preferred_patterns:s,test_refs:a}}var C_=y(()=>{"use strict";AH()});import{existsSync as OH,readdirSync as xye,readFileSync as $ye}from"node:fs";import{join as UO}from"node:path";function qO(t,e=Eye){let r=t.trim().replace(/\s+/g," ");return r.length<=e?r:`${r.slice(0,e-1)}\u2026`}function Aye(t){let e=t.payload??{};if(t.type==="drift_detected"){let n=typeof e.gate=="string"&&e.gate?e.gate:"drift";return{detector:n,message:qO(`drift detected at gate ${n}`)}}let r=typeof e.worst=="number"?` (worst ${e.worst})`:"";return{detector:"done_attempted",message:qO(`done reverted \u2014 pre-push strict gate red${r}`)}}function TH(t){let e=Date.parse(t.timestamp);return Number.isFinite(e)?e:0}function Tye(t){let e=[];t.lastFailedGate&&e.push(`failed ${t.lastFailedGate}`),typeof t.retryCount=="number"&&e.push(`${t.retryCount} retries`);let r=e.length?` (${e.join(", ")})`:"",n=t.recovery?`recover: ${t.recovery}${r}`:`rolled back${r}`;return qO(n)}function Oye(t,e,r,n={}){let i=t.filter(m=>m&&m.payload&&m.payload.feature===r),o=e.filter(m=>m&&m.featureId===r).slice().sort((m,h)=>TH(m)-TH(h)),s=i.filter(m=>m.type==="drift_detected"||m.type==="done_attempted"&&m.payload.kept===!1),a=i.filter(m=>m.type==="feature_rolled_back");if(s.length===0&&a.length===0&&o.length===0)return;let c=o.length?o[o.length-1]:void 0,l;for(let m=s.length-1;m>=0;m--){let h=s[m].payload.gate;if(s[m].type==="drift_detected"&&typeof h=="string"&&h){l=h;break}}!l&&c?.lastFailedGate&&(l=c.lastFailedGate);let u=s.slice(-kye).map(Aye),d;for(let m=a.length-1;m>=0;m--){let h=a[m].payload.to_git_head;if(typeof h=="string"&&h){d=h;break}}let f=typeof c?.retryCount=="number"?c.retryCount:void 0,p=c?Tye(c):void 0;return{attempts:s.length,...l?{last_failed_gate:l}:{},...f!==void 0?{retry_count:f}:{},...u.length?{drift_history:u}:{},...d?{rolled_back_at:d}:{},...p?{recovery_hint:p}:{},...n.truncated?{truncated_history:!0}:{}}}function zO(t,e){let r=t.match(e);return r&&r[1]?r[1].trim():void 0}function Rye(t){let e=t.indexOf("## Recommended recovery");if(e<0)return;let r=t.slice(e).match(/```[^\n]*\n([\s\S]*?)```/);return r&&r[1].split(` -`).map(i=>i.trim()).find(i=>i.length>0)||void 0}function Iye(t,e,r){let n=zO(t,/_Rolled back at_\s*`([^`]+)`/),i=zO(t,/Last failed gate:\s*`([^`]+)`/),o=zO(t,/Retry attempts:\s*(\d+)/),s=Rye(t);return{featureId:e,timestamp:n??r,...i?{lastFailedGate:i}:{},...o?{retryCount:Number(o)}:{},...s?{recovery:s}:{}}}function Pye(t,e){let r=UO(t,".cladding","post-mortems");if(!OH(r))return[];let n=`post-mortem-${e}-`,i=[];for(let o of xye(r))if(!(!o.startsWith(n)||!o.endsWith(".md")))try{i.push(Iye($ye(UO(r,o),"utf8"),e,o))}catch{}return i}function RH(t,e){try{let r=E_(t),n=Pye(t,e),i=OH(UO(t,".cladding","events.log.1.jsonl"));return Oye(r,n,e,{truncated:i})}catch{return}}var kye,Eye,IH=y(()=>{"use strict";Nr();kye=5,Eye=120});function D_(t,e,r){return tn(JSON.stringify({...t,needs:e,must_edit:{...t.must_edit,code:r}}))}function xa(t,e,r={}){let n=r.cwd??".",i=r.maxTokens&&r.maxTokens>0?r.maxTokens:Cye,o=e,s,a=An(t).moduleOwners.get(e);if(a&&a.size>0){let se=[...a].sort();o=se[0],se.length>1&&(s=se)}let c=fl(t,o);if("not_found"in c)return c;let l=c.focus,u=RH(n,l.id),d=a&&a.size>0?e:l.id,f=P_(t,d),p="not_found"in f?null:f.slice,m=p?p.impacted:[],h=p?p.test_refs:[],g="not_found"in f?null:{depth:f.depthUsed,stopped_by:f.stoppedBy,coverage:f.analysis.coverage===null?null:Math.round(f.analysis.coverage*100)/100,total_known_dependents:f.analysis.totalKnownDependents},b=l.acceptance_criteria??[],_=b.filter(se=>se.ears==="unwanted"||se.ears==="state").map(se=>({id:se.id,ears:String(se.ears)})),S=[...new Set(b.flatMap(se=>se.oracle_refs??[]))].sort(),x=[],w={must_edit:{id:l.id,title:l.title,status:l.status,modules:l.modules??[],acceptance_criteria:b,code:[],...s?{co_owners:s}:{}},needs:c.ancestors,breaks_if_changed:{impacted:m,regression_tests:h,...g?{radius:g}:{}},verify:{scenarios:c.scenarios,test_refs:c.test_refs,oracle_refs:S,high_risk_acs:_},guidance:{preferred_patterns:c.preferred_patterns},budget:{max_tokens:i,used_tokens:0,truncated:x}},O=[...c.ancestors];for(;O.length>Dye&&D_(w,O,[])>i;)O.pop();O.lengthi){x.push(`code: omitted ${se} (budget)`);continue}A.push(Kt),Kt.truncated&&x.push(`code: clipped ${se}`)}T>i&&x.push("must-edit exceeds budget \u2014 retained in full (focus is never dropped)");let D=(se,Ce)=>({impacted:se,regression_tests:Ce,...g?{radius:g}:{},...p?.ledger?{ledger:p.ledger}:{}}),$=(se,Ce,Kt,dr)=>{let Xt=Kt+dr>0?[`breaks: omitted ${Kt} feature(s) / ${dr} test(s)`]:[],lo={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:D(se,Ce),budget:{...w.budget,truncated:[...x,...Xt]}};return tn(JSON.stringify(lo))>i},ie=m,K=h;if($(ie,K,0,0)){let se=vr(t,d,{depth:1}),Ce=new Set("not_found"in se?[]:se.impacted.map(de=>de.id)),Kt=new Set("not_found"in se?[]:se.test_refs),Xt=[...m.filter(de=>Ce.has(de.id)),...m.filter(de=>!Ce.has(de.id))],lo=0;for(;Xt.length>Ce.size&&$(Xt,K,lo,0);)Xt=Xt.slice(0,-1),lo++;let $i=[...h],Xr=0;for(;$(Xt,$i,lo,Xr);){let de=-1;for(let uo=$i.length-1;uo>=0;uo--)if(!Kt.has($i[uo])){de=uo;break}if(de<0)break;$i.splice(de,1),Xr++}ie=Xt,K=$i,lo+Xr>0&&x.push(`breaks: omitted ${lo} feature(s) / ${Xr} test(s)`),$(ie,K,0,0)&&x.push("breaks: direct set retained in full \u2014 exceeds budget")}let xe=D(ie,K),C={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:xe},P=C;if(u){let se={...C,prior_attempts:u};tn(JSON.stringify(se))<=i?P=se:x.push("prior_attempts: omitted (budget)")}let Ir=tn(JSON.stringify(P));return{...P,budget:{max_tokens:i,used_tokens:Ir,truncated:x}}}var Cye,Dye,N_=y(()=>{"use strict";R_();C_();LO();IH();wa();Sa();Cye=3e3,Dye=3});function Yn(t){if(t.length===0)return 0;let e=[...t].sort((n,i)=>n-i),r=Math.floor(e.length/2);return e.length%2?e[r]:(e[r-1]+e[r])/2}function Nye(t,e){if(t.length===0)return 0;let r=[...t].sort((n,i)=>n-i);return r[Math.min(r.length-1,Math.floor(e/100*r.length))]}function PH(t,e,r="."){let n=An(t),i=t.features??[],o=[];for(let f of i){let p=xa(t,f.id,{cwd:r,read:e});if("not_found"in p)continue;let m=xa(t,f.id,{cwd:r,read:e,maxTokens:Number.MAX_SAFE_INTEGER}),h=P_(t,f.id),g=!("not_found"in h),b=tn(JSON.stringify(p)),_="not_found"in m?b:tn(JSON.stringify(m)),S=tn(JSON.stringify(f));for(let O of f.modules??[]){let T=e(O);T&&(S+=tn(T))}let x=(f.depends_on??[]).length,w=n.dependents.get(f.id)?.size??0;o.push({id:f.id,sliceTokens:b,structuralTokens:_,naiveTokens:S,contextRatio:S>0?b/S:1,budgetSaturated:p.budget.truncated.length>0,searchDepth:g?h.depthUsed:1,edgesResolved:x+w,stoppedBy:g?h.stoppedBy:"n/a",coverage:g?h.analysis.coverage:1,regressionTests:p.breaks_if_changed.regression_tests.length})}o.sort((f,p)=>f.id.localeCompare(p.id));let s=o.map(f=>f.contextRatio),a=f=>f.filter(p=>p.sliceTokens>0).map(p=>p.naiveTokens/p.sliceTokens),c=o.filter(f=>!f.budgetSaturated),l=o.filter(f=>f.budgetSaturated),u=o.filter(f=>f.naiveTokens>0).map(f=>f.structuralTokens/f.naiveTokens),d={};for(let f of o)d[f.stoppedBy]=(d[f.stoppedBy]??0)+1;return{featureCount:i.length,measured:o.length,context:{medianContextRatio:Math.round(Yn(s)*1e3)/1e3,medianShrinkFactor:Math.round(Yn(a(o))*10)/10,fitsCount:c.length,truncatedCount:l.length,medianShrinkFit:Math.round(Yn(a(c))*10)/10,medianShrinkTruncated:Math.round(Yn(a(l))*10)/10,medianStructuralRatio:Math.round(Yn(u)*100)/100,medianSliceTokens:Math.round(Yn(o.map(f=>f.sliceTokens))),medianNaiveTokens:Math.round(Yn(o.map(f=>f.naiveTokens)))},search:{medianDepth:Yn(o.map(f=>f.searchDepth)),p95Depth:Nye(o.map(f=>f.searchDepth),95),medianEdges:Yn(o.map(f=>f.edgesResolved)),maxEdges:o.reduce((f,p)=>Math.max(f,p.edgesResolved),0)},stability:{byStopReason:d,medianCoverage:Math.round(Yn(o.map(f=>f.coverage).filter(f=>f!==null))*100)/100,medianRegressionTests:Yn(o.map(f=>f.regressionTests))},features:o}}var pl,j_=y(()=>{"use strict";R_();LO();N_();Sa();pl="(deterministic upper bound vs the shard+all-modules baseline \u2014 not an agent-adoption measurement)"});import{appendFileSync as jye,existsSync as BO,mkdirSync as Mye,readFileSync as CH}from"node:fs";import{dirname as Fye,join as Lye}from"node:path";function HO(t){return Lye(t,zye,Uye)}function qye(t,e){return{timestamp:new Date().toISOString(),head:va(t),spec_digest:DO(t),featureCount:e.featureCount,measured:e.measured,context:e.context,search:e.search,stability:e.stability}}function DH(t,e){try{let r=qye(t,e);if(r.head===null)return{appended:!1,reason:"no_head"};let n=GO(t),i=n[n.length-1];if(i&&i.head===r.head&&i.spec_digest===r.spec_digest)return{appended:!1,reason:"deduped"};let o=HO(t),s=Fye(o);return BO(s)||Mye(s,{recursive:!0}),jye(o,`${JSON.stringify(r)} +`).map(i=>i.trim()).find(i=>i.length>0)||void 0}function Iye(t,e,r){let n=zO(t,/_Rolled back at_\s*`([^`]+)`/),i=zO(t,/Last failed gate:\s*`([^`]+)`/),o=zO(t,/Retry attempts:\s*(\d+)/),s=Rye(t);return{featureId:e,timestamp:n??r,...i?{lastFailedGate:i}:{},...o?{retryCount:Number(o)}:{},...s?{recovery:s}:{}}}function Pye(t,e){let r=UO(t,".cladding","post-mortems");if(!OH(r))return[];let n=`post-mortem-${e}-`,i=[];for(let o of xye(r))if(!(!o.startsWith(n)||!o.endsWith(".md")))try{i.push(Iye($ye(UO(r,o),"utf8"),e,o))}catch{}return i}function RH(t,e){try{let r=E_(t),n=Pye(t,e),i=OH(UO(t,".cladding","events.log.1.jsonl"));return Oye(r,n,e,{truncated:i})}catch{return}}var kye,Eye,IH=y(()=>{"use strict";Nr();kye=5,Eye=120});function D_(t,e,r){return tn(JSON.stringify({...t,needs:e,must_edit:{...t.must_edit,code:r}}))}function xa(t,e,r={}){let n=r.cwd??".",i=r.maxTokens&&r.maxTokens>0?r.maxTokens:Cye,o=e,s,a=An(t).moduleOwners.get(e);if(a&&a.size>0){let se=[...a].sort();o=se[0],se.length>1&&(s=se)}let c=fl(t,o);if("not_found"in c)return c;let l=c.focus,u=RH(n,l.id),d=a&&a.size>0?e:l.id,f=P_(t,d),p="not_found"in f?null:f.slice,m=p?p.impacted:[],h=p?p.test_refs:[],g="not_found"in f?null:{depth:f.depthUsed,stopped_by:f.stoppedBy,coverage:f.analysis.coverage===null?null:Math.round(f.analysis.coverage*100)/100,total_known_dependents:f.analysis.totalKnownDependents},b=l.acceptance_criteria??[],_=b.filter(se=>se.ears==="unwanted"||se.ears==="state").map(se=>({id:se.id,ears:String(se.ears)})),S=[...new Set(b.flatMap(se=>se.oracle_refs??[]))].sort(),x=[],w={must_edit:{id:l.id,title:l.title,status:l.status,modules:l.modules??[],acceptance_criteria:b,code:[],...s?{co_owners:s}:{}},needs:c.ancestors,breaks_if_changed:{impacted:m,regression_tests:h,...g?{radius:g}:{}},verify:{scenarios:c.scenarios,test_refs:c.test_refs,oracle_refs:S,high_risk_acs:_},guidance:{preferred_patterns:c.preferred_patterns},budget:{max_tokens:i,used_tokens:0,truncated:x}},O=[...c.ancestors];for(;O.length>Dye&&D_(w,O,[])>i;)O.pop();O.lengthi){x.push(`code: omitted ${se} (budget)`);continue}A.push(Kt),Kt.truncated&&x.push(`code: clipped ${se}`)}T>i&&x.push("must-edit exceeds budget \u2014 retained in full (focus is never dropped)");let D=(se,Ce)=>({impacted:se,regression_tests:Ce,...g?{radius:g}:{},...p?.ledger?{ledger:p.ledger}:{}}),$=(se,Ce,Kt,dr)=>{let Xt=Kt+dr>0?[`breaks: omitted ${Kt} feature(s) / ${dr} test(s)`]:[],lo={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:D(se,Ce),budget:{...w.budget,truncated:[...x,...Xt]}};return tn(JSON.stringify(lo))>i},re=m,K=h;if($(re,K,0,0)){let se=vr(t,d,{depth:1}),Ce=new Set("not_found"in se?[]:se.impacted.map(de=>de.id)),Kt=new Set("not_found"in se?[]:se.test_refs),Xt=[...m.filter(de=>Ce.has(de.id)),...m.filter(de=>!Ce.has(de.id))],lo=0;for(;Xt.length>Ce.size&&$(Xt,K,lo,0);)Xt=Xt.slice(0,-1),lo++;let $i=[...h],Xr=0;for(;$(Xt,$i,lo,Xr);){let de=-1;for(let uo=$i.length-1;uo>=0;uo--)if(!Kt.has($i[uo])){de=uo;break}if(de<0)break;$i.splice(de,1),Xr++}re=Xt,K=$i,lo+Xr>0&&x.push(`breaks: omitted ${lo} feature(s) / ${Xr} test(s)`),$(re,K,0,0)&&x.push("breaks: direct set retained in full \u2014 exceeds budget")}let xe=D(re,K),C={...w,needs:O,must_edit:{...w.must_edit,code:A},breaks_if_changed:xe},P=C;if(u){let se={...C,prior_attempts:u};tn(JSON.stringify(se))<=i?P=se:x.push("prior_attempts: omitted (budget)")}let Ir=tn(JSON.stringify(P));return{...P,budget:{max_tokens:i,used_tokens:Ir,truncated:x}}}var Cye,Dye,N_=y(()=>{"use strict";R_();C_();LO();IH();wa();Sa();Cye=3e3,Dye=3});function Yn(t){if(t.length===0)return 0;let e=[...t].sort((n,i)=>n-i),r=Math.floor(e.length/2);return e.length%2?e[r]:(e[r-1]+e[r])/2}function Nye(t,e){if(t.length===0)return 0;let r=[...t].sort((n,i)=>n-i);return r[Math.min(r.length-1,Math.floor(e/100*r.length))]}function PH(t,e,r="."){let n=An(t),i=t.features??[],o=[];for(let f of i){let p=xa(t,f.id,{cwd:r,read:e});if("not_found"in p)continue;let m=xa(t,f.id,{cwd:r,read:e,maxTokens:Number.MAX_SAFE_INTEGER}),h=P_(t,f.id),g=!("not_found"in h),b=tn(JSON.stringify(p)),_="not_found"in m?b:tn(JSON.stringify(m)),S=tn(JSON.stringify(f));for(let O of f.modules??[]){let T=e(O);T&&(S+=tn(T))}let x=(f.depends_on??[]).length,w=n.dependents.get(f.id)?.size??0;o.push({id:f.id,sliceTokens:b,structuralTokens:_,naiveTokens:S,contextRatio:S>0?b/S:1,budgetSaturated:p.budget.truncated.length>0,searchDepth:g?h.depthUsed:1,edgesResolved:x+w,stoppedBy:g?h.stoppedBy:"n/a",coverage:g?h.analysis.coverage:1,regressionTests:p.breaks_if_changed.regression_tests.length})}o.sort((f,p)=>f.id.localeCompare(p.id));let s=o.map(f=>f.contextRatio),a=f=>f.filter(p=>p.sliceTokens>0).map(p=>p.naiveTokens/p.sliceTokens),c=o.filter(f=>!f.budgetSaturated),l=o.filter(f=>f.budgetSaturated),u=o.filter(f=>f.naiveTokens>0).map(f=>f.structuralTokens/f.naiveTokens),d={};for(let f of o)d[f.stoppedBy]=(d[f.stoppedBy]??0)+1;return{featureCount:i.length,measured:o.length,context:{medianContextRatio:Math.round(Yn(s)*1e3)/1e3,medianShrinkFactor:Math.round(Yn(a(o))*10)/10,fitsCount:c.length,truncatedCount:l.length,medianShrinkFit:Math.round(Yn(a(c))*10)/10,medianShrinkTruncated:Math.round(Yn(a(l))*10)/10,medianStructuralRatio:Math.round(Yn(u)*100)/100,medianSliceTokens:Math.round(Yn(o.map(f=>f.sliceTokens))),medianNaiveTokens:Math.round(Yn(o.map(f=>f.naiveTokens)))},search:{medianDepth:Yn(o.map(f=>f.searchDepth)),p95Depth:Nye(o.map(f=>f.searchDepth),95),medianEdges:Yn(o.map(f=>f.edgesResolved)),maxEdges:o.reduce((f,p)=>Math.max(f,p.edgesResolved),0)},stability:{byStopReason:d,medianCoverage:Math.round(Yn(o.map(f=>f.coverage).filter(f=>f!==null))*100)/100,medianRegressionTests:Yn(o.map(f=>f.regressionTests))},features:o}}var pl,j_=y(()=>{"use strict";R_();LO();N_();Sa();pl="(deterministic upper bound vs the shard+all-modules baseline \u2014 not an agent-adoption measurement)"});import{appendFileSync as jye,existsSync as BO,mkdirSync as Mye,readFileSync as CH}from"node:fs";import{dirname as Fye,join as Lye}from"node:path";function HO(t){return Lye(t,zye,Uye)}function qye(t,e){return{timestamp:new Date().toISOString(),head:va(t),spec_digest:DO(t),featureCount:e.featureCount,measured:e.measured,context:e.context,search:e.search,stability:e.stability}}function DH(t,e){try{let r=qye(t,e);if(r.head===null)return{appended:!1,reason:"no_head"};let n=GO(t),i=n[n.length-1];if(i&&i.head===r.head&&i.spec_digest===r.spec_digest)return{appended:!1,reason:"deduped"};let o=HO(t),s=Fye(o);return BO(s)||Mye(s,{recursive:!0}),jye(o,`${JSON.stringify(r)} `,"utf8"),{appended:!0,reason:"appended"}}catch{return{appended:!1,reason:"error"}}}function NH(t){let e=[];for(let r of t.split(` `)){let n=r.trim();if(n.length!==0)try{let i=JSON.parse(n);i&&typeof i=="object"&&i.context&&i.search&&i.stability&&e.push(i)}catch{}}return e}function GO(t,e){let r=HO(t);if(!BO(r))return[];let n;try{n=CH(r,"utf8")}catch{return[]}let i=NH(n);return typeof e=="number"&&e>=0?i.slice(-e):i}function jH(t){let e=HO(t);if(!BO(e))return{snapshots:[],unreadable:!1};let r;try{r=CH(e,"utf8")}catch{return{snapshots:[],unreadable:!0}}let n=NH(r),i=r.trim().length>0;return{snapshots:n,unreadable:i&&n.length===0}}function Ff(t,e=0){let r=e>0?Math.round(t*10**e)/10**e:Math.round(t),n=r.toFixed(e);return r>0?`+${n}`:n}function MH(t,e=5){let r=Math.max(0,t.length-e),i=[`measure trend \xB7 last ${t.slice(r).length} of ${t.length} snapshot(s)`];for(let o=r;o0?t[o-1]:null,c=(d,f=0)=>a?` (${Ff(d(s)-d(a),f)})`:"",l=s.timestamp.slice(0,19),u=s.head?s.head.slice(0,7):"nogit";i.push(` ${l} ${u} \xB7 ${s.featureCount} feat \xB7 slice ${s.context.medianSliceTokens}${c(d=>d.context.medianSliceTokens)} \xB7 struct ${s.context.medianStructuralRatio.toFixed(2)}${c(d=>d.context.medianStructuralRatio,2)} \xB7 cov ${s.stability.medianCoverage.toFixed(2)}${c(d=>d.stability.medianCoverage,2)} \xB7 p95depth ${s.search.p95Depth}${c(d=>d.search.p95Depth)} \xB7 trunc ${s.context.truncatedCount}${c(d=>d.context.truncatedCount)}`)}return i.push(` ${pl}`),i.join(` `)}var zye,Uye,Lf=y(()=>{"use strict";Mf();j_();zye=".cladding",Uye="measure.jsonl"});import{existsSync as Bye}from"node:fs";import{join as Hye}from"node:path";function ml(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${Gye[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` @@ -246,16 +246,16 @@ ${x}`,O=`${S}: ${a}${w}`,T=e===void 0?[t[2],t[1]]:[e],A=[O,...T,...t.slice(3),r. `)].map(D=>Hf(Dl(vwe(D)))).filter(Boolean).join(` `);return{originalMessage:x,shortMessage:O,message:A}},gwe=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=ywe(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${ZV(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${pb(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},ywe=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",_we=(t,e)=>{if(t instanceof ei)return;let r=p9(t)?t.originalMessage:String(t?.message??t),n=Hf(SV(r,e));return n===""?void 0:n},bwe=t=>typeof t=="string"?t:hwe(t),vwe=t=>Array.isArray(t)?t.map(e=>Dl(KV(e))).filter(Boolean).join(` -`):KV(t),KV=t=>typeof t=="string"?t:qt(t)?K_(t):""});var Zb,jl,rp,Swe,XV,wwe,np=y(()=>{Wf();sb();Ra();YV();Zb=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>XV({command:t,escapedCommand:e,cwd:o,durationMs:vR(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),jl=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>rp({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),rp=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:S},isSync:x})=>{let{exitCode:w,signal:O,signalDescription:T}=wwe(l,u),{originalMessage:A,shortMessage:D,message:$}=JV({stdio:d,all:f,ipcOutput:p,originalError:t,signal:O,signalDescription:T,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:S,timeout:h,cwd:_}),ie=d9(t,$,x);return Object.assign(ie,Swe({error:ie,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:O,signalDescription:T,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:A,shortMessage:D})),ie},Swe=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>XV({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:vR(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),XV=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),wwe=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:pb(e);return{exitCode:r,signal:n,signalDescription:i}}});function xwe(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(QV(t*1e3)%1e3),nanoseconds:Math.trunc(QV(t*1e6)%1e3)}}function $we(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function iI(t){switch(typeof t){case"number":{if(Number.isFinite(t))return xwe(t);break}case"bigint":return $we(t)}throw new TypeError("Expected a finite number or bigint")}var QV,eW=y(()=>{QV=t=>Number.isFinite(t)?t:0});function oI(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+Awe);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&kwe(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+Ewe(d,u):f;i.push(p)}},a=iI(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%Twe):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var kwe,Ewe,Awe,Twe,tW=y(()=>{eW();kwe=t=>t===0||t===0n,Ewe=(t,e)=>e===1||e===1n?t:`${t}s`,Awe=1e-7,Twe=24n*60n*60n*1000n});var rW,nW=y(()=>{El();rW=(t,e)=>{t.failed&&Pi({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var iW,Owe,oW=y(()=>{tW();ls();El();nW();iW=(t,e)=>{$l(e)&&(rW(t,e),Owe(t,e))},Owe=(t,e)=>{let r=`(done in ${oI(t.durationMs)})`;Pi({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Ml,Vb=y(()=>{oW();Ml=(t,e,{reject:r})=>{if(iW(t,e),t.failed&&r)throw t;return t}});var cW,Rwe,Iwe,lW,uW,sW,Pwe,sI,aW,ja,dW,Cwe,Wb,fW,Dwe,Nwe,aI,pW,jwe,mW,Kb,Mwe,cI,Fwe,Lwe,hW,On,Jb,lI,gW,yW,ps,Sr=y(()=>{Da();yo();nn();cW=(t,e)=>ja(t)?"asyncGenerator":dW(t)?"generator":Wb(t)?"fileUrl":Dwe(t)?"filePath":Mwe(t)?"webStream":ri(t,{checkOpen:!1})?"native":qt(t)?"uint8Array":Fwe(t)?"asyncIterable":Lwe(t)?"iterable":cI(t)?lW({transform:t},e):Cwe(t)?Rwe(t,e):"native",Rwe=(t,e)=>QR(t.transform,{checkOpen:!1})?Iwe(t,e):cI(t.transform)?lW(t,e):Pwe(t,e),Iwe=(t,e)=>(uW(t,e,"Duplex stream"),"duplex"),lW=(t,e)=>(uW(t,e,"web TransformStream"),"webTransform"),uW=({final:t,binary:e,objectMode:r},n,i)=>{sW(t,`${n}.final`,i),sW(e,`${n}.binary`,i),sI(r,`${n}.objectMode`)},sW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},Pwe=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!aW(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(QR(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(cI(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!aW(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return sI(r,`${i}.binary`),sI(n,`${i}.objectMode`),ja(t)||ja(e)?"asyncGenerator":"generator"},sI=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},aW=t=>ja(t)||dW(t),ja=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",dW=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",Cwe=t=>Ot(t)&&(t.transform!==void 0||t.final!==void 0),Wb=t=>Object.prototype.toString.call(t)==="[object URL]",fW=t=>Wb(t)&&t.protocol!=="file:",Dwe=t=>Ot(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Nwe.has(e))&&aI(t.file),Nwe=new Set(["file","append"]),aI=t=>typeof t=="string",pW=(t,e)=>t==="native"&&typeof e=="string"&&!jwe.has(e),jwe=new Set(["ipc","ignore","inherit","overlapped","pipe"]),mW=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Kb=t=>Object.prototype.toString.call(t)==="[object WritableStream]",Mwe=t=>mW(t)||Kb(t),cI=t=>mW(t?.readable)&&Kb(t?.writable),Fwe=t=>hW(t)&&typeof t[Symbol.asyncIterator]=="function",Lwe=t=>hW(t)&&typeof t[Symbol.iterator]=="function",hW=t=>typeof t=="object"&&t!==null,On=new Set(["generator","asyncGenerator","duplex","webTransform"]),Jb=new Set(["fileUrl","filePath","fileNumber"]),lI=new Set(["fileUrl","filePath"]),gW=new Set([...lI,"webStream","nodeStream"]),yW=new Set(["webTransform","duplex"]),ps={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var uI,zwe,Uwe,_W,dI=y(()=>{Sr();uI=(t,e,r,n)=>n==="output"?zwe(t,e,r):Uwe(t,e,r),zwe=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},Uwe=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},_W=(t,e)=>{let r=t.findLast(({type:n})=>On.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var bW,qwe,Bwe,Hwe,Gwe,Zwe,Vwe,vW=y(()=>{yo();Pa();Sr();dI();bW=(t,e,r,n)=>[...t.filter(({type:i})=>!On.has(i)),...qwe(t,e,r,n)],qwe=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>On.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=Bwe({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return Vwe(o,r)},Bwe=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?Hwe({stdioItem:t,optionName:i}):e==="webTransform"?Gwe({stdioItem:t,index:r,newTransforms:n,direction:o}):Zwe({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),Hwe=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Gwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=Ot(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=uI(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},Zwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Ot(e)?e:{transform:e},d=c||on.has(o),{writableObjectMode:f,readableObjectMode:p}=uI(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Vwe=(t,e)=>e==="input"?t.reverse():t});import fI from"node:process";var SW,Wwe,Kwe,Fl,pI,wW,Jwe,Ywe,xW=y(()=>{Da();Sr();SW=(t,e,r)=>{let n=t.map(i=>Wwe(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Ywe},Wwe=({type:t,value:e},r)=>Kwe[r]??wW[t](e),Kwe=["input","output","output"],Fl=()=>{},pI=()=>"input",wW={generator:Fl,asyncGenerator:Fl,fileUrl:Fl,filePath:Fl,iterable:pI,asyncIterable:pI,uint8Array:pI,webStream:t=>Kb(t)?"output":"input",nodeStream(t){return Ca(t,{checkOpen:!1})?XR(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Fl,duplex:Fl,native(t){let e=Jwe(t);if(e!==void 0)return e;if(ri(t,{checkOpen:!1}))return wW.nodeStream(t)}},Jwe=t=>{if([0,fI.stdin].includes(t))return"input";if([1,2,fI.stdout,fI.stderr].includes(t))return"output"},Ywe="output"});var $W,kW=y(()=>{$W=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var EW,Xwe,Qwe,AW,exe,txe,TW=y(()=>{bo();kW();ls();EW=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Xwe(t,n).map((a,c)=>AW(a,c));return o?exe(s,r,i):$W(s,e)},Xwe=(t,e)=>{if(t===void 0)return Tn.map(n=>e[n]);if(Qwe(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Tn.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,Tn.length);return Array.from({length:r},(n,i)=>t[i])},Qwe=t=>Tn.some(e=>t[e]!==void 0),AW=(t,e)=>Array.isArray(t)?t.map(r=>AW(r,e)):t??(e>=Tn.length?"ignore":"pipe"),exe=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!kl(r,i)&&txe(n)?"ignore":n),txe=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as rxe}from"node:fs";import nxe from"node:tty";var RW,ixe,oxe,sxe,axe,OW,IW=y(()=>{Da();bo();nn();ds();RW=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?ixe({stdioItem:t,fdNumber:n,direction:i}):axe({stdioItem:t,fdNumber:n}),ixe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=oxe({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(ri(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},oxe=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=sxe(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(nxe.isatty(i))throw new TypeError(`The \`${e}: ${yb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:_o(rxe(i)),optionName:e}}},sxe=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=J_.indexOf(t);if(r!==-1)return r},axe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:OW(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:OW(e,e,r),optionName:r}:ri(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,OW=(t,e,r)=>{let n=J_[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var PW,cxe,lxe,uxe,dxe,CW=y(()=>{Da();nn();Sr();PW=({input:t,inputFile:e},r)=>r===0?[...cxe(t),...uxe(e)]:[],cxe=t=>t===void 0?[]:[{type:lxe(t),value:t,optionName:"input"}],lxe=t=>{if(Ca(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(qt(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},uxe=t=>t===void 0?[]:[{...dxe(t),optionName:"inputFile"}],dxe=t=>{if(Wb(t))return{type:"fileUrl",value:t};if(aI(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var DW,NW,fxe,pxe,jW,mxe,hxe,MW,FW=y(()=>{Sr();DW=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),NW=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=fxe(i,t);if(s.length!==0){if(o){pxe({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(gW.has(t))return jW({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});yW.has(t)&&hxe({otherStdioItems:s,type:t,value:e,optionName:r})}},fxe=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),pxe=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{lI.has(e)&&jW({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},jW=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>mxe(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return MW(s,n,e),i==="output"?o[0].stream:void 0},mxe=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,hxe=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);MW(i,n,e)},MW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${ps[r]} that is the same.`)}});var Yb,gxe,yxe,_xe,bxe,vxe,Sxe,wxe,xxe,$xe,kxe,Exe,mI,Axe,Xb=y(()=>{bo();vW();dI();Sr();xW();TW();IW();CW();FW();Yb=(t,e,r,n)=>{let o=EW(e,r,n).map((a,c)=>gxe({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=$xe({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>Axe(a)),s},gxe=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=Y_(e),{stdioItems:o,isStdioArray:s}=yxe({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=SW(o,e,i),c=o.map(d=>RW({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=bW(c,i,a,r),u=_W(l,a);return xxe(l,u),{direction:a,objectMode:u,stdioItems:l}},yxe=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>_xe(c,n)),...PW(r,e)],s=DW(o),a=s.length>1;return bxe(s,a,n),Sxe(s),{stdioItems:s,isStdioArray:a}},_xe=(t,e)=>({type:cW(t,e),value:t,optionName:e}),bxe=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(vxe.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},vxe=new Set(["ignore","ipc"]),Sxe=t=>{for(let e of t)wxe(e)},wxe=({type:t,value:e,optionName:r})=>{if(fW(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. +`):KV(t),KV=t=>typeof t=="string"?t:qt(t)?K_(t):""});var Zb,jl,rp,Swe,XV,wwe,np=y(()=>{Wf();sb();Ra();YV();Zb=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>XV({command:t,escapedCommand:e,cwd:o,durationMs:vR(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),jl=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>rp({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),rp=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:S},isSync:x})=>{let{exitCode:w,signal:O,signalDescription:T}=wwe(l,u),{originalMessage:A,shortMessage:D,message:$}=JV({stdio:d,all:f,ipcOutput:p,originalError:t,signal:O,signalDescription:T,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:S,timeout:h,cwd:_}),re=d9(t,$,x);return Object.assign(re,Swe({error:re,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:O,signalDescription:T,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:A,shortMessage:D})),re},Swe=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>XV({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:vR(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),XV=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),wwe=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:pb(e);return{exitCode:r,signal:n,signalDescription:i}}});function xwe(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(QV(t*1e3)%1e3),nanoseconds:Math.trunc(QV(t*1e6)%1e3)}}function $we(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function iI(t){switch(typeof t){case"number":{if(Number.isFinite(t))return xwe(t);break}case"bigint":return $we(t)}throw new TypeError("Expected a finite number or bigint")}var QV,eW=y(()=>{QV=t=>Number.isFinite(t)?t:0});function oI(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+Awe);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&kwe(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+Ewe(d,u):f;i.push(p)}},a=iI(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%Twe):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var kwe,Ewe,Awe,Twe,tW=y(()=>{eW();kwe=t=>t===0||t===0n,Ewe=(t,e)=>e===1||e===1n?t:`${t}s`,Awe=1e-7,Twe=24n*60n*60n*1000n});var rW,nW=y(()=>{El();rW=(t,e)=>{t.failed&&Pi({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var iW,Owe,oW=y(()=>{tW();ls();El();nW();iW=(t,e)=>{$l(e)&&(rW(t,e),Owe(t,e))},Owe=(t,e)=>{let r=`(done in ${oI(t.durationMs)})`;Pi({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Ml,Vb=y(()=>{oW();Ml=(t,e,{reject:r})=>{if(iW(t,e),t.failed&&r)throw t;return t}});var cW,Rwe,Iwe,lW,uW,sW,Pwe,sI,aW,ja,dW,Cwe,Wb,fW,Dwe,Nwe,aI,pW,jwe,mW,Kb,Mwe,cI,Fwe,Lwe,hW,On,Jb,lI,gW,yW,ps,Sr=y(()=>{Da();yo();nn();cW=(t,e)=>ja(t)?"asyncGenerator":dW(t)?"generator":Wb(t)?"fileUrl":Dwe(t)?"filePath":Mwe(t)?"webStream":ri(t,{checkOpen:!1})?"native":qt(t)?"uint8Array":Fwe(t)?"asyncIterable":Lwe(t)?"iterable":cI(t)?lW({transform:t},e):Cwe(t)?Rwe(t,e):"native",Rwe=(t,e)=>QR(t.transform,{checkOpen:!1})?Iwe(t,e):cI(t.transform)?lW(t,e):Pwe(t,e),Iwe=(t,e)=>(uW(t,e,"Duplex stream"),"duplex"),lW=(t,e)=>(uW(t,e,"web TransformStream"),"webTransform"),uW=({final:t,binary:e,objectMode:r},n,i)=>{sW(t,`${n}.final`,i),sW(e,`${n}.binary`,i),sI(r,`${n}.objectMode`)},sW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},Pwe=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!aW(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(QR(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(cI(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!aW(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return sI(r,`${i}.binary`),sI(n,`${i}.objectMode`),ja(t)||ja(e)?"asyncGenerator":"generator"},sI=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},aW=t=>ja(t)||dW(t),ja=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",dW=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",Cwe=t=>Ot(t)&&(t.transform!==void 0||t.final!==void 0),Wb=t=>Object.prototype.toString.call(t)==="[object URL]",fW=t=>Wb(t)&&t.protocol!=="file:",Dwe=t=>Ot(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Nwe.has(e))&&aI(t.file),Nwe=new Set(["file","append"]),aI=t=>typeof t=="string",pW=(t,e)=>t==="native"&&typeof e=="string"&&!jwe.has(e),jwe=new Set(["ipc","ignore","inherit","overlapped","pipe"]),mW=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Kb=t=>Object.prototype.toString.call(t)==="[object WritableStream]",Mwe=t=>mW(t)||Kb(t),cI=t=>mW(t?.readable)&&Kb(t?.writable),Fwe=t=>hW(t)&&typeof t[Symbol.asyncIterator]=="function",Lwe=t=>hW(t)&&typeof t[Symbol.iterator]=="function",hW=t=>typeof t=="object"&&t!==null,On=new Set(["generator","asyncGenerator","duplex","webTransform"]),Jb=new Set(["fileUrl","filePath","fileNumber"]),lI=new Set(["fileUrl","filePath"]),gW=new Set([...lI,"webStream","nodeStream"]),yW=new Set(["webTransform","duplex"]),ps={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var uI,zwe,Uwe,_W,dI=y(()=>{Sr();uI=(t,e,r,n)=>n==="output"?zwe(t,e,r):Uwe(t,e,r),zwe=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},Uwe=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},_W=(t,e)=>{let r=t.findLast(({type:n})=>On.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var bW,qwe,Bwe,Hwe,Gwe,Zwe,Vwe,vW=y(()=>{yo();Pa();Sr();dI();bW=(t,e,r,n)=>[...t.filter(({type:i})=>!On.has(i)),...qwe(t,e,r,n)],qwe=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>On.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=Bwe({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return Vwe(o,r)},Bwe=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?Hwe({stdioItem:t,optionName:i}):e==="webTransform"?Gwe({stdioItem:t,index:r,newTransforms:n,direction:o}):Zwe({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),Hwe=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Gwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=Ot(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=uI(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},Zwe=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Ot(e)?e:{transform:e},d=c||on.has(o),{writableObjectMode:f,readableObjectMode:p}=uI(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Vwe=(t,e)=>e==="input"?t.reverse():t});import fI from"node:process";var SW,Wwe,Kwe,Fl,pI,wW,Jwe,Ywe,xW=y(()=>{Da();Sr();SW=(t,e,r)=>{let n=t.map(i=>Wwe(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Ywe},Wwe=({type:t,value:e},r)=>Kwe[r]??wW[t](e),Kwe=["input","output","output"],Fl=()=>{},pI=()=>"input",wW={generator:Fl,asyncGenerator:Fl,fileUrl:Fl,filePath:Fl,iterable:pI,asyncIterable:pI,uint8Array:pI,webStream:t=>Kb(t)?"output":"input",nodeStream(t){return Ca(t,{checkOpen:!1})?XR(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Fl,duplex:Fl,native(t){let e=Jwe(t);if(e!==void 0)return e;if(ri(t,{checkOpen:!1}))return wW.nodeStream(t)}},Jwe=t=>{if([0,fI.stdin].includes(t))return"input";if([1,2,fI.stdout,fI.stderr].includes(t))return"output"},Ywe="output"});var $W,kW=y(()=>{$W=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var EW,Xwe,Qwe,AW,exe,txe,TW=y(()=>{bo();kW();ls();EW=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Xwe(t,n).map((a,c)=>AW(a,c));return o?exe(s,r,i):$W(s,e)},Xwe=(t,e)=>{if(t===void 0)return Tn.map(n=>e[n]);if(Qwe(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Tn.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,Tn.length);return Array.from({length:r},(n,i)=>t[i])},Qwe=t=>Tn.some(e=>t[e]!==void 0),AW=(t,e)=>Array.isArray(t)?t.map(r=>AW(r,e)):t??(e>=Tn.length?"ignore":"pipe"),exe=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!kl(r,i)&&txe(n)?"ignore":n),txe=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as rxe}from"node:fs";import nxe from"node:tty";var RW,ixe,oxe,sxe,axe,OW,IW=y(()=>{Da();bo();nn();ds();RW=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?ixe({stdioItem:t,fdNumber:n,direction:i}):axe({stdioItem:t,fdNumber:n}),ixe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=oxe({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(ri(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},oxe=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=sxe(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(nxe.isatty(i))throw new TypeError(`The \`${e}: ${yb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:_o(rxe(i)),optionName:e}}},sxe=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=J_.indexOf(t);if(r!==-1)return r},axe=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:OW(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:OW(e,e,r),optionName:r}:ri(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,OW=(t,e,r)=>{let n=J_[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var PW,cxe,lxe,uxe,dxe,CW=y(()=>{Da();nn();Sr();PW=({input:t,inputFile:e},r)=>r===0?[...cxe(t),...uxe(e)]:[],cxe=t=>t===void 0?[]:[{type:lxe(t),value:t,optionName:"input"}],lxe=t=>{if(Ca(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(qt(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},uxe=t=>t===void 0?[]:[{...dxe(t),optionName:"inputFile"}],dxe=t=>{if(Wb(t))return{type:"fileUrl",value:t};if(aI(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var DW,NW,fxe,pxe,jW,mxe,hxe,MW,FW=y(()=>{Sr();DW=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),NW=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=fxe(i,t);if(s.length!==0){if(o){pxe({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(gW.has(t))return jW({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});yW.has(t)&&hxe({otherStdioItems:s,type:t,value:e,optionName:r})}},fxe=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),pxe=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{lI.has(e)&&jW({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},jW=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>mxe(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return MW(s,n,e),i==="output"?o[0].stream:void 0},mxe=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,hxe=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);MW(i,n,e)},MW=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${ps[r]} that is the same.`)}});var Yb,gxe,yxe,_xe,bxe,vxe,Sxe,wxe,xxe,$xe,kxe,Exe,mI,Axe,Xb=y(()=>{bo();vW();dI();Sr();xW();TW();IW();CW();FW();Yb=(t,e,r,n)=>{let o=EW(e,r,n).map((a,c)=>gxe({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=$xe({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>Axe(a)),s},gxe=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=Y_(e),{stdioItems:o,isStdioArray:s}=yxe({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=SW(o,e,i),c=o.map(d=>RW({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=bW(c,i,a,r),u=_W(l,a);return xxe(l,u),{direction:a,objectMode:u,stdioItems:l}},yxe=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>_xe(c,n)),...PW(r,e)],s=DW(o),a=s.length>1;return bxe(s,a,n),Sxe(s),{stdioItems:s,isStdioArray:a}},_xe=(t,e)=>({type:cW(t,e),value:t,optionName:e}),bxe=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(vxe.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},vxe=new Set(["ignore","ipc"]),Sxe=t=>{for(let e of t)wxe(e)},wxe=({type:t,value:e,optionName:r})=>{if(fW(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(pW(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},xxe=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>Jb.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},$xe=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push(kxe({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw mI(i),o}},kxe=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>Exe({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},Exe=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=NW({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},mI=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Qn(r)&&r.destroy()},Axe=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as LW}from"node:fs";var UW,ji,Txe,qW,zW,Oxe,BW=y(()=>{nn();Xb();Sr();UW=(t,e)=>Yb(Oxe,t,e,!0),ji=({type:t,optionName:e})=>{qW(e,ps[t])},Txe=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&qW(t,`"${e}"`),{}),qW=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},zW={generator(){},asyncGenerator:ji,webStream:ji,nodeStream:ji,webTransform:ji,duplex:ji,asyncIterable:ji,native:Txe},Oxe={input:{...zW,fileUrl:({value:t})=>({contents:[_o(LW(t))]}),filePath:({value:{file:t}})=>({contents:[_o(LW(t))]}),fileNumber:ji,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...zW,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:ji,string:ji,uint8Array:ji}}});var xo,hI,ip=y(()=>{YR();xo=(t,{stripFinalNewline:e},r)=>hI(e,r)&&t!==void 0&&!Array.isArray(t)?Dl(t):t,hI=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var Qb,yI,HW,GW,Rxe,Ixe,Pxe,ZW,Cxe,gI,Dxe,Nxe,jxe,ev=y(()=>{Qb=(t,e,r,n)=>t||r?void 0:GW(e,n),yI=(t,e,r)=>r?t.flatMap(n=>HW(n,e)):HW(t,e),HW=(t,e)=>{let{transform:r,final:n}=GW(e,{});return[...r(t),...n()]},GW=(t,e)=>(e.previousChunks="",{transform:Rxe.bind(void 0,e,t),final:Pxe.bind(void 0,e)}),Rxe=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o0&&(a=gI(n,a),n=""),yield a,i=o}i!==r.length-1&&(n=gI(n,r.slice(i+1))),t.previousChunks=n},Ixe=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),Pxe=function*({previousChunks:t}){t.length>0&&(yield t)},ZW=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:Cxe.bind(void 0,n)},Cxe=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}=typeof e=="string"?Dxe:jxe;if(e.at(-1)===i){yield e;return}yield o(e,t?n:r)},gI=(t,e)=>`${t}${e}`,Dxe={windowsNewline:`\r `,unixNewline:` `,LF:` `,concatBytes:gI},Nxe=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},jxe={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Nxe}});import{Buffer as Mxe}from"node:buffer";var VW,Fxe,WW,Lxe,zxe,KW,JW=y(()=>{nn();VW=(t,e)=>t?void 0:Fxe.bind(void 0,e),Fxe=function*(t,e){if(typeof e!="string"&&!qt(e)&&!Mxe.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},WW=(t,e)=>t?Lxe.bind(void 0,e):zxe.bind(void 0,e),Lxe=function*(t,e){KW(t,e),yield e},zxe=function*(t,e){if(KW(t,e),typeof e!="string"&&!qt(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},KW=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`. Instead, \`yield\` should either be called with a value, or not be called at all. For example: - if (condition) { yield value; }`)}});import{Buffer as Uxe}from"node:buffer";import{StringDecoder as qxe}from"node:string_decoder";var tv,Bxe,Hxe,Gxe,_I=y(()=>{nn();tv=(t,e,r)=>{if(r)return;if(t)return{transform:Bxe.bind(void 0,new TextEncoder)};let n=new qxe(e);return{transform:Hxe.bind(void 0,n),final:Gxe.bind(void 0,n)}},Bxe=function*(t,e){Uxe.isBuffer(e)?yield _o(e):typeof e=="string"?yield t.encode(e):yield e},Hxe=function*(t,e){yield qt(e)?t.write(e):e},Gxe=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as YW}from"node:util";var bI,rv,XW,Zxe,QW,Vxe,e3=y(()=>{bI=YW(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),rv=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Vxe}=e[r];for await(let i of n(t))yield*rv(i,e,r+1)},XW=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Zxe(r,Number(e),t)},Zxe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*rv(n,r,e+1)},QW=YW(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Vxe=function*(t){yield t}});var vI,t3,Ma,op,Wxe,Kxe,SI=y(()=>{vI=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},t3=(t,e)=>[...e.flatMap(r=>[...Ma(r,t,0)]),...op(t)],Ma=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Kxe}=e[r];for(let i of n(t))yield*Ma(i,e,r+1)},op=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Wxe(r,Number(e),t)},Wxe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ma(n,r,e+1)},Kxe=function*(t){yield t}});import{Transform as Jxe,getDefaultHighWaterMark as r3}from"node:stream";var wI,nv,n3,iv=y(()=>{Sr();ev();JW();_I();e3();SI();wI=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=n3(t,s,o),l=ja(e),u=ja(r),d=l?bI.bind(void 0,rv,a):vI.bind(void 0,Ma),f=l||u?bI.bind(void 0,XW,a):vI.bind(void 0,op),p=l||u?QW.bind(void 0,a):void 0;return{stream:new Jxe({writableObjectMode:n,writableHighWaterMark:r3(n),readableObjectMode:i,readableHighWaterMark:r3(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},nv=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=n3(s,r,a);t=t3(c,t)}return t},n3=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:VW(n,a)},tv(r,s,n),Qb(r,o,n,c),{transform:t,final:e},{transform:WW(i,a)},ZW({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var i3,Yxe,Xxe,Qxe,e0e,o3=y(()=>{iv();nn();Sr();i3=(t,e)=>{for(let r of Yxe(t))Xxe(t,r,e)},Yxe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Xxe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ps[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>Qxe(a,n));r.input=Bf(s)},Qxe=(t,e)=>{let r=nv(t,e,"utf8",!0);return e0e(r),Bf(r)},e0e=t=>{let e=t.find(r=>typeof r!="string"&&!qt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var ov,t0e,r0e,s3,a3,n0e,c3,xI=y(()=>{Pa();Sr();El();ls();ov=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&kl(r,n)&&!on.has(e)&&t0e(n)&&(t.some(({type:i,value:o})=>i==="native"&&r0e.has(o))||t.every(({type:i})=>On.has(i))),t0e=t=>t===1||t===2,r0e=new Set(["pipe","overlapped"]),s3=async(t,e,r,n)=>{for await(let i of t)n0e(e)||c3(i,r,n)},a3=(t,e,r)=>{for(let n of t)c3(n,e,r)},n0e=t=>t._readableState.pipes.length>0,c3=(t,e,r)=>{let n=ib(t);Pi({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as i0e,appendFileSync as o0e}from"node:fs";var l3,s0e,a0e,c0e,l0e,u0e,u3=y(()=>{xI();iv();ev();nn();Sr();Na();l3=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>s0e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},s0e=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=WV(t,o,d),p=_o(f),{stdioItems:m,objectMode:h}=e[r],g=a0e([p],m,c,n),{serializedResult:b,finalResult:_=b}=c0e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});l0e({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&u0e(b,m,i),S}catch(x){return n.error=x,S}},a0e=(t,e,r,n)=>{try{return nv(t,e,r,!1)}catch(i){return n.error=i,t}},c0e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Bf(t)};let s=FG(t,r);return n[o]?{serializedResult:s,finalResult:yI(s,!i[o],e)}:{serializedResult:s}},l0e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!ov({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=yI(t,!1,s);try{a3(a,e,n)}catch(c){r.error??=c}},u0e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>Jb.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?o0e(n,t):(r.add(o),i0e(n,t))}}});var d3,f3=y(()=>{nn();ip();d3=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,xo(e,r,"all")]:Array.isArray(e)?[xo(t,r,"all"),...e]:qt(t)&&qt(e)?fR([t,e]):`${t}${e}`}});import{once as $I}from"node:events";var p3,d0e,m3,h3,f0e,kI,EI=y(()=>{Ra();p3=async(t,e)=>{let[r,n]=await d0e(t);return e.isForcefullyTerminated??=!1,[r,n]},d0e=async t=>{let[e,r]=await Promise.allSettled([$I(t,"spawn"),$I(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?m3(t):r.value},m3=async t=>{try{return await $I(t,"exit")}catch{return m3(t)}},h3=async t=>{let[e,r]=await t;if(!f0e(e,r)&&kI(e,r))throw new ei;return[e,r]},f0e=(t,e)=>t===void 0&&e===void 0,kI=(t,e)=>t!==0||e!==null});var g3,p0e,y3=y(()=>{Ra();Na();EI();g3=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=p0e(t,e,r),s=o?.code==="ETIMEDOUT",a=VV(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},p0e=(t,e,r)=>t!==void 0?t:kI(e,r)?new ei:void 0});import{spawnSync as m0e}from"node:child_process";var _3,h0e,g0e,y0e,sv,_0e,b0e,v0e,S0e,b3=y(()=>{SR();KR();JR();np();Vb();BW();ip();o3();u3();Na();f3();y3();_3=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=h0e(t,e,r),d=_0e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Ml(d,c,l)},h0e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ab(t,e,r),a=g0e(r),{file:c,commandArguments:l,options:u}=Db(t,e,a);y0e(u);let d=UW(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},g0e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,y0e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&sv("ipcInput"),t&&sv("ipc: true"),r&&sv("detached: true"),n&&sv("cancelSignal")},sv=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},_0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=b0e({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=g3(c,r),{output:m,error:h=l}=l3({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>xo(_,r,S)),b=xo(d3(m,r),r,"all");return S0e({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},b0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{i3(o,r);let a=v0e(r);return m0e(...Nb(t,e,a))}catch(a){return jl({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},v0e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Gb(e)}),S0e=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?Zb({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):rp({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as AI,on as w0e}from"node:events";var v3,x0e,$0e,k0e,E0e,S3=y(()=>{Il();Yf();Jf();v3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(Ol({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Ab(t)}),x0e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),x0e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{vb(e,i);let o=fs(t,e,r),s=new AbortController;try{return await Promise.race([$0e(o,n,s),k0e(o,r,s),E0e(o,r,s)])}catch(a){throw Rl(t),a}finally{s.abort(),Sb(e,i)}},$0e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await AI(t,"message",{signal:r});return n}for await(let[n]of w0e(t,"message",{signal:r}))if(e(n))return n},k0e=async(t,e,{signal:r})=>{await AI(t,"disconnect",{signal:r}),P9(e)},E0e=async(t,e,{signal:r})=>{let[n]=await AI(t,"strict:error",{signal:r});throw gb(n,e)}});import{once as x3,on as A0e}from"node:events";var $3,TI,T0e,O0e,R0e,w3,OI=y(()=>{Il();Yf();Jf();$3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>TI({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),TI=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{Ol({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Ab(t)}),vb(e,o);let s=fs(t,e,r),a=new AbortController,c={};return T0e(t,s,a),O0e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),R0e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},T0e=async(t,e,r)=>{try{await x3(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},O0e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await x3(t,"strict:error",{signal:r.signal});n.error=gb(i,e),r.abort()}catch{}},R0e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of A0e(r,"message",{signal:o.signal}))w3(s),yield c}catch{w3(s)}finally{o.abort(),Sb(e,a),n||Rl(t),i&&await t}},w3=({error:t})=>{if(t)throw t}});import k3 from"node:process";var E3,A3,T3,RI=y(()=>{Pb();S3();OI();kb();E3=(t,{ipc:e})=>{Object.assign(t,T3(t,!1,e))},A3=()=>{let t=k3,e=!0,r=k3.channel!==void 0;return{...T3(t,e,r),getCancelSignal:sV.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},T3=(t,e,r)=>({sendMessage:Ib.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:v3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:$3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as I0e}from"node:child_process";import{PassThrough as P0e,Readable as C0e,Writable as D0e,Duplex as N0e}from"node:stream";var O3,j0e,sp,M0e,F0e,L0e,z0e,R3=y(()=>{Xb();np();Vb();O3=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{mI(n);let a=new I0e;j0e(a,n),Object.assign(a,{readable:M0e,writable:F0e,duplex:L0e});let c=jl({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=z0e(c,s,i);return{subprocess:a,promise:l}},j0e=(t,e)=>{let r=sp(),n=sp(),i=sp(),o=Array.from({length:e.length-3},sp),s=sp(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},sp=()=>{let t=new P0e;return t.end(),t},M0e=()=>new C0e({read(){}}),F0e=()=>new D0e({write(){}}),L0e=()=>new N0e({read(){},write(){}}),z0e=async(t,e,r)=>Ml(t,e,r)});import{createReadStream as I3,createWriteStream as P3}from"node:fs";import{Buffer as U0e}from"node:buffer";import{Readable as ap,Writable as q0e,Duplex as B0e}from"node:stream";var D3,cp,C3,H0e,N3=y(()=>{iv();Xb();Sr();D3=(t,e)=>Yb(H0e,t,e,!1),cp=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ps[t]}.`)},C3={fileNumber:cp,generator:wI,asyncGenerator:wI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:B0e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},H0e={input:{...C3,fileUrl:({value:t})=>({stream:I3(t)}),filePath:({value:{file:t}})=>({stream:I3(t)}),webStream:({value:t})=>({stream:ap.fromWeb(t)}),iterable:({value:t})=>({stream:ap.from(t)}),asyncIterable:({value:t})=>({stream:ap.from(t)}),string:({value:t})=>({stream:ap.from(t)}),uint8Array:({value:t})=>({stream:ap.from(U0e.from(t))})},output:{...C3,fileUrl:({value:t})=>({stream:P3(t)}),filePath:({value:{file:t,append:e}})=>({stream:P3(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:q0e.fromWeb(t)}),iterable:cp,asyncIterable:cp,string:cp,uint8Array:cp}}});import{on as G0e,once as j3}from"node:events";import{PassThrough as Z0e,getDefaultHighWaterMark as V0e}from"node:stream";import{finished as L3}from"node:stream/promises";function Fa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)PI(i);let e=t.some(({readableObjectMode:i})=>i),r=W0e(t,e),n=new II({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var W0e,II,K0e,J0e,Y0e,PI,X0e,Q0e,e$e,t$e,r$e,z3,U3,CI,q3,n$e,av,M3,F3,cv=y(()=>{W0e=(t,e)=>{if(t.length===0)return V0e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},II=class extends Z0e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(PI(e),this.#t.has(e))return;this.#t.add(e),this.#n??=K0e(this,this.#t,this.#o);let r=X0e({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(PI(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},K0e=async(t,e,r)=>{av(t,M3);let n=new AbortController;try{await Promise.race([J0e(t,n),Y0e(t,e,r,n)])}finally{n.abort(),av(t,-M3)}},J0e=async(t,{signal:e})=>{try{await L3(t,{signal:e,cleanup:!0})}catch(r){throw z3(t,r),r}},Y0e=async(t,e,r,{signal:n})=>{for await(let[i]of G0e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},PI=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},X0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{av(t,F3);let a=new AbortController;try{await Promise.race([Q0e(o,e,a),e$e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),t$e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),av(t,-F3)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?CI(t):r$e(t))},Q0e=async(t,e,{signal:r})=>{try{await t,r.aborted||CI(e)}catch(n){r.aborted||z3(e,n)}},e$e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await L3(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;U3(s)?i.add(e):q3(t,s)}},t$e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await j3(t,i,{signal:o}),!t.readable)return j3(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},r$e=t=>{t.writable&&t.end()},z3=(t,e)=>{U3(e)?CI(t):q3(t,e)},U3=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",CI=t=>{(t.readable||t.writable)&&t.destroy()},q3=(t,e)=>{t.destroyed||(t.once("error",n$e),t.destroy(e))},n$e=()=>{},av=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},M3=2,F3=1});import{finished as B3}from"node:stream/promises";var Ll,i$e,DI,o$e,NI,lv=y(()=>{bo();Ll=(t,e)=>{t.pipe(e),i$e(t,e),o$e(t,e)},i$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await B3(t,{cleanup:!0,readable:!0,writable:!1})}catch{}DI(e)}},DI=t=>{t.writable&&t.end()},o$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await B3(e,{cleanup:!0,readable:!1,writable:!0})}catch{}NI(t)}},NI=t=>{t.readable&&t.destroy()}});var H3,s$e,a$e,c$e,l$e,u$e,G3=y(()=>{cv();bo();bb();Sr();lv();H3=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>On.has(c)))s$e(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!On.has(c)))c$e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Fa(o);Ll(s,i)}},s$e=(t,e,r,n)=>{r==="output"?Ll(t.stdio[n],e):Ll(e,t.stdio[n]);let i=a$e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},a$e=["stdin","stdout","stderr"],c$e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;l$e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},l$e=(t,{signal:e})=>{Qn(t)&&Ia(t,u$e,e)},u$e=2});var La,Z3=y(()=>{La=[];La.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&La.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&La.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var uv,jI,MI,d$e,FI,dv,f$e,LI,zI,UI,V3,rat,nat,W3=y(()=>{Z3();uv=t=>!!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",jI=Symbol.for("signal-exit emitter"),MI=globalThis,d$e=Object.defineProperty.bind(Object),FI=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(MI[jI])return MI[jI];d$e(MI,jI,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},dv=class{},f$e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),LI=class extends dv{onExit(){return()=>{}}load(){}unload(){}},zI=class extends dv{#t=UI.platform==="win32"?"SIGINT":"SIGHUP";#r=new FI;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of La)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!uv(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of La)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,La.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return uv(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&uv(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},UI=globalThis.process,{onExit:V3,load:rat,unload:nat}=f$e(uv(UI)?new zI(UI):new LI)});import{addAbortListener as p$e}from"node:events";var K3,J3=y(()=>{W3();K3=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=V3(()=>{t.kill()});p$e(n,()=>{i()})}});var X3,m$e,h$e,Y3,g$e,Q3=y(()=>{dR();sb();ds();xl();X3=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=ob(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=m$e(r,n,i),{sourceStream:d,sourceError:f}=g$e(t,l),{options:p,fileDescriptors:m}=Di.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},m$e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=h$e(t,e,...r),a=_b(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},h$e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(Y3,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||lR(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=W_(r,...n);return{destination:e(Y3)(i,o,s),pipeOptions:s}}if(Di.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Y3=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),g$e=(t,e)=>{try{return{sourceStream:Cl(t,e)}}catch(r){return{sourceError:r}}}});var tK,y$e,qI,eK,BI=y(()=>{np();lv();tK=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=y$e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw qI({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},y$e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return NI(t),n;if(e!==void 0)return DI(r),e},qI=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>jl({error:t,command:eK,escapedCommand:eK,fileDescriptors:e,options:r,startTime:n,isSync:!1}),eK="source.pipe(destination)"});var rK,nK=y(()=>{rK=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as _$e}from"node:stream/promises";var iK,b$e,v$e,S$e,fv,w$e,x$e,oK=y(()=>{cv();bb();lv();iK=(t,e,r)=>{let n=fv.has(e)?v$e(t,e):b$e(t,e);return Ia(t,w$e,r.signal),Ia(e,x$e,r.signal),S$e(e),n},b$e=(t,e)=>{let r=Fa([t]);return Ll(r,e),fv.set(e,r),r},v$e=(t,e)=>{let r=fv.get(e);return r.add(t),r},S$e=async t=>{try{await _$e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}fv.delete(t)},fv=new WeakMap,w$e=2,x$e=1});import{aborted as $$e}from"node:util";var sK,k$e,aK=y(()=>{BI();sK=(t,e)=>t===void 0?[]:[k$e(t,e)],k$e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await $$e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw qI({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var pv,E$e,A$e,cK=y(()=>{yo();Q3();BI();nK();oK();aK();pv=(t,...e)=>{if(Ot(e[0]))return pv.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=X3(t,...e),i=E$e({...n,destination:r});return i.pipe=pv.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},E$e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=A$e(t,i);tK({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=iK(e,o,d);return await Promise.race([rK(u),...sK(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},A$e=(t,e)=>Promise.allSettled([t,e])});import{on as T$e}from"node:events";import{getDefaultHighWaterMark as O$e}from"node:stream";var mv,R$e,HI,I$e,uK,GI,lK,P$e,C$e,hv=y(()=>{_I();ev();SI();mv=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return R$e(e,s),uK({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},R$e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},HI=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;I$e(e,s,t);let a=t.readableObjectMode&&!o;return uK({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},I$e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},uK=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=T$e(t,"data",{signal:e.signal,highWaterMark:lK,highWatermark:lK});return P$e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},GI=O$e(!0),lK=GI,P$e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=C$e({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ma(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*op(a)}},C$e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[tv(t,r,!e),Qb(t,i,!n,{})].filter(Boolean)});import{setImmediate as D$e}from"node:timers/promises";var dK,N$e,j$e,M$e,ZI,fK,VI=y(()=>{Hb();nn();xI();hv();Na();ip();dK=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=N$e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([j$e(t),d]);return}let f=hI(c,r),p=HI({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([M$e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},N$e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!ov({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=HI({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await s3(a,t,r,o)},j$e=async t=>{await D$e(),t.readableFlowing===null&&t.resume()},M$e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await zb(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await Ub(r,{maxBuffer:o})):await Bb(r,{maxBuffer:o})}catch(a){return fK(HV({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},ZI=async t=>{try{return await t}catch(e){return fK(e)}},fK=({bufferedData:t})=>jG(t)?new Uint8Array(t):t});import{finished as F$e}from"node:stream/promises";var lp,L$e,z$e,U$e,q$e,B$e,WI,gv,pK,yv=y(()=>{lp=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=L$e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],F$e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||q$e(a,e,r,n)}finally{s.abort()}},L$e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&z$e(t,r,n),n},z$e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{U$e(e,r),n.call(t,...i)}},U$e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},q$e=(t,e,r,n)=>{if(!B$e(t,e,r,n))throw t},B$e=(t,e,r,n=!0)=>r.propagating?pK(t)||gv(t):(r.propagating=!0,WI(r,e)===n?pK(t):gv(t)),WI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",gv=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",pK=t=>t?.code==="EPIPE"});var mK,KI,JI=y(()=>{VI();yv();mK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>KI({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),KI=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=lp(t,e,l);if(WI(l,e)){await u;return}let[d]=await Promise.all([dK({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var hK,gK,H$e,G$e,YI=y(()=>{cv();JI();hK=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Fa([t,e].filter(Boolean)):void 0,gK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>KI({...H$e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:G$e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),H$e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},G$e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var yK,_K,bK=y(()=>{El();ls();yK=t=>kl(t,"ipc"),_K=(t,e)=>{let r=ib(t);Pi({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var vK,SK,wK=y(()=>{Na();bK();So();OI();vK=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=yK(o),a=vo(e,"ipc"),c=vo(r,"ipc");for await(let l of TI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(GV(t,i,c),i.push(l)),s&&_K(l,o);return i},SK=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as Z$e}from"node:events";var xK,V$e,W$e,K$e,$K=y(()=>{Da();HR();NR();BR();bo();Sr();VI();wK();ZR();YI();JI();EI();yv();xK=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:b})=>{let _=p3(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=mK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=gK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),O=[],T=vK({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),A=V$e(h,t,S),D=W$e(m,S);try{return await Promise.race([Promise.all([{},h3(_),Promise.all(x),w,T,gV(t,d),...A,...D]),g,K$e(t,b),...dV(t,o,f,b),...I9({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...lV({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch($){return f.terminationReason??="other",Promise.all([{error:$},_,Promise.all(x.map(ie=>ZI(ie))),ZI(w),SK(T,O),Promise.allSettled(A),Promise.allSettled(D)])}},V$e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:lp(n,i,r)),W$e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>ri(o,{checkOpen:!1})&&!Qn(o)).map(({type:i,value:o,stream:s=o})=>lp(s,n,e,{isSameDirection:On.has(i),stopOnExit:i==="native"}))),K$e=async(t,{signal:e})=>{let[r]=await Z$e(t,"error",{signal:e});throw r}});var kK,up,zl,_v=y(()=>{Pl();kK=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),up=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Ci();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},zl=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as EK}from"node:stream/promises";var XI,AK,QI,eP,bv,vv,tP=y(()=>{yv();XI=async t=>{if(t!==void 0)try{await QI(t)}catch{}},AK=async t=>{if(t!==void 0)try{await eP(t)}catch{}},QI=async t=>{await EK(t,{cleanup:!0,readable:!1,writable:!0})},eP=async t=>{await EK(t,{cleanup:!0,readable:!0,writable:!1})},bv=async(t,e)=>{if(await t,e)throw e},vv=(t,e,r)=>{r&&!gv(r)?t.destroy(r):e&&t.destroy()}});import{Readable as J$e}from"node:stream";import{callbackify as Y$e}from"node:util";var TK,rP,nP,iP,X$e,oP,sP,OK,aP=y(()=>{Pa();ds();hv();Pl();_v();tP();TK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||on.has(r),{subprocessStdout:a,waitReadableDestroy:c}=rP(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=nP(a,s),{read:f,onStdoutDataDone:p}=iP({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new J$e({read:f,destroy:Y$e(sP.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return oP({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},rP=(t,e,r)=>{let n=Cl(t,e),i=up(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},nP=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:GI},iP=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Ci(),s=mv({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){X$e(this,s,o)},onStdoutDataDone:o}},X$e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},oP=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await eP(t),await n,await XI(i),await e,r.readable&&r.push(null)}catch(o){await XI(i),OK(r,o)}},sP=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await zl(r,e)&&(OK(t,n),await bv(e,n))},OK=(t,e)=>{vv(t,t.readable,e)}});import{Writable as Q$e}from"node:stream";import{callbackify as RK}from"node:util";var IK,cP,lP,eke,tke,uP,dP,PK,fP=y(()=>{ds();_v();tP();IK=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=cP(t,r,e),s=new Q$e({...lP(n,t,i),destroy:RK(dP.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return uP(n,s),s},cP=(t,e,r)=>{let n=_b(t,e),i=up(r,n,"writableFinal"),o=up(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},lP=(t,e,r)=>({write:eke.bind(void 0,t),final:RK(tke.bind(void 0,t,e,r))}),eke=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},tke=async(t,e,r)=>{await zl(r,e)&&(t.writable&&t.end(),await e)},uP=async(t,e,r)=>{try{await QI(t),e.writable&&e.end()}catch(n){await AK(r),PK(e,n)}},dP=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await zl(r,e),await zl(n,e)&&(PK(t,i),await bv(e,i))},PK=(t,e)=>{vv(t,t.writable,e)}});import{Duplex as rke}from"node:stream";import{callbackify as nke}from"node:util";var CK,ike,DK=y(()=>{Pa();aP();fP();CK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||on.has(r),{subprocessStdout:c,waitReadableDestroy:l}=rP(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=cP(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=nP(c,a),{read:g,onStdoutDataDone:b}=iP({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new rke({read:g,...lP(u,t,d),destroy:nke(ike.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return oP({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),uP(u,_,c),_},ike=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([sP({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),dP({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var pP,oke,NK=y(()=>{Pa();ds();hv();pP=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||on.has(e),s=Cl(t,r),a=mv({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return oke(a,s,t)},oke=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var jK,MK=y(()=>{_v();aP();fP();DK();NK();jK=(t,{encoding:e})=>{let r=kK();t.readable=TK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=IK.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=CK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=pP.bind(void 0,t,e),t[Symbol.asyncIterator]=pP.bind(void 0,t,e,{})}});var FK,ske,ake,LK=y(()=>{FK=(t,e)=>{for(let[r,n]of ake){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},ske=(async()=>{})().constructor.prototype,ake=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(ske,t)])});import{setMaxListeners as cke}from"node:events";import{spawn as lke}from"node:child_process";var zK,uke,dke,fke,pke,mke,UK=y(()=>{Hb();SR();KR();ds();JR();RI();np();Vb();R3();N3();ip();G3();mb();J3();cK();YI();$K();MK();Pl();LK();zK=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=uke(t,e,r),{subprocess:f,promise:p}=fke({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=pv.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),FK(f,p),Di.set(f,{options:u,fileDescriptors:d}),f},uke=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ab(t,e,r),{file:a,commandArguments:c,options:l}=Db(t,e,r),u=dke(l),d=D3(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},dke=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},fke=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=lke(...Nb(t,e,r))}catch(m){return O3({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;cke(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];H3(c,a,l),K3(c,r,l);let d={},f=Ci();c.kill=O9.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=hK(c,r),jK(c,r),E3(c,r);let p=pke({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},pke=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await xK({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map((x,w)=>xo(x,e,w)),_=xo(h,e,"all"),S=mke({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Ml(S,n,e)},mke=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?rp({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Ni,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):Zb({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var Sv,hke,gke,qK=y(()=>{yo();So();Sv=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,hke(n,t[n],i)]));return{...t,...r}},hke=(t,e,r)=>gke.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,gke=new Set(["env",...gR])});var ms,yke,_ke,BK=y(()=>{yo();dR();HG();b3();UK();qK();ms=(t,e,r,n)=>{let i=(s,a,c)=>ms(s,a,r,c),o=(...s)=>yke({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},yke=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Ot(o))return i(t,Sv(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=_ke({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?_3(a,c,l):zK(a,c,l,i)},_ke=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=qG(e)?BG(e,r):[e,...r],[s,a,c]=W_(...o),l=Sv(Sv(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var HK,GK,ZK,bke,vke,VK=y(()=>{HK=({file:t,commandArguments:e})=>ZK(t,e),GK=({file:t,commandArguments:e})=>({...ZK(t,e),isSync:!0}),ZK=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=bke(t);return{file:r,commandArguments:n}},bke=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(vke)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},vke=/ +/g});var WK,KK,Ske,JK,wke,YK,XK=y(()=>{WK=(t,e,r)=>{t.sync=e(Ske,r),t.s=t.sync},KK=({options:t})=>JK(t),Ske=({options:t})=>({...JK(t),isSync:!0}),JK=t=>({options:{...wke(t),...t}}),wke=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},YK={preferLocal:!0}});var Zlt,We,Vlt,Wlt,Klt,Jlt,Ylt,Xlt,Qlt,eut,Mr=y(()=>{BK();VK();GR();XK();RI();Zlt=ms(()=>({})),We=ms(()=>({isSync:!0})),Vlt=ms(HK),Wlt=ms(GK),Klt=ms(pV),Jlt=ms(KK,{},YK,WK),{sendMessage:Ylt,getOneMessage:Xlt,getEachMessage:Qlt,getCancelSignal:eut}=A3()});import{existsSync as wv,statSync as xke}from"node:fs";import{dirname as mP,extname as $ke,isAbsolute as QK,join as hP,relative as gP,resolve as xv,sep as kke}from"node:path";function $v(t){return t==="./gradlew"||t==="gradle"}function Eke(t){return(wv(hP(t,"build.gradle.kts"))||wv(hP(t,"build.gradle")))&&wv(hP(t,"gradle.properties"))}function Ake(t,e){let n=gP(t,e).split(kke).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function hs(t,e){return t===":"?`:${e}`:`${t}:${e}`}function Tke(t,e){let r=xv(t,e),n=r;wv(r)?xke(r).isFile()&&(n=mP(r)):$ke(r)!==""&&(n=mP(r));let i=gP(t,n);if(i.startsWith("..")||QK(i))return null;let o=n;for(;;){if(Eke(o))return o;if(xv(o)===xv(t))return null;let s=mP(o);if(s===o)return null;let a=gP(t,s);if(a.startsWith("..")||QK(a))return null;o=s}}function kv(t,e){let r=xv(t),n=new Map,i=[];for(let o of e){let s=Tke(r,o);if(!s){i.push(o);continue}let a=Ake(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var Ev=y(()=>{"use strict"});import{existsSync as _P,readFileSync as Oke}from"node:fs";import{join as Ul}from"node:path";function ql(t="."){let e=Ul(t,".cladding","config.yaml");if(!_P(e))return yP;try{let n=(0,eJ.parse)(Oke(e,"utf8"))?.gate;if(!n)return yP;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of Rke){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return yP}}function tJ(t="."){let e=ql(t).testReport,r=e?[e,...bP]:bP;return[...new Set(r.map(n=>Ul(t,n)))]}function rJ(t="."){let e=ql(t).testReport;if(e){let r=Ul(t,e);return _P(r)?r:null}return bP.map(r=>Ul(t,r)).find(r=>_P(r))??null}function nJ(t,e){let r=[],n=!1;for(let i of t){let o=Ike.exec(i);if(o){n=!0;for(let s of e)r.push(hs(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var eJ,Rke,yP,bP,Ike,dp=y(()=>{"use strict";eJ=St(er(),1);Ev();Rke=["type","lint","test","coverage"],yP={scope:"feature"},bP=["test-report.junit.xml",Ul("coverage","junit.xml"),Ul(".cladding","test-report.junit.xml")];Ike=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as SP,readFileSync as iJ,readdirSync as Pke,statSync as Cke}from"node:fs";import{join as Av}from"node:path";function $P(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=Av(t,e);if(SP(r))try{if(oJ.test(iJ(r,"utf8")))return!0}catch{}}return!1}function sJ(t){try{return SP(t)&&oJ.test(iJ(t,"utf8"))}catch{return!1}}function aJ(t,e=0){if(e>4||!SP(t))return!1;let r;try{r=Pke(t)}catch{return!1}for(let n of r){let i=Av(t,n),o=!1;try{o=Cke(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(aJ(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&sJ(i))return!0}return!1}function jke(t){if($P(t))return!0;for(let e of Dke)if(sJ(Av(t,e)))return!0;for(let e of Nke)if(aJ(Av(t,e)))return!0;return!1}function cJ(t="."){let e=ql(t).coverage;return e||(jke(t)?"kover":"jacoco")}function lJ(t="."){return wP[cJ(t)]}function uJ(t="."){return vP[cJ(t)]}var wP,vP,xP,oJ,Dke,Nke,Tv=y(()=>{"use strict";dp();wP={kover:"koverXmlReport",jacoco:"jacocoTestReport"},vP={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},xP=[vP.kover,vP.jacoco],oJ=/kover/i;Dke=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],Nke=["buildSrc","build-logic"]});import{existsSync as pp,readFileSync as fJ,readdirSync as pJ}from"node:fs";import{join as gs}from"node:path";function EP(t){return pp(gs(t,"gradlew"))?"./gradlew":"gradle"}function Mke(t){let e=EP(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[lJ(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function Fke(t){let e=!1;try{e=/(^|\n)\s*flutter\s*:|sdk:\s*flutter/.test(fJ(gs(t,"pubspec.yaml"),"utf8"))}catch{}let r={cmd:"dart",args:["format","--output=none","--set-exit-if-changed","."]},n={cmd:"gitleaks",args:["detect","--no-banner"]};return e?{type:{cmd:"flutter",args:["analyze"]},lint:r,test:{cmd:"flutter",args:["test"]},coverage:{cmd:"flutter",args:["test","--coverage"]},secret:n}:{type:{cmd:"dart",args:["analyze"]},lint:r,test:{cmd:"dart",args:["test"]},coverage:{cmd:"dart",args:["test","--coverage=coverage"]},secret:n}}function zke(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function Bke(t,e){for(let r of e)if(pp(gs(t,r)))return r}function Hke(t,e){try{return pJ(t).find(n=>n.endsWith(e))}catch{return}}function Vke(t){try{return JSON.parse(fJ(gs(t,"package.json"),"utf8"))}catch{return{}}}function fp(t,e){let r=t.scripts?.[e];return typeof r=="string"&&r.trim().length>0?r.trim():void 0}function dJ(t,e){return[t.dependencies,t.devDependencies,t.optionalDependencies,t.peerDependencies].some(r=>r?.[e]!==void 0)}function Wke(t,e,r){if(fp(r,"lint"))return{cmd:"npm",args:["run","--silent","lint"]};for(let n of Gke)if(n.configs.some(i=>pp(gs(t,i))))return n.gate;if(Zke.some(n=>pp(gs(t,n)))||r.eslintConfig!==void 0)return e}function Jke(t,e){return Kke.some(r=>pp(gs(t,r)))?!0:e.jest!==void 0}function Yke(t){if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?vitest(?:\s+run)?$/i.test(t))return"vitest";if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?jest$/i.test(t))return"jest"}function kP(t,e){let r={...t};return e==="lint"?delete r.lint:delete r.coverage,r}function Xke(t,e){let r=Vke(t),n=e.lint?Wke(t,e.lint,r):void 0,i=n?{...e,lint:n}:kP(e,"lint"),o=fp(r,"test"),s=o?Yke(o):void 0;return o&&!s?(i=kP(i,"coverage"),{...i,test:{cmd:"npm",args:["test"]},...fp(r,"coverage")?{coverage:{cmd:"npm",args:["run","--silent","coverage"]}}:{}}):s==="jest"||!o&&Jke(t,r)?{...i,test:{cmd:"npx",args:[...Mi,"jest"]},coverage:{cmd:"npx",args:[...Mi,"jest","--coverage"]}}:(s==="vitest"&&!fp(r,"coverage")&&!dJ(r,"@vitest/coverage-v8")&&!dJ(r,"@vitest/coverage-istanbul")?i=kP(i,"coverage"):s==="vitest"&&fp(r,"coverage")&&(i={...i,coverage:{cmd:"npm",args:["run","--silent","coverage"]}}),i)}function dt(t="."){for(let e of Uke){let r;for(let o of e.manifests)if(o.startsWith(".")?r=Hke(t,o):r=Bke(t,[o]),r)break;if(!r||e.requiresSource&&!zke(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"?Xke(t,n):n;return{language:e.language,manifest:r,gates:i}}return qke}var Mi,Lke,Uke,qke,Gke,Zke,Kke,sn=y(()=>{"use strict";Tv();Mi=["--offline","--no-install"];Lke=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);Uke=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:[...Mi,"tsc","--noEmit"]},lint:{cmd:"npx",args:[...Mi,"eslint","."]},test:{cmd:"npx",args:[...Mi,"vitest","run"]},coverage:{cmd:"npx",args:[...Mi,"vitest","run","--coverage"]},secret:{cmd:"npx",args:[...Mi,"secretlint","**/*"]},arch:{cmd:"npx",args:[...Mi,"madge","--circular","--extensions","ts,tsx,js,jsx","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:Mke},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"swift",manifests:["Package.swift"],gates:{type:{cmd:"swift",args:["build"]},lint:{cmd:"swiftlint",args:["lint"]},test:{cmd:"swift",args:["test"]},coverage:{cmd:"swift",args:["test","--enable-code-coverage"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dart",manifests:["pubspec.yaml"],gates:Fke}],qke={language:"unknown",manifest:"",gates:{}};Gke=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:[...Mi,"biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:[...Mi,"oxlint"]}}],Zke=["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts",".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"];Kke=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs","jest.config.json"]});import{existsSync as Qke,readFileSync as eEe}from"node:fs";import{join as tEe}from"node:path";function za(t){return t.code==="ENOENT"}function Ov(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return mJ.test(o)||mJ.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function Nt(t,e,r,n=[]){if(za(r))return{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`};let i=`${String(r.stderr??"")} + if (condition) { yield value; }`)}});import{Buffer as Uxe}from"node:buffer";import{StringDecoder as qxe}from"node:string_decoder";var tv,Bxe,Hxe,Gxe,_I=y(()=>{nn();tv=(t,e,r)=>{if(r)return;if(t)return{transform:Bxe.bind(void 0,new TextEncoder)};let n=new qxe(e);return{transform:Hxe.bind(void 0,n),final:Gxe.bind(void 0,n)}},Bxe=function*(t,e){Uxe.isBuffer(e)?yield _o(e):typeof e=="string"?yield t.encode(e):yield e},Hxe=function*(t,e){yield qt(e)?t.write(e):e},Gxe=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as YW}from"node:util";var bI,rv,XW,Zxe,QW,Vxe,e3=y(()=>{bI=YW(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),rv=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Vxe}=e[r];for await(let i of n(t))yield*rv(i,e,r+1)},XW=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Zxe(r,Number(e),t)},Zxe=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*rv(n,r,e+1)},QW=YW(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Vxe=function*(t){yield t}});var vI,t3,Ma,op,Wxe,Kxe,SI=y(()=>{vI=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},t3=(t,e)=>[...e.flatMap(r=>[...Ma(r,t,0)]),...op(t)],Ma=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Kxe}=e[r];for(let i of n(t))yield*Ma(i,e,r+1)},op=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Wxe(r,Number(e),t)},Wxe=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ma(n,r,e+1)},Kxe=function*(t){yield t}});import{Transform as Jxe,getDefaultHighWaterMark as r3}from"node:stream";var wI,nv,n3,iv=y(()=>{Sr();ev();JW();_I();e3();SI();wI=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=n3(t,s,o),l=ja(e),u=ja(r),d=l?bI.bind(void 0,rv,a):vI.bind(void 0,Ma),f=l||u?bI.bind(void 0,XW,a):vI.bind(void 0,op),p=l||u?QW.bind(void 0,a):void 0;return{stream:new Jxe({writableObjectMode:n,writableHighWaterMark:r3(n),readableObjectMode:i,readableHighWaterMark:r3(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},nv=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=n3(s,r,a);t=t3(c,t)}return t},n3=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:VW(n,a)},tv(r,s,n),Qb(r,o,n,c),{transform:t,final:e},{transform:WW(i,a)},ZW({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var i3,Yxe,Xxe,Qxe,e0e,o3=y(()=>{iv();nn();Sr();i3=(t,e)=>{for(let r of Yxe(t))Xxe(t,r,e)},Yxe=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Xxe=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ps[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>Qxe(a,n));r.input=Bf(s)},Qxe=(t,e)=>{let r=nv(t,e,"utf8",!0);return e0e(r),Bf(r)},e0e=t=>{let e=t.find(r=>typeof r!="string"&&!qt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var ov,t0e,r0e,s3,a3,n0e,c3,xI=y(()=>{Pa();Sr();El();ls();ov=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&kl(r,n)&&!on.has(e)&&t0e(n)&&(t.some(({type:i,value:o})=>i==="native"&&r0e.has(o))||t.every(({type:i})=>On.has(i))),t0e=t=>t===1||t===2,r0e=new Set(["pipe","overlapped"]),s3=async(t,e,r,n)=>{for await(let i of t)n0e(e)||c3(i,r,n)},a3=(t,e,r)=>{for(let n of t)c3(n,e,r)},n0e=t=>t._readableState.pipes.length>0,c3=(t,e,r)=>{let n=ib(t);Pi({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as i0e,appendFileSync as o0e}from"node:fs";var l3,s0e,a0e,c0e,l0e,u0e,u3=y(()=>{xI();iv();ev();nn();Sr();Na();l3=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>s0e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},s0e=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=WV(t,o,d),p=_o(f),{stdioItems:m,objectMode:h}=e[r],g=a0e([p],m,c,n),{serializedResult:b,finalResult:_=b}=c0e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});l0e({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&u0e(b,m,i),S}catch(x){return n.error=x,S}},a0e=(t,e,r,n)=>{try{return nv(t,e,r,!1)}catch(i){return n.error=i,t}},c0e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Bf(t)};let s=FG(t,r);return n[o]?{serializedResult:s,finalResult:yI(s,!i[o],e)}:{serializedResult:s}},l0e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!ov({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=yI(t,!1,s);try{a3(a,e,n)}catch(c){r.error??=c}},u0e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>Jb.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?o0e(n,t):(r.add(o),i0e(n,t))}}});var d3,f3=y(()=>{nn();ip();d3=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,xo(e,r,"all")]:Array.isArray(e)?[xo(t,r,"all"),...e]:qt(t)&&qt(e)?fR([t,e]):`${t}${e}`}});import{once as $I}from"node:events";var p3,d0e,m3,h3,f0e,kI,EI=y(()=>{Ra();p3=async(t,e)=>{let[r,n]=await d0e(t);return e.isForcefullyTerminated??=!1,[r,n]},d0e=async t=>{let[e,r]=await Promise.allSettled([$I(t,"spawn"),$I(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?m3(t):r.value},m3=async t=>{try{return await $I(t,"exit")}catch{return m3(t)}},h3=async t=>{let[e,r]=await t;if(!f0e(e,r)&&kI(e,r))throw new ei;return[e,r]},f0e=(t,e)=>t===void 0&&e===void 0,kI=(t,e)=>t!==0||e!==null});var g3,p0e,y3=y(()=>{Ra();Na();EI();g3=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=p0e(t,e,r),s=o?.code==="ETIMEDOUT",a=VV(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},p0e=(t,e,r)=>t!==void 0?t:kI(e,r)?new ei:void 0});import{spawnSync as m0e}from"node:child_process";var _3,h0e,g0e,y0e,sv,_0e,b0e,v0e,S0e,b3=y(()=>{SR();KR();JR();np();Vb();BW();ip();o3();u3();Na();f3();y3();_3=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=h0e(t,e,r),d=_0e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Ml(d,c,l)},h0e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ab(t,e,r),a=g0e(r),{file:c,commandArguments:l,options:u}=Db(t,e,a);y0e(u);let d=UW(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},g0e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,y0e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&sv("ipcInput"),t&&sv("ipc: true"),r&&sv("detached: true"),n&&sv("cancelSignal")},sv=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},_0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=b0e({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=g3(c,r),{output:m,error:h=l}=l3({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>xo(_,r,S)),b=xo(d3(m,r),r,"all");return S0e({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},b0e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{i3(o,r);let a=v0e(r);return m0e(...Nb(t,e,a))}catch(a){return jl({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},v0e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Gb(e)}),S0e=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?Zb({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):rp({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as AI,on as w0e}from"node:events";var v3,x0e,$0e,k0e,E0e,S3=y(()=>{Il();Yf();Jf();v3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(Ol({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Ab(t)}),x0e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),x0e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{vb(e,i);let o=fs(t,e,r),s=new AbortController;try{return await Promise.race([$0e(o,n,s),k0e(o,r,s),E0e(o,r,s)])}catch(a){throw Rl(t),a}finally{s.abort(),Sb(e,i)}},$0e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await AI(t,"message",{signal:r});return n}for await(let[n]of w0e(t,"message",{signal:r}))if(e(n))return n},k0e=async(t,e,{signal:r})=>{await AI(t,"disconnect",{signal:r}),P9(e)},E0e=async(t,e,{signal:r})=>{let[n]=await AI(t,"strict:error",{signal:r});throw gb(n,e)}});import{once as x3,on as A0e}from"node:events";var $3,TI,T0e,O0e,R0e,w3,OI=y(()=>{Il();Yf();Jf();$3=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>TI({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),TI=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{Ol({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Ab(t)}),vb(e,o);let s=fs(t,e,r),a=new AbortController,c={};return T0e(t,s,a),O0e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),R0e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},T0e=async(t,e,r)=>{try{await x3(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},O0e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await x3(t,"strict:error",{signal:r.signal});n.error=gb(i,e),r.abort()}catch{}},R0e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of A0e(r,"message",{signal:o.signal}))w3(s),yield c}catch{w3(s)}finally{o.abort(),Sb(e,a),n||Rl(t),i&&await t}},w3=({error:t})=>{if(t)throw t}});import k3 from"node:process";var E3,A3,T3,RI=y(()=>{Pb();S3();OI();kb();E3=(t,{ipc:e})=>{Object.assign(t,T3(t,!1,e))},A3=()=>{let t=k3,e=!0,r=k3.channel!==void 0;return{...T3(t,e,r),getCancelSignal:sV.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},T3=(t,e,r)=>({sendMessage:Ib.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:v3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:$3.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as I0e}from"node:child_process";import{PassThrough as P0e,Readable as C0e,Writable as D0e,Duplex as N0e}from"node:stream";var O3,j0e,sp,M0e,F0e,L0e,z0e,R3=y(()=>{Xb();np();Vb();O3=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{mI(n);let a=new I0e;j0e(a,n),Object.assign(a,{readable:M0e,writable:F0e,duplex:L0e});let c=jl({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=z0e(c,s,i);return{subprocess:a,promise:l}},j0e=(t,e)=>{let r=sp(),n=sp(),i=sp(),o=Array.from({length:e.length-3},sp),s=sp(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},sp=()=>{let t=new P0e;return t.end(),t},M0e=()=>new C0e({read(){}}),F0e=()=>new D0e({write(){}}),L0e=()=>new N0e({read(){},write(){}}),z0e=async(t,e,r)=>Ml(t,e,r)});import{createReadStream as I3,createWriteStream as P3}from"node:fs";import{Buffer as U0e}from"node:buffer";import{Readable as ap,Writable as q0e,Duplex as B0e}from"node:stream";var D3,cp,C3,H0e,N3=y(()=>{iv();Xb();Sr();D3=(t,e)=>Yb(H0e,t,e,!1),cp=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ps[t]}.`)},C3={fileNumber:cp,generator:wI,asyncGenerator:wI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:B0e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},H0e={input:{...C3,fileUrl:({value:t})=>({stream:I3(t)}),filePath:({value:{file:t}})=>({stream:I3(t)}),webStream:({value:t})=>({stream:ap.fromWeb(t)}),iterable:({value:t})=>({stream:ap.from(t)}),asyncIterable:({value:t})=>({stream:ap.from(t)}),string:({value:t})=>({stream:ap.from(t)}),uint8Array:({value:t})=>({stream:ap.from(U0e.from(t))})},output:{...C3,fileUrl:({value:t})=>({stream:P3(t)}),filePath:({value:{file:t,append:e}})=>({stream:P3(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:q0e.fromWeb(t)}),iterable:cp,asyncIterable:cp,string:cp,uint8Array:cp}}});import{on as G0e,once as j3}from"node:events";import{PassThrough as Z0e,getDefaultHighWaterMark as V0e}from"node:stream";import{finished as L3}from"node:stream/promises";function Fa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)PI(i);let e=t.some(({readableObjectMode:i})=>i),r=W0e(t,e),n=new II({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var W0e,II,K0e,J0e,Y0e,PI,X0e,Q0e,e$e,t$e,r$e,z3,U3,CI,q3,n$e,av,M3,F3,cv=y(()=>{W0e=(t,e)=>{if(t.length===0)return V0e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},II=class extends Z0e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(PI(e),this.#t.has(e))return;this.#t.add(e),this.#n??=K0e(this,this.#t,this.#o);let r=X0e({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(PI(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},K0e=async(t,e,r)=>{av(t,M3);let n=new AbortController;try{await Promise.race([J0e(t,n),Y0e(t,e,r,n)])}finally{n.abort(),av(t,-M3)}},J0e=async(t,{signal:e})=>{try{await L3(t,{signal:e,cleanup:!0})}catch(r){throw z3(t,r),r}},Y0e=async(t,e,r,{signal:n})=>{for await(let[i]of G0e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},PI=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},X0e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{av(t,F3);let a=new AbortController;try{await Promise.race([Q0e(o,e,a),e$e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),t$e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),av(t,-F3)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?CI(t):r$e(t))},Q0e=async(t,e,{signal:r})=>{try{await t,r.aborted||CI(e)}catch(n){r.aborted||z3(e,n)}},e$e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await L3(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;U3(s)?i.add(e):q3(t,s)}},t$e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await j3(t,i,{signal:o}),!t.readable)return j3(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},r$e=t=>{t.writable&&t.end()},z3=(t,e)=>{U3(e)?CI(t):q3(t,e)},U3=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",CI=t=>{(t.readable||t.writable)&&t.destroy()},q3=(t,e)=>{t.destroyed||(t.once("error",n$e),t.destroy(e))},n$e=()=>{},av=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},M3=2,F3=1});import{finished as B3}from"node:stream/promises";var Ll,i$e,DI,o$e,NI,lv=y(()=>{bo();Ll=(t,e)=>{t.pipe(e),i$e(t,e),o$e(t,e)},i$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await B3(t,{cleanup:!0,readable:!0,writable:!1})}catch{}DI(e)}},DI=t=>{t.writable&&t.end()},o$e=async(t,e)=>{if(!(Qn(t)||Qn(e))){try{await B3(e,{cleanup:!0,readable:!1,writable:!0})}catch{}NI(t)}},NI=t=>{t.readable&&t.destroy()}});var H3,s$e,a$e,c$e,l$e,u$e,G3=y(()=>{cv();bo();bb();Sr();lv();H3=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>On.has(c)))s$e(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!On.has(c)))c$e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Fa(o);Ll(s,i)}},s$e=(t,e,r,n)=>{r==="output"?Ll(t.stdio[n],e):Ll(e,t.stdio[n]);let i=a$e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},a$e=["stdin","stdout","stderr"],c$e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;l$e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},l$e=(t,{signal:e})=>{Qn(t)&&Ia(t,u$e,e)},u$e=2});var La,Z3=y(()=>{La=[];La.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&La.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&La.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var uv,jI,MI,d$e,FI,dv,f$e,LI,zI,UI,V3,rat,nat,W3=y(()=>{Z3();uv=t=>!!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",jI=Symbol.for("signal-exit emitter"),MI=globalThis,d$e=Object.defineProperty.bind(Object),FI=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(MI[jI])return MI[jI];d$e(MI,jI,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},dv=class{},f$e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),LI=class extends dv{onExit(){return()=>{}}load(){}unload(){}},zI=class extends dv{#t=UI.platform==="win32"?"SIGINT":"SIGHUP";#r=new FI;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of La)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!uv(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of La)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,La.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return uv(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&uv(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},UI=globalThis.process,{onExit:V3,load:rat,unload:nat}=f$e(uv(UI)?new zI(UI):new LI)});import{addAbortListener as p$e}from"node:events";var K3,J3=y(()=>{W3();K3=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=V3(()=>{t.kill()});p$e(n,()=>{i()})}});var X3,m$e,h$e,Y3,g$e,Q3=y(()=>{dR();sb();ds();xl();X3=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=ob(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=m$e(r,n,i),{sourceStream:d,sourceError:f}=g$e(t,l),{options:p,fileDescriptors:m}=Di.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},m$e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=h$e(t,e,...r),a=_b(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},h$e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(Y3,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||lR(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=W_(r,...n);return{destination:e(Y3)(i,o,s),pipeOptions:s}}if(Di.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Y3=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),g$e=(t,e)=>{try{return{sourceStream:Cl(t,e)}}catch(r){return{sourceError:r}}}});var tK,y$e,qI,eK,BI=y(()=>{np();lv();tK=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=y$e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw qI({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},y$e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return NI(t),n;if(e!==void 0)return DI(r),e},qI=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>jl({error:t,command:eK,escapedCommand:eK,fileDescriptors:e,options:r,startTime:n,isSync:!1}),eK="source.pipe(destination)"});var rK,nK=y(()=>{rK=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as _$e}from"node:stream/promises";var iK,b$e,v$e,S$e,fv,w$e,x$e,oK=y(()=>{cv();bb();lv();iK=(t,e,r)=>{let n=fv.has(e)?v$e(t,e):b$e(t,e);return Ia(t,w$e,r.signal),Ia(e,x$e,r.signal),S$e(e),n},b$e=(t,e)=>{let r=Fa([t]);return Ll(r,e),fv.set(e,r),r},v$e=(t,e)=>{let r=fv.get(e);return r.add(t),r},S$e=async t=>{try{await _$e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}fv.delete(t)},fv=new WeakMap,w$e=2,x$e=1});import{aborted as $$e}from"node:util";var sK,k$e,aK=y(()=>{BI();sK=(t,e)=>t===void 0?[]:[k$e(t,e)],k$e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await $$e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw qI({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var pv,E$e,A$e,cK=y(()=>{yo();Q3();BI();nK();oK();aK();pv=(t,...e)=>{if(Ot(e[0]))return pv.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=X3(t,...e),i=E$e({...n,destination:r});return i.pipe=pv.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},E$e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=A$e(t,i);tK({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=iK(e,o,d);return await Promise.race([rK(u),...sK(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},A$e=(t,e)=>Promise.allSettled([t,e])});import{on as T$e}from"node:events";import{getDefaultHighWaterMark as O$e}from"node:stream";var mv,R$e,HI,I$e,uK,GI,lK,P$e,C$e,hv=y(()=>{_I();ev();SI();mv=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return R$e(e,s),uK({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},R$e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},HI=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;I$e(e,s,t);let a=t.readableObjectMode&&!o;return uK({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},I$e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},uK=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=T$e(t,"data",{signal:e.signal,highWaterMark:lK,highWatermark:lK});return P$e({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},GI=O$e(!0),lK=GI,P$e=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=C$e({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ma(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*op(a)}},C$e=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[tv(t,r,!e),Qb(t,i,!n,{})].filter(Boolean)});import{setImmediate as D$e}from"node:timers/promises";var dK,N$e,j$e,M$e,ZI,fK,VI=y(()=>{Hb();nn();xI();hv();Na();ip();dK=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=N$e({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([j$e(t),d]);return}let f=hI(c,r),p=HI({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([M$e({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},N$e=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!ov({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=HI({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await s3(a,t,r,o)},j$e=async t=>{await D$e(),t.readableFlowing===null&&t.resume()},M$e=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await zb(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await Ub(r,{maxBuffer:o})):await Bb(r,{maxBuffer:o})}catch(a){return fK(HV({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},ZI=async t=>{try{return await t}catch(e){return fK(e)}},fK=({bufferedData:t})=>jG(t)?new Uint8Array(t):t});import{finished as F$e}from"node:stream/promises";var lp,L$e,z$e,U$e,q$e,B$e,WI,gv,pK,yv=y(()=>{lp=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=L$e(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],F$e(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||q$e(a,e,r,n)}finally{s.abort()}},L$e=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&z$e(t,r,n),n},z$e=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{U$e(e,r),n.call(t,...i)}},U$e=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},q$e=(t,e,r,n)=>{if(!B$e(t,e,r,n))throw t},B$e=(t,e,r,n=!0)=>r.propagating?pK(t)||gv(t):(r.propagating=!0,WI(r,e)===n?pK(t):gv(t)),WI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",gv=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",pK=t=>t?.code==="EPIPE"});var mK,KI,JI=y(()=>{VI();yv();mK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>KI({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),KI=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=lp(t,e,l);if(WI(l,e)){await u;return}let[d]=await Promise.all([dK({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var hK,gK,H$e,G$e,YI=y(()=>{cv();JI();hK=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Fa([t,e].filter(Boolean)):void 0,gK=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>KI({...H$e(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:G$e(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),H$e=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},G$e=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var yK,_K,bK=y(()=>{El();ls();yK=t=>kl(t,"ipc"),_K=(t,e)=>{let r=ib(t);Pi({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var vK,SK,wK=y(()=>{Na();bK();So();OI();vK=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=yK(o),a=vo(e,"ipc"),c=vo(r,"ipc");for await(let l of TI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(GV(t,i,c),i.push(l)),s&&_K(l,o);return i},SK=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as Z$e}from"node:events";var xK,V$e,W$e,K$e,$K=y(()=>{Da();HR();NR();BR();bo();Sr();VI();wK();ZR();YI();JI();EI();yv();xK=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:b})=>{let _=p3(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=mK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=gK({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),O=[],T=vK({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),A=V$e(h,t,S),D=W$e(m,S);try{return await Promise.race([Promise.all([{},h3(_),Promise.all(x),w,T,gV(t,d),...A,...D]),g,K$e(t,b),...dV(t,o,f,b),...I9({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...lV({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch($){return f.terminationReason??="other",Promise.all([{error:$},_,Promise.all(x.map(re=>ZI(re))),ZI(w),SK(T,O),Promise.allSettled(A),Promise.allSettled(D)])}},V$e=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:lp(n,i,r)),W$e=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>ri(o,{checkOpen:!1})&&!Qn(o)).map(({type:i,value:o,stream:s=o})=>lp(s,n,e,{isSameDirection:On.has(i),stopOnExit:i==="native"}))),K$e=async(t,{signal:e})=>{let[r]=await Z$e(t,"error",{signal:e});throw r}});var kK,up,zl,_v=y(()=>{Pl();kK=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),up=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Ci();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},zl=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as EK}from"node:stream/promises";var XI,AK,QI,eP,bv,vv,tP=y(()=>{yv();XI=async t=>{if(t!==void 0)try{await QI(t)}catch{}},AK=async t=>{if(t!==void 0)try{await eP(t)}catch{}},QI=async t=>{await EK(t,{cleanup:!0,readable:!1,writable:!0})},eP=async t=>{await EK(t,{cleanup:!0,readable:!0,writable:!1})},bv=async(t,e)=>{if(await t,e)throw e},vv=(t,e,r)=>{r&&!gv(r)?t.destroy(r):e&&t.destroy()}});import{Readable as J$e}from"node:stream";import{callbackify as Y$e}from"node:util";var TK,rP,nP,iP,X$e,oP,sP,OK,aP=y(()=>{Pa();ds();hv();Pl();_v();tP();TK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||on.has(r),{subprocessStdout:a,waitReadableDestroy:c}=rP(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=nP(a,s),{read:f,onStdoutDataDone:p}=iP({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new J$e({read:f,destroy:Y$e(sP.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return oP({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},rP=(t,e,r)=>{let n=Cl(t,e),i=up(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},nP=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:GI},iP=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Ci(),s=mv({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){X$e(this,s,o)},onStdoutDataDone:o}},X$e=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},oP=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await eP(t),await n,await XI(i),await e,r.readable&&r.push(null)}catch(o){await XI(i),OK(r,o)}},sP=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await zl(r,e)&&(OK(t,n),await bv(e,n))},OK=(t,e)=>{vv(t,t.readable,e)}});import{Writable as Q$e}from"node:stream";import{callbackify as RK}from"node:util";var IK,cP,lP,eke,tke,uP,dP,PK,fP=y(()=>{ds();_v();tP();IK=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=cP(t,r,e),s=new Q$e({...lP(n,t,i),destroy:RK(dP.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return uP(n,s),s},cP=(t,e,r)=>{let n=_b(t,e),i=up(r,n,"writableFinal"),o=up(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},lP=(t,e,r)=>({write:eke.bind(void 0,t),final:RK(tke.bind(void 0,t,e,r))}),eke=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},tke=async(t,e,r)=>{await zl(r,e)&&(t.writable&&t.end(),await e)},uP=async(t,e,r)=>{try{await QI(t),e.writable&&e.end()}catch(n){await AK(r),PK(e,n)}},dP=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await zl(r,e),await zl(n,e)&&(PK(t,i),await bv(e,i))},PK=(t,e)=>{vv(t,t.writable,e)}});import{Duplex as rke}from"node:stream";import{callbackify as nke}from"node:util";var CK,ike,DK=y(()=>{Pa();aP();fP();CK=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||on.has(r),{subprocessStdout:c,waitReadableDestroy:l}=rP(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=cP(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=nP(c,a),{read:g,onStdoutDataDone:b}=iP({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new rke({read:g,...lP(u,t,d),destroy:nke(ike.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return oP({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),uP(u,_,c),_},ike=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([sP({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),dP({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var pP,oke,NK=y(()=>{Pa();ds();hv();pP=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||on.has(e),s=Cl(t,r),a=mv({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return oke(a,s,t)},oke=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var jK,MK=y(()=>{_v();aP();fP();DK();NK();jK=(t,{encoding:e})=>{let r=kK();t.readable=TK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=IK.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=CK.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=pP.bind(void 0,t,e),t[Symbol.asyncIterator]=pP.bind(void 0,t,e,{})}});var FK,ske,ake,LK=y(()=>{FK=(t,e)=>{for(let[r,n]of ake){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},ske=(async()=>{})().constructor.prototype,ake=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(ske,t)])});import{setMaxListeners as cke}from"node:events";import{spawn as lke}from"node:child_process";var zK,uke,dke,fke,pke,mke,UK=y(()=>{Hb();SR();KR();ds();JR();RI();np();Vb();R3();N3();ip();G3();mb();J3();cK();YI();$K();MK();Pl();LK();zK=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=uke(t,e,r),{subprocess:f,promise:p}=fke({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=pv.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),FK(f,p),Di.set(f,{options:u,fileDescriptors:d}),f},uke=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ab(t,e,r),{file:a,commandArguments:c,options:l}=Db(t,e,r),u=dke(l),d=D3(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},dke=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},fke=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=lke(...Nb(t,e,r))}catch(m){return O3({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;cke(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];H3(c,a,l),K3(c,r,l);let d={},f=Ci();c.kill=O9.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=hK(c,r),jK(c,r),E3(c,r);let p=pke({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},pke=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await xK({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map((x,w)=>xo(x,e,w)),_=xo(h,e,"all"),S=mke({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Ml(S,n,e)},mke=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?rp({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Ni,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):Zb({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var Sv,hke,gke,qK=y(()=>{yo();So();Sv=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,hke(n,t[n],i)]));return{...t,...r}},hke=(t,e,r)=>gke.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,gke=new Set(["env",...gR])});var ms,yke,_ke,BK=y(()=>{yo();dR();HG();b3();UK();qK();ms=(t,e,r,n)=>{let i=(s,a,c)=>ms(s,a,r,c),o=(...s)=>yke({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},yke=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Ot(o))return i(t,Sv(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=_ke({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?_3(a,c,l):zK(a,c,l,i)},_ke=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=qG(e)?BG(e,r):[e,...r],[s,a,c]=W_(...o),l=Sv(Sv(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var HK,GK,ZK,bke,vke,VK=y(()=>{HK=({file:t,commandArguments:e})=>ZK(t,e),GK=({file:t,commandArguments:e})=>({...ZK(t,e),isSync:!0}),ZK=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=bke(t);return{file:r,commandArguments:n}},bke=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(vke)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},vke=/ +/g});var WK,KK,Ske,JK,wke,YK,XK=y(()=>{WK=(t,e,r)=>{t.sync=e(Ske,r),t.s=t.sync},KK=({options:t})=>JK(t),Ske=({options:t})=>({...JK(t),isSync:!0}),JK=t=>({options:{...wke(t),...t}}),wke=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},YK={preferLocal:!0}});var Zlt,We,Vlt,Wlt,Klt,Jlt,Ylt,Xlt,Qlt,eut,Mr=y(()=>{BK();VK();GR();XK();RI();Zlt=ms(()=>({})),We=ms(()=>({isSync:!0})),Vlt=ms(HK),Wlt=ms(GK),Klt=ms(pV),Jlt=ms(KK,{},YK,WK),{sendMessage:Ylt,getOneMessage:Xlt,getEachMessage:Qlt,getCancelSignal:eut}=A3()});import{existsSync as wv,statSync as xke}from"node:fs";import{dirname as mP,extname as $ke,isAbsolute as QK,join as hP,relative as gP,resolve as xv,sep as kke}from"node:path";function $v(t){return t==="./gradlew"||t==="gradle"}function Eke(t){return(wv(hP(t,"build.gradle.kts"))||wv(hP(t,"build.gradle")))&&wv(hP(t,"gradle.properties"))}function Ake(t,e){let n=gP(t,e).split(kke).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function hs(t,e){return t===":"?`:${e}`:`${t}:${e}`}function Tke(t,e){let r=xv(t,e),n=r;wv(r)?xke(r).isFile()&&(n=mP(r)):$ke(r)!==""&&(n=mP(r));let i=gP(t,n);if(i.startsWith("..")||QK(i))return null;let o=n;for(;;){if(Eke(o))return o;if(xv(o)===xv(t))return null;let s=mP(o);if(s===o)return null;let a=gP(t,s);if(a.startsWith("..")||QK(a))return null;o=s}}function kv(t,e){let r=xv(t),n=new Map,i=[];for(let o of e){let s=Tke(r,o);if(!s){i.push(o);continue}let a=Ake(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var Ev=y(()=>{"use strict"});import{existsSync as _P,readFileSync as Oke}from"node:fs";import{join as Ul}from"node:path";function ql(t="."){let e=Ul(t,".cladding","config.yaml");if(!_P(e))return yP;try{let n=(0,eJ.parse)(Oke(e,"utf8"))?.gate;if(!n)return yP;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of Rke){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return yP}}function tJ(t="."){let e=ql(t).testReport,r=e?[e,...bP]:bP;return[...new Set(r.map(n=>Ul(t,n)))]}function rJ(t="."){let e=ql(t).testReport;if(e){let r=Ul(t,e);return _P(r)?r:null}return bP.map(r=>Ul(t,r)).find(r=>_P(r))??null}function nJ(t,e){let r=[],n=!1;for(let i of t){let o=Ike.exec(i);if(o){n=!0;for(let s of e)r.push(hs(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var eJ,Rke,yP,bP,Ike,dp=y(()=>{"use strict";eJ=St(er(),1);Ev();Rke=["type","lint","test","coverage"],yP={scope:"feature"},bP=["test-report.junit.xml",Ul("coverage","junit.xml"),Ul(".cladding","test-report.junit.xml")];Ike=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as SP,readFileSync as iJ,readdirSync as Pke,statSync as Cke}from"node:fs";import{join as Av}from"node:path";function $P(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=Av(t,e);if(SP(r))try{if(oJ.test(iJ(r,"utf8")))return!0}catch{}}return!1}function sJ(t){try{return SP(t)&&oJ.test(iJ(t,"utf8"))}catch{return!1}}function aJ(t,e=0){if(e>4||!SP(t))return!1;let r;try{r=Pke(t)}catch{return!1}for(let n of r){let i=Av(t,n),o=!1;try{o=Cke(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(aJ(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&sJ(i))return!0}return!1}function jke(t){if($P(t))return!0;for(let e of Dke)if(sJ(Av(t,e)))return!0;for(let e of Nke)if(aJ(Av(t,e)))return!0;return!1}function cJ(t="."){let e=ql(t).coverage;return e||(jke(t)?"kover":"jacoco")}function lJ(t="."){return wP[cJ(t)]}function uJ(t="."){return vP[cJ(t)]}var wP,vP,xP,oJ,Dke,Nke,Tv=y(()=>{"use strict";dp();wP={kover:"koverXmlReport",jacoco:"jacocoTestReport"},vP={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},xP=[vP.kover,vP.jacoco],oJ=/kover/i;Dke=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],Nke=["buildSrc","build-logic"]});import{existsSync as pp,readFileSync as fJ,readdirSync as pJ}from"node:fs";import{join as gs}from"node:path";function EP(t){return pp(gs(t,"gradlew"))?"./gradlew":"gradle"}function Mke(t){let e=EP(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[lJ(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function Fke(t){let e=!1;try{e=/(^|\n)\s*flutter\s*:|sdk:\s*flutter/.test(fJ(gs(t,"pubspec.yaml"),"utf8"))}catch{}let r={cmd:"dart",args:["format","--output=none","--set-exit-if-changed","."]},n={cmd:"gitleaks",args:["detect","--no-banner"]};return e?{type:{cmd:"flutter",args:["analyze"]},lint:r,test:{cmd:"flutter",args:["test"]},coverage:{cmd:"flutter",args:["test","--coverage"]},secret:n}:{type:{cmd:"dart",args:["analyze"]},lint:r,test:{cmd:"dart",args:["test"]},coverage:{cmd:"dart",args:["test","--coverage=coverage"]},secret:n}}function zke(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function Bke(t,e){for(let r of e)if(pp(gs(t,r)))return r}function Hke(t,e){try{return pJ(t).find(n=>n.endsWith(e))}catch{return}}function Vke(t){try{return JSON.parse(fJ(gs(t,"package.json"),"utf8"))}catch{return{}}}function fp(t,e){let r=t.scripts?.[e];return typeof r=="string"&&r.trim().length>0?r.trim():void 0}function dJ(t,e){return[t.dependencies,t.devDependencies,t.optionalDependencies,t.peerDependencies].some(r=>r?.[e]!==void 0)}function Wke(t,e,r){if(fp(r,"lint"))return{cmd:"npm",args:["run","--silent","lint"]};for(let n of Gke)if(n.configs.some(i=>pp(gs(t,i))))return n.gate;if(Zke.some(n=>pp(gs(t,n)))||r.eslintConfig!==void 0)return e}function Jke(t,e){return Kke.some(r=>pp(gs(t,r)))?!0:e.jest!==void 0}function Yke(t){if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?vitest(?:\s+run)?$/i.test(t))return"vitest";if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?jest$/i.test(t))return"jest"}function kP(t,e){let r={...t};return e==="lint"?delete r.lint:delete r.coverage,r}function Xke(t,e){let r=Vke(t),n=e.lint?Wke(t,e.lint,r):void 0,i=n?{...e,lint:n}:kP(e,"lint"),o=fp(r,"test"),s=o?Yke(o):void 0;return o&&!s?(i=kP(i,"coverage"),{...i,test:{cmd:"npm",args:["test"]},...fp(r,"coverage")?{coverage:{cmd:"npm",args:["run","--silent","coverage"]}}:{}}):s==="jest"||!o&&Jke(t,r)?{...i,test:{cmd:"npx",args:[...Mi,"jest"]},coverage:{cmd:"npx",args:[...Mi,"jest","--coverage"]}}:(s==="vitest"&&!fp(r,"coverage")&&!dJ(r,"@vitest/coverage-v8")&&!dJ(r,"@vitest/coverage-istanbul")?i=kP(i,"coverage"):s==="vitest"&&fp(r,"coverage")&&(i={...i,coverage:{cmd:"npm",args:["run","--silent","coverage"]}}),i)}function dt(t="."){for(let e of Uke){let r;for(let o of e.manifests)if(o.startsWith(".")?r=Hke(t,o):r=Bke(t,[o]),r)break;if(!r||e.requiresSource&&!zke(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"?Xke(t,n):n;return{language:e.language,manifest:r,gates:i}}return qke}var Mi,Lke,Uke,qke,Gke,Zke,Kke,sn=y(()=>{"use strict";Tv();Mi=["--offline","--no-install"];Lke=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);Uke=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:[...Mi,"tsc","--noEmit"]},lint:{cmd:"npx",args:[...Mi,"eslint","."]},test:{cmd:"npx",args:[...Mi,"vitest","run"]},coverage:{cmd:"npx",args:[...Mi,"vitest","run","--coverage"]},secret:{cmd:"npx",args:[...Mi,"secretlint","**/*"]},arch:{cmd:"npx",args:[...Mi,"madge","--circular","--extensions","ts,tsx,js,jsx","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:Mke},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"swift",manifests:["Package.swift"],gates:{type:{cmd:"swift",args:["build"]},lint:{cmd:"swiftlint",args:["lint"]},test:{cmd:"swift",args:["test"]},coverage:{cmd:"swift",args:["test","--enable-code-coverage"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dart",manifests:["pubspec.yaml"],gates:Fke}],qke={language:"unknown",manifest:"",gates:{}};Gke=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:[...Mi,"biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:[...Mi,"oxlint"]}}],Zke=["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts",".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"];Kke=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs","jest.config.json"]});import{existsSync as Qke,readFileSync as eEe}from"node:fs";import{join as tEe}from"node:path";function za(t){return t.code==="ENOENT"}function Ov(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return mJ.test(o)||mJ.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function Nt(t,e,r,n=[]){if(za(r))return{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`};let i=`${String(r.stderr??"")} ${String(r.stdout??"")}`,o=/ENOTCACHED|ENOTFOUND|EAI_AGAIN|canceled due to missing packages|could not determine executable/i.test(i),a=n.find(l=>l!=="--"&&!l.startsWith("-"))?.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=r.exitCode===127&&a!==void 0&&new RegExp(`(?:^|[\\s:])${a}: (?:command )?not found\\b`,"i").test(i);return e==="npx"&&(o||c)?{stage:t,pass:!1,exitCode:2,stderr:"setup gap: 'npx' could not resolve the configured tool without installing it; the inferred tool is not installed or unavailable offline"}:null}function Yt(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Bl(t,e){let r=tEe(t,"package.json");if(!Qke(r))return!1;try{return!!JSON.parse(eEe(r,"utf8")).scripts?.[e]}catch{return!1}}var mJ,Rn=y(()=>{"use strict";mJ=/config (is |file )?not found|no such file|ENOENT|ENOTCACHED|ENOTFOUND|EAI_AGAIN|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function rEe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.arch;if(!n)return[{detector:Rv,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=We(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Rv,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:Ov(i,Rv,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var Rv,Ua,Iv=y(()=>{"use strict";Mr();sn();Rn();Rv="ARCHITECTURE_VIOLATION";Ua={name:Rv,subprocess:!0,run:rEe}});function nEe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.secret;if(!n)return[{detector:Pv,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=We(n.cmd,[...n.args],{cwd:e,reject:!1});return za(i)?[{detector:Pv,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:Ov(i,Pv,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var Pv,qa,Cv=y(()=>{"use strict";Mr();sn();Rn();Pv="HARDCODED_SECRET";qa={name:Pv,subprocess:!0,run:nEe}});import{existsSync as AP,readdirSync as hJ}from"node:fs";import{join as Dv}from"node:path";function oEe(t,e){let r=Dv(t,e.path);if(!AP(r))return!0;if(e.isDirectory)try{return hJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function sEe(t){let{cwd:e="."}=t,r=[];for(let i of iEe)oEe(e,i)&&r.push({detector:mp,severity:i.severity,path:i.path,message:`${i.path} is absent \u2014 cladding scaffold incomplete (${i.purpose}). Run \`clad init --intent ""\` to populate it.`});let n=Dv(e,"spec.yaml");if(AP(n)){let i=lEe(n),o=i?null:aEe(e);if(i)r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present but unreadable (${i}) \u2014 cladding is governing nothing. Fix the SSoT root, then \`clad sync\` to validate.`});else if(o)r.push({detector:mp,severity:"error",path:o.path,message:`spec shard '${o.path}' is present but unparseable (${o.reason}) \u2014 loadSpec throws on it, so every spec-gated detector silently passes. Fix it, then \`clad sync\`.`});else{let s=cEe(e);s&&r.push({detector:mp,severity:"error",path:"spec.yaml",message:`spec.yaml is present and parses, but the assembled spec does not load (${s}) \u2014 every spec-gated detector then degrades to non-blocking info, so the gate would pass GREEN on an unloadable SSoT. Fix it, then \`clad sync\` to validate.`})}}return r}function aEe(t){for(let e of["spec/features","spec/scenarios"]){let r=Dv(t,e);if(!AP(r))continue;let n;try{n=hJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{Oi(Dv(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function cEe(t){try{return q(t),null}catch(e){return e.message}}function lEe(t){let e;try{e=Oi(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var mp,iEe,gJ,yJ=y(()=>{"use strict";Ue();F_();mp="ABSENCE_OF_GOVERNANCE",iEe=[{path:"spec.yaml",severity:"error",purpose:"SSoT root \u2014 every spec-gated detector needs it"},{path:"spec/architecture.yaml",severity:"warn",purpose:"architecture invariants (layers + forbidden_imports)"},{path:"spec/capabilities.yaml",severity:"warn",purpose:"capability \u2194 feature traceability"},{path:"docs/project-context.md",severity:"warn",purpose:"intent narrative + decision history"},{path:"docs/conventions.md",severity:"info",purpose:"project style guide (recommended)"},{path:"spec/scenarios",severity:"info",purpose:"user-journey scenarios (recommended)",isDirectory:!0}];gJ={name:mp,run:sEe}});function Nv(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function TP(t,e){let r=e?.trim()??"";if(!t)return r.length>0?"condition is present but ears pattern is not declared":null;if(t==="ubiquitous")return r.length>0?`ears='ubiquitous' but condition is present ('${r.slice(0,40)}\u2026')`:null;if(t==="complex"){if(r.length===0)return"ears='complex' requires a 'while' precondition and a 'when' trigger \u2014 empty";let i=Nv(r)==="while",o=dEe.test(r);return i?o?null:"ears='complex' requires a 'when' trigger clause after the 'while' precondition \u2014 none found":`ears='complex' requires the condition to start with 'while' (precondition) \u2014 got '${Nv(r)}'`}let n=uEe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:Nv(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${Nv(r)}'`:null}function fEe(t,e){let r=TP(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function _J(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...fEe(r,n));return e}var uEe,dEe,OP=y(()=>{"use strict";uEe={event:"when",state:"while",optional:"where",unwanted:"if"},dEe=/\bwhen\b/i});function ge(t,e,r){let n;try{n=q(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var wt=y(()=>{"use strict";Ue()});function pEe(t){let{cwd:e="."}=t;return ge(e,jv,mEe)}function mEe(t){let e=[];for(let r of t.features)for(let n of r.acceptance_criteria??[]){let i=!!n.text?.trim(),o=!!(n.condition?.trim()||n.action?.trim()||n.response?.trim());!i&&!o&&e.push({detector:jv,severity:"error",message:`${r.id}.${n.id} has neither rendered text nor any EARS field (condition/action/response) \u2014 structurally empty AC`})}for(let r of _J(t.features))e.push({detector:jv,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var jv,bJ,vJ=y(()=>{"use strict";OP();wt();jv="AC_DRIFT";bJ={name:jv,run:pEe}});function Fi(t=".",e){let n=(e??"").trim().toLowerCase()||dt(t).language;return wJ[n]??SJ}var hEe,gEe,yEe,SJ,_Ee,bEe,wJ,vEe,xJ,Ba=y(()=>{"use strict";sn();hEe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,gEe=/^[ \t]*import\s+([\w.]+)/gm,yEe=/^[ \t]*(?:from|import)\s+([\w.]+)/gm,SJ={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:hEe,importStyle:"relative"},_Ee={ext:"kt",extensions:[".kt",".kts"],sourceRoots:["src/main/kotlin","src/test/kotlin"],mainRoot:"src/main/kotlin",testGlobs:["src/test/kotlin/**/*Test.kt","src/test/kotlin/**/*Tests.kt"],coverageSummary:"build/reports/jacoco/test/jacocoTestReport.xml",coverageFormat:"jacoco-xml",importMatcher:gEe,importStyle:"dotted"},bEe={ext:"py",extensions:[".py"],sourceRoots:["."],mainRoot:"src",testGlobs:["tests/test_*.py","tests/**/test_*.py","tests/**/*_test.py"],coverageSummary:"coverage.xml",coverageFormat:"cobertura-xml",importMatcher:yEe,importStyle:"dotted"},wJ={typescript:SJ,kotlin:_Ee,python:bEe},vEe=[".js",".jsx",".mts",".cts",".rs",".go",".java",".rb",".php",".cs",".fs",".ex",".exs"],xJ=new Set([...Object.values(wJ).flatMap(t=>t?.extensions??[]),...vEe].map(t=>t.toLowerCase()))});import{existsSync as SEe,readFileSync as wEe,readdirSync as xEe,statSync as $Ee}from"node:fs";import{join as kJ,relative as $J}from"node:path";function kEe(t,e){if(!SEe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=xEe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=kJ(i,s),c;try{c=$Ee(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function EEe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function TEe(t){return AEe.test(t)}function OEe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=Fi(e,r.project?.language),o=i.sourceRoots.flatMap(a=>kEe(kJ(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=wEe(a,"utf8")}catch{continue}let l=c.split(` -`);for(let u=0;u{"use strict";Ue();Ba();EJ="AI_HINTS_FORBIDDEN_PATTERN";AEe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;AJ={name:EJ,run:OEe}});function REe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:OJ,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var OJ,RJ,IJ=y(()=>{"use strict";Ue();OJ="AC_DUPLICATE_WITHIN_FEATURE";RJ={name:OJ,run:REe}});import{createRequire as IEe}from"module";import{basename as PEe,dirname as IP,normalize as CEe,relative as DEe,resolve as NEe,sep as DJ}from"path";import*as jEe from"fs";function MEe(t){let e=CEe(t);return e.length>1&&e[e.length-1]===DJ&&(e=e.substring(0,e.length-1)),e}function NJ(t,e){return t.replace(FEe,e)}function zEe(t){return t==="/"||LEe.test(t)}function RP(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=NEe(t)),(n||o)&&(t=MEe(t)),t===".")return"";let s=t[t.length-1]!==i;return NJ(s?t+i:t,i)}function jJ(t,e){return e+t}function UEe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:NJ(DEe(t,n),e.pathSeparator)+e.pathSeparator+r}}function qEe(t){return t}function BEe(t,e,r){return e+t+r}function HEe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?UEe(t,e):n?jJ:qEe}function GEe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function ZEe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function JEe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?ZEe(t):GEe(t):n&&n.length?WEe:VEe:KEe}function rAe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?tAe:r&&r.length?n?YEe:XEe:n?QEe:eAe}function oAe(t){return t.group?iAe:nAe}function cAe(t){return t.group?sAe:aAe}function dAe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?uAe:lAe}function MJ(t,e,r){if(r.options.useRealPaths)return fAe(e,r);let n=IP(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=IP(n)}return r.symlinks.set(t,e),i>1}function fAe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function Mv(t,e,r,n){e(t&&!n?t:null,r)}function SAe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?pAe:yAe:n?e?mAe:vAe:i?e?gAe:bAe:e?hAe:_Ae}function $Ae(t){return t?xAe:wAe}function TAe(t,e){return new Promise((r,n)=>{zJ(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function zJ(t,e,r){new LJ(t,e,r).start()}function OAe(t,e){return new LJ(t,e).start()}var PJ,FEe,LEe,VEe,WEe,KEe,YEe,XEe,QEe,eAe,tAe,nAe,iAe,sAe,aAe,lAe,uAe,pAe,mAe,hAe,gAe,yAe,_Ae,bAe,vAe,FJ,wAe,xAe,kAe,EAe,AAe,LJ,CJ,UJ,qJ,BJ=y(()=>{PJ=IEe(import.meta.url);FEe=/[\\/]/g;LEe=/^[a-z]:[\\/]$/i;VEe=(t,e)=>{e.push(t||".")},WEe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},KEe=()=>{};YEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},XEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},QEe=(t,e,r,n)=>{r.files++},eAe=(t,e)=>{e.push(t)},tAe=()=>{};nAe=t=>t,iAe=()=>[""].slice(0,0);sAe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},aAe=()=>{};lAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&MJ(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},uAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&MJ(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};pAe=t=>t.counts,mAe=t=>t.groups,hAe=t=>t.paths,gAe=t=>t.paths.slice(0,t.options.maxFiles),yAe=(t,e,r)=>(Mv(e,r,t.counts,t.options.suppressErrors),null),_Ae=(t,e,r)=>(Mv(e,r,t.paths,t.options.suppressErrors),null),bAe=(t,e,r)=>(Mv(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),vAe=(t,e,r)=>(Mv(e,r,t.groups,t.options.suppressErrors),null);FJ={withFileTypes:!0},wAe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",FJ,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},xAe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",FJ)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};kAe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},EAe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},AAe=class{aborted=!1;abort(){this.aborted=!0}},LJ=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=SAe(e,this.isSynchronous),this.root=RP(t,e),this.state={root:zEe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new EAe,options:e,queue:new kAe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new AAe,fs:e.fs||jEe},this.joinPath=HEe(this.root,e),this.pushDirectory=JEe(this.root,e),this.pushFile=rAe(e),this.getArray=oAe(e),this.groupFiles=cAe(e),this.resolveSymlink=dAe(e,this.isSynchronous),this.walkDirectory=$Ae(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(b.isDirectory()){if(_=RP(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let S=PEe(_),x=RP(IP(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};CJ=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return TAe(this.root,this.options)}withCallback(t){zJ(this.root,this.options,t)}sync(){return OAe(this.root,this.options)}},UJ=null;try{PJ.resolve("picomatch"),UJ=PJ("picomatch")}catch{}qJ=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:DJ,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new CJ(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new CJ(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||UJ;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var hp=v((ndt,WJ)=>{"use strict";var HJ="[^\\\\/]",RAe="(?=.)",GJ="[^/]",PP="(?:\\/|$)",ZJ="(?:^|\\/)",CP=`\\.{1,2}${PP}`,IAe="(?!\\.)",PAe=`(?!${ZJ}${CP})`,CAe=`(?!\\.{0,1}${PP})`,DAe=`(?!${CP})`,NAe="[^.\\/]",jAe=`${GJ}*?`,MAe="/",VJ={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:RAe,QMARK:GJ,END_ANCHOR:PP,DOTS_SLASH:CP,NO_DOT:IAe,NO_DOTS:PAe,NO_DOT_SLASH:CAe,NO_DOTS_SLASH:DAe,QMARK_NO_DOT:NAe,STAR:jAe,START_ANCHOR:ZJ,SEP:MAe},FAe={...VJ,SLASH_LITERAL:"[\\\\/]",QMARK:HJ,STAR:`${HJ}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},LAe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};WJ.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:LAe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?FAe:VJ}}});var gp=v(Fr=>{"use strict";var{REGEX_BACKSLASH:zAe,REGEX_REMOVE_BACKSLASH:UAe,REGEX_SPECIAL_CHARS:qAe,REGEX_SPECIAL_CHARS_GLOBAL:BAe}=hp();Fr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Fr.hasRegexChars=t=>qAe.test(t);Fr.isRegexChar=t=>t.length===1&&Fr.hasRegexChars(t);Fr.escapeRegex=t=>t.replace(BAe,"\\$1");Fr.toPosixSlashes=t=>t.replace(zAe,"/");Fr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Fr.removeBackslashes=t=>t.replace(UAe,e=>e==="\\"?"":e);Fr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Fr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Fr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Fr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Fr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var r8=v((odt,t8)=>{"use strict";var KJ=gp(),{CHAR_ASTERISK:DP,CHAR_AT:HAe,CHAR_BACKWARD_SLASH:yp,CHAR_COMMA:GAe,CHAR_DOT:NP,CHAR_EXCLAMATION_MARK:jP,CHAR_FORWARD_SLASH:e8,CHAR_LEFT_CURLY_BRACE:MP,CHAR_LEFT_PARENTHESES:FP,CHAR_LEFT_SQUARE_BRACKET:ZAe,CHAR_PLUS:VAe,CHAR_QUESTION_MARK:JJ,CHAR_RIGHT_CURLY_BRACE:WAe,CHAR_RIGHT_PARENTHESES:YJ,CHAR_RIGHT_SQUARE_BRACKET:KAe}=hp(),XJ=t=>t===e8||t===yp,QJ=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},JAe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,b=!1,_=!1,S=!1,x=!1,w=!1,O=0,T,A,D={value:"",depth:0,isGlob:!1},$=()=>l>=n,ie=()=>c.charCodeAt(l+1),K=()=>(T=A,c.charCodeAt(++l));for(;l0&&(C=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),P=c.slice(d)):m===!0?(xe="",P=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&XJ(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(P&&(P=KJ.removeBackslashes(P)),xe&&_===!0&&(xe=KJ.removeBackslashes(xe)));let Ir={prefix:C,input:t,start:u,base:xe,glob:P,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&(Ir.maxDepth=0,XJ(A)||s.push(D),Ir.tokens=s),r.parts===!0||r.tokens===!0){let se;for(let Ce=0;Ce{"use strict";var _p=hp(),an=gp(),{MAX_LENGTH:Fv,POSIX_REGEX_SOURCE:YAe,REGEX_NON_SPECIAL_CHARS:XAe,REGEX_SPECIAL_CHARS_BACKREF:QAe,REPLACEMENTS:n8}=_p,eTe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>an.escapeRegex(i)).join("..")}return r},Hl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,i8=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},tTe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},o8=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(tTe(e))return e.replace(/\\(.)/g,"$1")},rTe=t=>{let e=t.map(o8).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},nTe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=o8(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?an.escapeRegex(r[0]):`[${r.map(i=>an.escapeRegex(i)).join("")}]`}*`},iTe=t=>{let e=0,r=t.trim(),n=LP(r);for(;n;)e++,r=n.body.trim(),n=LP(r);return e},oTe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:_p.DEFAULT_MAX_EXTGLOB_RECURSION,n=i8(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||rTe(n)))return{risky:!0};for(let i of n){let o=nTe(i);if(o)return{risky:!0,safeOutput:o};if(iTe(i)>r)return{risky:!0}}return{risky:!1}},zP=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=n8[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Fv,r.maxLength):Fv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=_p.globChars(r.windows),l=_p.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:b,QMARK:_,QMARK_NO_DOT:S,STAR:x,START_ANCHOR:w}=c,O=H=>`(${a}(?:(?!${w}${H.dot?m:u}).)*?)`,T=r.dot?"":h,A=r.dot?_:S,D=r.bash===!0?O(r):x;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let $={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=an.removePrefix(t,$),i=t.length;let ie=[],K=[],xe=[],C=o,P,Ir=()=>$.index===i-1,se=$.peek=(H=1)=>t[$.index+H],Ce=$.advance=()=>t[++$.index]||"",Kt=()=>t.slice($.index+1),dr=(H="",ht=0)=>{$.consumed+=H,$.index+=ht},Xt=H=>{$.output+=H.output!=null?H.output:H.value,dr(H.value)},lo=()=>{let H=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)Ce(),$.start++,H++;return H%2===0?!1:($.negated=!0,$.start++,!0)},$i=H=>{$[H]++,xe.push(H)},Xr=H=>{$[H]--,xe.pop()},de=H=>{if(C.type==="globstar"){let ht=$.braces>0&&(H.type==="comma"||H.type==="brace"),B=H.extglob===!0||ie.length&&(H.type==="pipe"||H.type==="paren");H.type!=="slash"&&H.type!=="paren"&&!ht&&!B&&($.output=$.output.slice(0,-C.output.length),C.type="star",C.value="*",C.output=D,$.output+=C.output)}if(ie.length&&H.type!=="paren"&&(ie[ie.length-1].inner+=H.value),(H.value||H.output)&&Xt(H),C&&C.type==="text"&&H.type==="text"){C.output=(C.output||C.value)+H.value,C.value+=H.value;return}H.prev=C,s.push(H),C=H},uo=(H,ht)=>{let B={...l[ht],conditions:1,inner:""};B.prev=C,B.parens=$.parens,B.output=$.output,B.startIndex=$.index,B.tokensIndex=s.length;let Oe=(r.capture?"(":"")+B.open;$i("parens"),de({type:H,value:ht,output:$.output?"":p}),de({type:"paren",extglob:!0,value:Ce(),output:Oe}),ie.push(B)},Mde=H=>{let ht=t.slice(H.startIndex,$.index+1),B=t.slice(H.startIndex+2,$.index),Oe=oTe(B,r);if((H.type==="plus"||H.type==="star")&&Oe.risky){let lt=Oe.safeOutput?(H.output?"":p)+(r.capture?`(${Oe.safeOutput})`:Oe.safeOutput):void 0,ki=s[H.tokensIndex];ki.type="text",ki.value=ht,ki.output=lt||an.escapeRegex(ht);for(let Ei=H.tokensIndex+1;Ei1&&H.inner.includes("/")&&(lt=O(r)),(lt!==D||Ir()||/^\)+$/.test(Kt()))&&(ut=H.close=`)$))${lt}`),H.inner.includes("*")&&(zt=Kt())&&/^\.[^\\/.]+$/.test(zt)){let ki=zP(zt,{...e,fastpaths:!1}).output;ut=H.close=`)${ki})${lt})`}H.prev.type==="bos"&&($.negatedExtglob=!0)}de({type:"paren",extglob:!0,value:P,output:ut}),Xr("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let H=!1,ht=t.replace(QAe,(B,Oe,ut,zt,lt,ki)=>zt==="\\"?(H=!0,B):zt==="?"?Oe?Oe+zt+(lt?_.repeat(lt.length):""):ki===0?A+(lt?_.repeat(lt.length):""):_.repeat(ut.length):zt==="."?u.repeat(ut.length):zt==="*"?Oe?Oe+zt+(lt?D:""):D:Oe?B:`\\${B}`);return H===!0&&(r.unescape===!0?ht=ht.replace(/\\/g,""):ht=ht.replace(/\\+/g,B=>B.length%2===0?"\\\\":B?"\\":"")),ht===t&&r.contains===!0?($.output=t,$):($.output=an.wrapOutput(ht,$,e),$)}for(;!Ir();){if(P=Ce(),P==="\0")continue;if(P==="\\"){let B=se();if(B==="/"&&r.bash!==!0||B==="."||B===";")continue;if(!B){P+="\\",de({type:"text",value:P});continue}let Oe=/^\\+/.exec(Kt()),ut=0;if(Oe&&Oe[0].length>2&&(ut=Oe[0].length,$.index+=ut,ut%2!==0&&(P+="\\")),r.unescape===!0?P=Ce():P+=Ce(),$.brackets===0){de({type:"text",value:P});continue}}if($.brackets>0&&(P!=="]"||C.value==="["||C.value==="[^")){if(r.posix!==!1&&P===":"){let B=C.value.slice(1);if(B.includes("[")&&(C.posix=!0,B.includes(":"))){let Oe=C.value.lastIndexOf("["),ut=C.value.slice(0,Oe),zt=C.value.slice(Oe+2),lt=YAe[zt];if(lt){C.value=ut+lt,$.backtrack=!0,Ce(),!o.output&&s.indexOf(C)===1&&(o.output=p);continue}}}(P==="["&&se()!==":"||P==="-"&&se()==="]")&&(P=`\\${P}`),P==="]"&&(C.value==="["||C.value==="[^")&&(P=`\\${P}`),r.posix===!0&&P==="!"&&C.value==="["&&(P="^"),C.value+=P,Xt({value:P});continue}if($.quotes===1&&P!=='"'){P=an.escapeRegex(P),C.value+=P,Xt({value:P});continue}if(P==='"'){$.quotes=$.quotes===1?0:1,r.keepQuotes===!0&&de({type:"text",value:P});continue}if(P==="("){$i("parens"),de({type:"paren",value:P});continue}if(P===")"){if($.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Hl("opening","("));let B=ie[ie.length-1];if(B&&$.parens===B.parens+1){Mde(ie.pop());continue}de({type:"paren",value:P,output:$.parens?")":"\\)"}),Xr("parens");continue}if(P==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Hl("closing","]"));P=`\\${P}`}else $i("brackets");de({type:"bracket",value:P});continue}if(P==="]"){if(r.nobracket===!0||C&&C.type==="bracket"&&C.value.length===1){de({type:"text",value:P,output:`\\${P}`});continue}if($.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Hl("opening","["));de({type:"text",value:P,output:`\\${P}`});continue}Xr("brackets");let B=C.value.slice(1);if(C.posix!==!0&&B[0]==="^"&&!B.includes("/")&&(P=`/${P}`),C.value+=P,Xt({value:P}),r.literalBrackets===!1||an.hasRegexChars(B))continue;let Oe=an.escapeRegex(C.value);if($.output=$.output.slice(0,-C.value.length),r.literalBrackets===!0){$.output+=Oe,C.value=Oe;continue}C.value=`(${a}${Oe}|${C.value})`,$.output+=C.value;continue}if(P==="{"&&r.nobrace!==!0){$i("braces");let B={type:"brace",value:P,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};K.push(B),de(B);continue}if(P==="}"){let B=K[K.length-1];if(r.nobrace===!0||!B){de({type:"text",value:P,output:P});continue}let Oe=")";if(B.dots===!0){let ut=s.slice(),zt=[];for(let lt=ut.length-1;lt>=0&&(s.pop(),ut[lt].type!=="brace");lt--)ut[lt].type!=="dots"&&zt.unshift(ut[lt].value);Oe=eTe(zt,r),$.backtrack=!0}if(B.comma!==!0&&B.dots!==!0){let ut=$.output.slice(0,B.outputIndex),zt=$.tokens.slice(B.tokensIndex);B.value=B.output="\\{",P=Oe="\\}",$.output=ut;for(let lt of zt)$.output+=lt.output||lt.value}de({type:"brace",value:P,output:Oe}),Xr("braces"),K.pop();continue}if(P==="|"){ie.length>0&&ie[ie.length-1].conditions++,de({type:"text",value:P});continue}if(P===","){let B=P,Oe=K[K.length-1];Oe&&xe[xe.length-1]==="braces"&&(Oe.comma=!0,B="|"),de({type:"comma",value:P,output:B});continue}if(P==="/"){if(C.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",s.pop(),C=o;continue}de({type:"slash",value:P,output:f});continue}if(P==="."){if($.braces>0&&C.type==="dot"){C.value==="."&&(C.output=u);let B=K[K.length-1];C.type="dots",C.output+=P,C.value+=P,B.dots=!0;continue}if($.braces+$.parens===0&&C.type!=="bos"&&C.type!=="slash"){de({type:"text",value:P,output:u});continue}de({type:"dot",value:P,output:u});continue}if(P==="?"){if(!(C&&C.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("qmark",P);continue}if(C&&C.type==="paren"){let Oe=se(),ut=P;(C.value==="("&&!/[!=<:]/.test(Oe)||Oe==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(ut=`\\${P}`),de({type:"text",value:P,output:ut});continue}if(r.dot!==!0&&(C.type==="slash"||C.type==="bos")){de({type:"qmark",value:P,output:S});continue}de({type:"qmark",value:P,output:_});continue}if(P==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){uo("negate",P);continue}if(r.nonegate!==!0&&$.index===0){lo();continue}}if(P==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("plus",P);continue}if(C&&C.value==="("||r.regex===!1){de({type:"plus",value:P,output:d});continue}if(C&&(C.type==="bracket"||C.type==="paren"||C.type==="brace")||$.parens>0){de({type:"plus",value:P});continue}de({type:"plus",value:d});continue}if(P==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){de({type:"at",extglob:!0,value:P,output:""});continue}de({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let B=XAe.exec(Kt());B&&(P+=B[0],$.index+=B[0].length),de({type:"text",value:P});continue}if(C&&(C.type==="globstar"||C.star===!0)){C.type="star",C.star=!0,C.value+=P,C.output=D,$.backtrack=!0,$.globstar=!0,dr(P);continue}let H=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(H)){uo("star",P);continue}if(C.type==="star"){if(r.noglobstar===!0){dr(P);continue}let B=C.prev,Oe=B.prev,ut=B.type==="slash"||B.type==="bos",zt=Oe&&(Oe.type==="star"||Oe.type==="globstar");if(r.bash===!0&&(!ut||H[0]&&H[0]!=="/")){de({type:"star",value:P,output:""});continue}let lt=$.braces>0&&(B.type==="comma"||B.type==="brace"),ki=ie.length&&(B.type==="pipe"||B.type==="paren");if(!ut&&B.type!=="paren"&&!lt&&!ki){de({type:"star",value:P,output:""});continue}for(;H.slice(0,3)==="/**";){let Ei=t[$.index+4];if(Ei&&Ei!=="/")break;H=H.slice(3),dr("/**",3)}if(B.type==="bos"&&Ir()){C.type="globstar",C.value+=P,C.output=O(r),$.output=C.output,$.globstar=!0,dr(P);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&!zt&&Ir()){$.output=$.output.slice(0,-(B.output+C.output).length),B.output=`(?:${B.output}`,C.type="globstar",C.output=O(r)+(r.strictSlashes?")":"|$)"),C.value+=P,$.globstar=!0,$.output+=B.output+C.output,dr(P);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&H[0]==="/"){let Ei=H[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(B.output+C.output).length),B.output=`(?:${B.output}`,C.type="globstar",C.output=`${O(r)}${f}|${f}${Ei})`,C.value+=P,$.output+=B.output+C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}if(B.type==="bos"&&H[0]==="/"){C.type="globstar",C.value+=P,C.output=`(?:^|${f}|${O(r)}${f})`,$.output=C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-C.output.length),C.type="globstar",C.output=O(r),C.value+=P,$.output+=C.output,$.globstar=!0,dr(P);continue}let ht={type:"star",value:P,output:D};if(r.bash===!0){ht.output=".*?",(C.type==="bos"||C.type==="slash")&&(ht.output=T+ht.output),de(ht);continue}if(C&&(C.type==="bracket"||C.type==="paren")&&r.regex===!0){ht.output=P,de(ht);continue}($.index===$.start||C.type==="slash"||C.type==="dot")&&(C.type==="dot"?($.output+=g,C.output+=g):r.dot===!0?($.output+=b,C.output+=b):($.output+=T,C.output+=T),se()!=="*"&&($.output+=p,C.output+=p)),de(ht)}for(;$.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing","]"));$.output=an.escapeLast($.output,"["),Xr("brackets")}for(;$.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing",")"));$.output=an.escapeLast($.output,"("),Xr("parens")}for(;$.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing","}"));$.output=an.escapeLast($.output,"{"),Xr("braces")}if(r.strictSlashes!==!0&&(C.type==="star"||C.type==="bracket")&&de({type:"maybe_slash",value:"",output:`${f}?`}),$.backtrack===!0){$.output="";for(let H of $.tokens)$.output+=H.output!=null?H.output:H.value,H.suffix&&($.output+=H.suffix)}return $};zP.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Fv,r.maxLength):Fv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=n8[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=_p.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=T=>T.noglobstar===!0?_:`(${g}(?:(?!${p}${T.dot?c:o}).)*?)`,x=T=>{switch(T){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${S(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${S(r)}${s})?${o}${a}${_}`;default:{let A=/^(.*?)\.(\w+)$/.exec(T);if(!A)return;let D=x(A[1]);return D?D+o+A[2]:void 0}}},w=an.removePrefix(t,b),O=x(w);return O&&r.strictSlashes!==!0&&(O+=`${s}?`),O};s8.exports=zP});var u8=v((adt,l8)=>{"use strict";var sTe=r8(),UP=a8(),c8=gp(),aTe=hp(),cTe=t=>t&&typeof t=="object"&&!Array.isArray(t),Rt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Rt(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=cTe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?Rt.compileRe(t,e):Rt.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Rt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Rt.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};Rt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?c8.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Rt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Rt.matchBase=(t,e,r)=>(e instanceof RegExp?e:Rt.makeRe(e,r)).test(c8.basename(t));Rt.isMatch=(t,e,r)=>Rt(e,r)(t);Rt.parse=(t,e)=>Array.isArray(t)?t.map(r=>Rt.parse(r,e)):UP(t,{...e,fastpaths:!1});Rt.scan=(t,e)=>sTe(t,e);Rt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Rt.toRegex(a,e);return n===!0&&(c.state=t),c};Rt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=UP.fastpaths(t,e)),i.output||(i=UP(t,e)),Rt.compileRe(i,e,r,n)};Rt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Rt.constants=aTe;l8.exports=Rt});var m8=v((cdt,p8)=>{"use strict";var d8=u8(),lTe=gp();function f8(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:lTe.isWindows()}),d8(t,e,r)}Object.assign(f8,d8);p8.exports=f8});import{readdir as uTe,readdirSync as dTe,realpath as fTe,realpathSync as pTe,stat as mTe,statSync as hTe}from"fs";import{isAbsolute as gTe,posix as Ha,resolve as yTe}from"path";import{fileURLToPath as _Te}from"url";function STe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&vTe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>Ha.relative(t,n)||".":n=>Ha.relative(t,`${e}/${n}`)||"."}function $Te(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=Ha.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function _8(t){var e;let r=Gl.default.scan(t,kTe);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function ITe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Gl.default.scan(t);return r.isGlob||r.negated}function bp(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function b8(t){return typeof t=="string"?[t]:t??[]}function qP(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=RTe(o);s=gTe(s.replace(CTe,""))?Ha.relative(a,s):Ha.normalize(s);let c=(i=PTe.exec(s))===null||i===void 0?void 0:i[0],l=_8(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?Ha.join(o,...d):o}return s}function DTe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(qP(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(qP(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(qP(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function NTe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=DTe(t,e,n);t.debug&&bp("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(g8,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Gl.default)(i.match,f),m=(0,Gl.default)(i.ignore,f),h=STe(i.match,f),g=h8(r,d,o),b=o?g:h8(r,d,!0),_=(w,O)=>{let T=b(O,!0);return T!=="."&&!h(T)||m(T)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let x=new qJ({filters:[a?(w,O)=>{let T=g(w,O),A=p(T)&&!m(T);return A&&bp(`matched ${T}`),A}:(w,O)=>{let T=g(w,O);return p(T)&&!m(T)}],exclude:a?(w,O)=>{let T=_(w,O);return bp(`${T?"skipped":"crawling"} ${O}`),T}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:S,signal:t.signal}).crawl(d);return t.debug&&bp("internal properties:",{...n,root:d}),[x,r!==d&&!o&&$Te(r,d)]}function jTe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function FTe(t){let e={...MTe,...t};return e.cwd=(e.cwd instanceof URL?_Te(e.cwd):yTe(e.cwd)).replace(g8,"/"),e.ignore=b8(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||uTe,readdirSync:e.fs.readdirSync||dTe,realpath:e.fs.realpath||fTe,realpathSync:e.fs.realpathSync||pTe,stat:e.fs.stat||mTe,statSync:e.fs.statSync||hTe}),e.debug&&bp("globbing with options:",e),e}function LTe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=bTe(t)||typeof t=="string",i=b8((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=FTe(n?e:t);return i.length>0?NTe(o,i):[]}function ys(t,e){let[r,n]=LTe(t,e);return r?jTe(r.sync(),n):[]}var Gl,bTe,g8,y8,vTe,wTe,xTe,kTe,ETe,ATe,TTe,OTe,RTe,PTe,CTe,MTe,vp=y(()=>{BJ();Gl=St(m8(),1),bTe=Array.isArray,g8=/\\/g,y8=process.platform==="win32",vTe=/^(\/?\.\.)+$/;wTe=/^[A-Z]:\/$/i,xTe=y8?t=>wTe.test(t):t=>t==="/";kTe={parts:!0};ETe=/(?t.replace(ETe,"\\$&"),OTe=t=>t.replace(ATe,"\\$&"),RTe=y8?OTe:TTe;PTe=/^(\/?\.\.)+/,CTe=/\\(?=[()[\]{}!*+?@|])/g;MTe={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as Sp,readFileSync as zTe,readdirSync as UTe,statSync as v8}from"node:fs";import{join as Ga}from"node:path";function qTe(t){let{cwd:e="."}=t,r,n;try{let c=q(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=Fi(e,n),o=[],{layers:s,forbiddenImports:a}=BP(r);return(s.size>0||a.length>0)&&!Sp(Ga(e,i.mainRoot))?[{detector:wp,severity:"info",path:`${i.mainRoot}/`,message:`architecture layers declared but ${i.mainRoot}/ not found \u2014 layer checks skipped (flat layout not yet supported)`}]:(s.size>0&&(BTe(e,i,s,o),HTe(e,i,s,o)),a.length>0&>e(e,i,a,o),o)}function BP(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function BTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of UTe(o)){let a=Ga(o,s);v8(a).isDirectory()&&(r.has(s)||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function HTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of r){let a=Ga(o,s);Sp(a)&&v8(a).isDirectory()||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function GTe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Ga(t,i,s.from);if(!Sp(a))continue;let c=ys([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Ga(a,l),d;try{d=zTe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];ZTe(p,s.to,e.importStyle)&&n.push({detector:wp,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function ZTe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var wp,S8,HP=y(()=>{"use strict";vp();Ue();Ba();wp="ARCHITECTURE_FROM_SPEC";S8={name:wp,run:qTe}});import{existsSync as VTe,readFileSync as WTe}from"node:fs";import{join as KTe}from"node:path";function YTe(t){let{cwd:e="."}=t,r=KTe(e,"spec/capabilities.yaml");if(!VTe(r))return[];let n;try{let u=WTe(r,"utf8"),d=w8.default.parse(u);if(!d||typeof d!="object")return[];n=d}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o,s=!1;try{let u=q(e);o=new Set(u.features.map(d=>d.id)),s=u.project.onboarding_seeded===!0}catch{return[]}let a=[],c=new Set,l=s&&o.size{"use strict";w8=St(er(),1);Ue();Lv="CAPABILITIES_FEATURE_MAPPING",JTe=8;x8={name:Lv,run:YTe}});import{existsSync as XTe,readFileSync as QTe}from"node:fs";import{join as eOe}from"node:path";function tOe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("#")||e.startsWith('"""')||e.startsWith("'''")}function rOe(t){let{cwd:e="."}=t;return ge(e,GP,r=>nOe(r,e))}function nOe(t,e){let r=Fi(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=eOe(e,o);if(!XTe(s))continue;let a=QTe(s,"utf8");tOe(a)||n.push({detector:GP,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var GP,k8,E8=y(()=>{"use strict";Ba();wt();GP="CONVENTION_DRIFT";k8={name:GP,run:rOe}});import{existsSync as ZP,readFileSync as A8}from"node:fs";import{join as zv}from"node:path";function iOe(t){return JSON.parse(t).total?.lines?.pct??0}function T8(t){let e=/]*\bline-rate="([0-9]*\.?[0-9]+)"/.exec(t);return e?Number(e[1])*100:null}function aOe(t,e){if(!$v(dt(t).gates.coverage?.cmd))return null;let r;try{r=kv(t,e)}catch(c){return[{detector:$o,severity:"error",message:c.message}]}let n=0,i=0,o=0,s=[];for(let c of r){let l=xP.find(d=>ZP(zv(c.dir,d)));if(!l){s.push(c.path);continue}let u=T8(A8(zv(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:$o,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=O8(n,i);return a0?[{detector:$o,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function cOe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let a=aOe(e,t.focusModules);if(a)return a}let r;try{r=q(e).project?.language}catch{}let n=Fi(e,r),i=dt(e).language==="kotlin"?xP.find(a=>ZP(zv(e,a)))??uJ(e):n.coverageSummary,o=zv(e,i);if(!ZP(o))return[{detector:$o,severity:"info",message:`${i} not present \u2014 run stage_2.2 first`}];let s;try{let a=A8(o,"utf8");s=n.coverageFormat==="jacoco-xml"?oOe(a):n.coverageFormat==="cobertura-xml"?sOe(a):iOe(a)}catch(a){return[{detector:$o,severity:"warn",message:`${i} unparseable: ${a.message}`}]}return s===null?n.coverageFormat==="cobertura-xml"?[]:[{detector:$o,severity:"warn",message:`${i} contained no line-coverage counter`}]:s>=Uv?[]:[{detector:$o,severity:"warn",message:`line coverage ${s.toFixed(1)}% < floor ${Uv}%`}]}var $o,Uv,R8,I8=y(()=>{"use strict";Ue();Tv();Ba();Ev();sn();$o="COVERAGE_DROP",Uv=70;R8={name:$o,run:cOe}});import{existsSync as lOe}from"node:fs";import{join as uOe}from"node:path";function fOe(t){let{cwd:e="."}=t;return ge(e,qv,r=>pOe(r,e))}function pOe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);if(!r){if(n.length===0)return[];let i=t.project.onboarding_seeded===!0&&t.features.length{"use strict";wt();qv="DELIVERABLE_INTEGRITY",dOe=8;P8={name:qv,run:fOe}});function mOe(t){let e=new Set((t.features??[]).map(n=>n.id)),r=[];for(let n of t.project?.smoke??[]){let i=n.feature;if(i===void 0||e.has(i))continue;let o=(n.run??[]).join(" ")||`kind:${n.kind}`;r.push({detector:Bv,severity:"warn",path:"spec.yaml",message:`smoke probe '${o}' binds feature ${i}, which is not in the spec \u2014 a dangling binding is annotation drift (the bound feature was renamed, archived, or never existed). Fix the id or drop the binding.`})}return r}function hOe(t){let e=mOe(t),r=(t.features??[]).filter(o=>o.status==="done");return r.length===0||!!!t.project?.deliverable||(t.project?.smoke??[]).length>0?e:[...e,{detector:Bv,severity:"warn",path:"spec.yaml",message:`${r.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function gOe(t){let{cwd:e="."}=t;return ge(e,Bv,r=>hOe(r))}var Bv,D8,N8=y(()=>{"use strict";wt();Bv="SMOKE_PROBE_DEMAND";D8={name:Bv,run:gOe}});function yOe(t){let{cwd:e="."}=t;return ge(e,Hv,r=>_Oe(r,e))}function _Oe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=as(e);if(n===null)return[{detector:Hv,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=H_(n,e,o);s.state!=="fresh"&&i.push({detector:Hv,severity:"warn",path:"spec/attestation.yaml",message:s.state==="unattested"?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:s.module?`${o.id}'s module ${s.module} changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var Hv,Gv,VP=y(()=>{"use strict";vl();wt();Hv="STALE_ATTESTATION";Gv={name:Hv,run:yOe}});function bOe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}return vOe(r)}function vOe(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:j8,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var j8,Zv,WP=y(()=>{"use strict";Ue();j8="DEPENDENCY_CYCLE";Zv={name:j8,run:bOe}});import{appendFileSync as SOe,existsSync as M8,mkdirSync as wOe,readFileSync as xOe}from"node:fs";import{dirname as $Oe,join as kOe}from"node:path";function F8(t){return kOe(t,EOe,AOe)}function L8(t){return KP.add(t),()=>KP.delete(t)}function Za(t,e){let r=F8(t),n=$Oe(r);M8(n)||wOe(n,{recursive:!0}),SOe(r,`${JSON.stringify(e)} +`);for(let u=0;u{"use strict";Ue();Ba();EJ="AI_HINTS_FORBIDDEN_PATTERN";AEe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;AJ={name:EJ,run:OEe}});function REe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:OJ,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var OJ,RJ,IJ=y(()=>{"use strict";Ue();OJ="AC_DUPLICATE_WITHIN_FEATURE";RJ={name:OJ,run:REe}});import{createRequire as IEe}from"module";import{basename as PEe,dirname as IP,normalize as CEe,relative as DEe,resolve as NEe,sep as DJ}from"path";import*as jEe from"fs";function MEe(t){let e=CEe(t);return e.length>1&&e[e.length-1]===DJ&&(e=e.substring(0,e.length-1)),e}function NJ(t,e){return t.replace(FEe,e)}function zEe(t){return t==="/"||LEe.test(t)}function RP(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=NEe(t)),(n||o)&&(t=MEe(t)),t===".")return"";let s=t[t.length-1]!==i;return NJ(s?t+i:t,i)}function jJ(t,e){return e+t}function UEe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:NJ(DEe(t,n),e.pathSeparator)+e.pathSeparator+r}}function qEe(t){return t}function BEe(t,e,r){return e+t+r}function HEe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?UEe(t,e):n?jJ:qEe}function GEe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function ZEe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function JEe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?ZEe(t):GEe(t):n&&n.length?WEe:VEe:KEe}function rAe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?tAe:r&&r.length?n?YEe:XEe:n?QEe:eAe}function oAe(t){return t.group?iAe:nAe}function cAe(t){return t.group?sAe:aAe}function dAe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?uAe:lAe}function MJ(t,e,r){if(r.options.useRealPaths)return fAe(e,r);let n=IP(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=IP(n)}return r.symlinks.set(t,e),i>1}function fAe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function Mv(t,e,r,n){e(t&&!n?t:null,r)}function SAe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?pAe:yAe:n?e?mAe:vAe:i?e?gAe:bAe:e?hAe:_Ae}function $Ae(t){return t?xAe:wAe}function TAe(t,e){return new Promise((r,n)=>{zJ(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function zJ(t,e,r){new LJ(t,e,r).start()}function OAe(t,e){return new LJ(t,e).start()}var PJ,FEe,LEe,VEe,WEe,KEe,YEe,XEe,QEe,eAe,tAe,nAe,iAe,sAe,aAe,lAe,uAe,pAe,mAe,hAe,gAe,yAe,_Ae,bAe,vAe,FJ,wAe,xAe,kAe,EAe,AAe,LJ,CJ,UJ,qJ,BJ=y(()=>{PJ=IEe(import.meta.url);FEe=/[\\/]/g;LEe=/^[a-z]:[\\/]$/i;VEe=(t,e)=>{e.push(t||".")},WEe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},KEe=()=>{};YEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},XEe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},QEe=(t,e,r,n)=>{r.files++},eAe=(t,e)=>{e.push(t)},tAe=()=>{};nAe=t=>t,iAe=()=>[""].slice(0,0);sAe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},aAe=()=>{};lAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&MJ(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},uAe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&MJ(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};pAe=t=>t.counts,mAe=t=>t.groups,hAe=t=>t.paths,gAe=t=>t.paths.slice(0,t.options.maxFiles),yAe=(t,e,r)=>(Mv(e,r,t.counts,t.options.suppressErrors),null),_Ae=(t,e,r)=>(Mv(e,r,t.paths,t.options.suppressErrors),null),bAe=(t,e,r)=>(Mv(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),vAe=(t,e,r)=>(Mv(e,r,t.groups,t.options.suppressErrors),null);FJ={withFileTypes:!0},wAe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",FJ,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},xAe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",FJ)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};kAe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},EAe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},AAe=class{aborted=!1;abort(){this.aborted=!0}},LJ=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=SAe(e,this.isSynchronous),this.root=RP(t,e),this.state={root:zEe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new EAe,options:e,queue:new kAe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new AAe,fs:e.fs||jEe},this.joinPath=HEe(this.root,e),this.pushDirectory=JEe(this.root,e),this.pushFile=rAe(e),this.getArray=oAe(e),this.groupFiles=cAe(e),this.resolveSymlink=dAe(e,this.isSynchronous),this.walkDirectory=$Ae(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(b.isDirectory()){if(_=RP(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let S=PEe(_),x=RP(IP(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};CJ=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return TAe(this.root,this.options)}withCallback(t){zJ(this.root,this.options,t)}sync(){return OAe(this.root,this.options)}},UJ=null;try{PJ.resolve("picomatch"),UJ=PJ("picomatch")}catch{}qJ=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:DJ,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new CJ(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new CJ(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||UJ;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var hp=v((ndt,WJ)=>{"use strict";var HJ="[^\\\\/]",RAe="(?=.)",GJ="[^/]",PP="(?:\\/|$)",ZJ="(?:^|\\/)",CP=`\\.{1,2}${PP}`,IAe="(?!\\.)",PAe=`(?!${ZJ}${CP})`,CAe=`(?!\\.{0,1}${PP})`,DAe=`(?!${CP})`,NAe="[^.\\/]",jAe=`${GJ}*?`,MAe="/",VJ={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:RAe,QMARK:GJ,END_ANCHOR:PP,DOTS_SLASH:CP,NO_DOT:IAe,NO_DOTS:PAe,NO_DOT_SLASH:CAe,NO_DOTS_SLASH:DAe,QMARK_NO_DOT:NAe,STAR:jAe,START_ANCHOR:ZJ,SEP:MAe},FAe={...VJ,SLASH_LITERAL:"[\\\\/]",QMARK:HJ,STAR:`${HJ}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},LAe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};WJ.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:LAe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?FAe:VJ}}});var gp=v(Fr=>{"use strict";var{REGEX_BACKSLASH:zAe,REGEX_REMOVE_BACKSLASH:UAe,REGEX_SPECIAL_CHARS:qAe,REGEX_SPECIAL_CHARS_GLOBAL:BAe}=hp();Fr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Fr.hasRegexChars=t=>qAe.test(t);Fr.isRegexChar=t=>t.length===1&&Fr.hasRegexChars(t);Fr.escapeRegex=t=>t.replace(BAe,"\\$1");Fr.toPosixSlashes=t=>t.replace(zAe,"/");Fr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Fr.removeBackslashes=t=>t.replace(UAe,e=>e==="\\"?"":e);Fr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Fr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Fr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Fr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Fr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var r8=v((odt,t8)=>{"use strict";var KJ=gp(),{CHAR_ASTERISK:DP,CHAR_AT:HAe,CHAR_BACKWARD_SLASH:yp,CHAR_COMMA:GAe,CHAR_DOT:NP,CHAR_EXCLAMATION_MARK:jP,CHAR_FORWARD_SLASH:e8,CHAR_LEFT_CURLY_BRACE:MP,CHAR_LEFT_PARENTHESES:FP,CHAR_LEFT_SQUARE_BRACKET:ZAe,CHAR_PLUS:VAe,CHAR_QUESTION_MARK:JJ,CHAR_RIGHT_CURLY_BRACE:WAe,CHAR_RIGHT_PARENTHESES:YJ,CHAR_RIGHT_SQUARE_BRACKET:KAe}=hp(),XJ=t=>t===e8||t===yp,QJ=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},JAe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,b=!1,_=!1,S=!1,x=!1,w=!1,O=0,T,A,D={value:"",depth:0,isGlob:!1},$=()=>l>=n,re=()=>c.charCodeAt(l+1),K=()=>(T=A,c.charCodeAt(++l));for(;l0&&(C=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),P=c.slice(d)):m===!0?(xe="",P=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&XJ(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(P&&(P=KJ.removeBackslashes(P)),xe&&_===!0&&(xe=KJ.removeBackslashes(xe)));let Ir={prefix:C,input:t,start:u,base:xe,glob:P,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&(Ir.maxDepth=0,XJ(A)||s.push(D),Ir.tokens=s),r.parts===!0||r.tokens===!0){let se;for(let Ce=0;Ce{"use strict";var _p=hp(),an=gp(),{MAX_LENGTH:Fv,POSIX_REGEX_SOURCE:YAe,REGEX_NON_SPECIAL_CHARS:XAe,REGEX_SPECIAL_CHARS_BACKREF:QAe,REPLACEMENTS:n8}=_p,eTe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>an.escapeRegex(i)).join("..")}return r},Hl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,i8=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},tTe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},o8=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(tTe(e))return e.replace(/\\(.)/g,"$1")},rTe=t=>{let e=t.map(o8).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},nTe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=o8(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?an.escapeRegex(r[0]):`[${r.map(i=>an.escapeRegex(i)).join("")}]`}*`},iTe=t=>{let e=0,r=t.trim(),n=LP(r);for(;n;)e++,r=n.body.trim(),n=LP(r);return e},oTe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:_p.DEFAULT_MAX_EXTGLOB_RECURSION,n=i8(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||rTe(n)))return{risky:!0};for(let i of n){let o=nTe(i);if(o)return{risky:!0,safeOutput:o};if(iTe(i)>r)return{risky:!0}}return{risky:!1}},zP=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=n8[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Fv,r.maxLength):Fv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=_p.globChars(r.windows),l=_p.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:b,QMARK:_,QMARK_NO_DOT:S,STAR:x,START_ANCHOR:w}=c,O=H=>`(${a}(?:(?!${w}${H.dot?m:u}).)*?)`,T=r.dot?"":h,A=r.dot?_:S,D=r.bash===!0?O(r):x;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let $={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=an.removePrefix(t,$),i=t.length;let re=[],K=[],xe=[],C=o,P,Ir=()=>$.index===i-1,se=$.peek=(H=1)=>t[$.index+H],Ce=$.advance=()=>t[++$.index]||"",Kt=()=>t.slice($.index+1),dr=(H="",ht=0)=>{$.consumed+=H,$.index+=ht},Xt=H=>{$.output+=H.output!=null?H.output:H.value,dr(H.value)},lo=()=>{let H=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)Ce(),$.start++,H++;return H%2===0?!1:($.negated=!0,$.start++,!0)},$i=H=>{$[H]++,xe.push(H)},Xr=H=>{$[H]--,xe.pop()},de=H=>{if(C.type==="globstar"){let ht=$.braces>0&&(H.type==="comma"||H.type==="brace"),B=H.extglob===!0||re.length&&(H.type==="pipe"||H.type==="paren");H.type!=="slash"&&H.type!=="paren"&&!ht&&!B&&($.output=$.output.slice(0,-C.output.length),C.type="star",C.value="*",C.output=D,$.output+=C.output)}if(re.length&&H.type!=="paren"&&(re[re.length-1].inner+=H.value),(H.value||H.output)&&Xt(H),C&&C.type==="text"&&H.type==="text"){C.output=(C.output||C.value)+H.value,C.value+=H.value;return}H.prev=C,s.push(H),C=H},uo=(H,ht)=>{let B={...l[ht],conditions:1,inner:""};B.prev=C,B.parens=$.parens,B.output=$.output,B.startIndex=$.index,B.tokensIndex=s.length;let Oe=(r.capture?"(":"")+B.open;$i("parens"),de({type:H,value:ht,output:$.output?"":p}),de({type:"paren",extglob:!0,value:Ce(),output:Oe}),re.push(B)},Mde=H=>{let ht=t.slice(H.startIndex,$.index+1),B=t.slice(H.startIndex+2,$.index),Oe=oTe(B,r);if((H.type==="plus"||H.type==="star")&&Oe.risky){let lt=Oe.safeOutput?(H.output?"":p)+(r.capture?`(${Oe.safeOutput})`:Oe.safeOutput):void 0,ki=s[H.tokensIndex];ki.type="text",ki.value=ht,ki.output=lt||an.escapeRegex(ht);for(let Ei=H.tokensIndex+1;Ei1&&H.inner.includes("/")&&(lt=O(r)),(lt!==D||Ir()||/^\)+$/.test(Kt()))&&(ut=H.close=`)$))${lt}`),H.inner.includes("*")&&(zt=Kt())&&/^\.[^\\/.]+$/.test(zt)){let ki=zP(zt,{...e,fastpaths:!1}).output;ut=H.close=`)${ki})${lt})`}H.prev.type==="bos"&&($.negatedExtglob=!0)}de({type:"paren",extglob:!0,value:P,output:ut}),Xr("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let H=!1,ht=t.replace(QAe,(B,Oe,ut,zt,lt,ki)=>zt==="\\"?(H=!0,B):zt==="?"?Oe?Oe+zt+(lt?_.repeat(lt.length):""):ki===0?A+(lt?_.repeat(lt.length):""):_.repeat(ut.length):zt==="."?u.repeat(ut.length):zt==="*"?Oe?Oe+zt+(lt?D:""):D:Oe?B:`\\${B}`);return H===!0&&(r.unescape===!0?ht=ht.replace(/\\/g,""):ht=ht.replace(/\\+/g,B=>B.length%2===0?"\\\\":B?"\\":"")),ht===t&&r.contains===!0?($.output=t,$):($.output=an.wrapOutput(ht,$,e),$)}for(;!Ir();){if(P=Ce(),P==="\0")continue;if(P==="\\"){let B=se();if(B==="/"&&r.bash!==!0||B==="."||B===";")continue;if(!B){P+="\\",de({type:"text",value:P});continue}let Oe=/^\\+/.exec(Kt()),ut=0;if(Oe&&Oe[0].length>2&&(ut=Oe[0].length,$.index+=ut,ut%2!==0&&(P+="\\")),r.unescape===!0?P=Ce():P+=Ce(),$.brackets===0){de({type:"text",value:P});continue}}if($.brackets>0&&(P!=="]"||C.value==="["||C.value==="[^")){if(r.posix!==!1&&P===":"){let B=C.value.slice(1);if(B.includes("[")&&(C.posix=!0,B.includes(":"))){let Oe=C.value.lastIndexOf("["),ut=C.value.slice(0,Oe),zt=C.value.slice(Oe+2),lt=YAe[zt];if(lt){C.value=ut+lt,$.backtrack=!0,Ce(),!o.output&&s.indexOf(C)===1&&(o.output=p);continue}}}(P==="["&&se()!==":"||P==="-"&&se()==="]")&&(P=`\\${P}`),P==="]"&&(C.value==="["||C.value==="[^")&&(P=`\\${P}`),r.posix===!0&&P==="!"&&C.value==="["&&(P="^"),C.value+=P,Xt({value:P});continue}if($.quotes===1&&P!=='"'){P=an.escapeRegex(P),C.value+=P,Xt({value:P});continue}if(P==='"'){$.quotes=$.quotes===1?0:1,r.keepQuotes===!0&&de({type:"text",value:P});continue}if(P==="("){$i("parens"),de({type:"paren",value:P});continue}if(P===")"){if($.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Hl("opening","("));let B=re[re.length-1];if(B&&$.parens===B.parens+1){Mde(re.pop());continue}de({type:"paren",value:P,output:$.parens?")":"\\)"}),Xr("parens");continue}if(P==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Hl("closing","]"));P=`\\${P}`}else $i("brackets");de({type:"bracket",value:P});continue}if(P==="]"){if(r.nobracket===!0||C&&C.type==="bracket"&&C.value.length===1){de({type:"text",value:P,output:`\\${P}`});continue}if($.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Hl("opening","["));de({type:"text",value:P,output:`\\${P}`});continue}Xr("brackets");let B=C.value.slice(1);if(C.posix!==!0&&B[0]==="^"&&!B.includes("/")&&(P=`/${P}`),C.value+=P,Xt({value:P}),r.literalBrackets===!1||an.hasRegexChars(B))continue;let Oe=an.escapeRegex(C.value);if($.output=$.output.slice(0,-C.value.length),r.literalBrackets===!0){$.output+=Oe,C.value=Oe;continue}C.value=`(${a}${Oe}|${C.value})`,$.output+=C.value;continue}if(P==="{"&&r.nobrace!==!0){$i("braces");let B={type:"brace",value:P,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};K.push(B),de(B);continue}if(P==="}"){let B=K[K.length-1];if(r.nobrace===!0||!B){de({type:"text",value:P,output:P});continue}let Oe=")";if(B.dots===!0){let ut=s.slice(),zt=[];for(let lt=ut.length-1;lt>=0&&(s.pop(),ut[lt].type!=="brace");lt--)ut[lt].type!=="dots"&&zt.unshift(ut[lt].value);Oe=eTe(zt,r),$.backtrack=!0}if(B.comma!==!0&&B.dots!==!0){let ut=$.output.slice(0,B.outputIndex),zt=$.tokens.slice(B.tokensIndex);B.value=B.output="\\{",P=Oe="\\}",$.output=ut;for(let lt of zt)$.output+=lt.output||lt.value}de({type:"brace",value:P,output:Oe}),Xr("braces"),K.pop();continue}if(P==="|"){re.length>0&&re[re.length-1].conditions++,de({type:"text",value:P});continue}if(P===","){let B=P,Oe=K[K.length-1];Oe&&xe[xe.length-1]==="braces"&&(Oe.comma=!0,B="|"),de({type:"comma",value:P,output:B});continue}if(P==="/"){if(C.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",s.pop(),C=o;continue}de({type:"slash",value:P,output:f});continue}if(P==="."){if($.braces>0&&C.type==="dot"){C.value==="."&&(C.output=u);let B=K[K.length-1];C.type="dots",C.output+=P,C.value+=P,B.dots=!0;continue}if($.braces+$.parens===0&&C.type!=="bos"&&C.type!=="slash"){de({type:"text",value:P,output:u});continue}de({type:"dot",value:P,output:u});continue}if(P==="?"){if(!(C&&C.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("qmark",P);continue}if(C&&C.type==="paren"){let Oe=se(),ut=P;(C.value==="("&&!/[!=<:]/.test(Oe)||Oe==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(ut=`\\${P}`),de({type:"text",value:P,output:ut});continue}if(r.dot!==!0&&(C.type==="slash"||C.type==="bos")){de({type:"qmark",value:P,output:S});continue}de({type:"qmark",value:P,output:_});continue}if(P==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){uo("negate",P);continue}if(r.nonegate!==!0&&$.index===0){lo();continue}}if(P==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){uo("plus",P);continue}if(C&&C.value==="("||r.regex===!1){de({type:"plus",value:P,output:d});continue}if(C&&(C.type==="bracket"||C.type==="paren"||C.type==="brace")||$.parens>0){de({type:"plus",value:P});continue}de({type:"plus",value:d});continue}if(P==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){de({type:"at",extglob:!0,value:P,output:""});continue}de({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let B=XAe.exec(Kt());B&&(P+=B[0],$.index+=B[0].length),de({type:"text",value:P});continue}if(C&&(C.type==="globstar"||C.star===!0)){C.type="star",C.star=!0,C.value+=P,C.output=D,$.backtrack=!0,$.globstar=!0,dr(P);continue}let H=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(H)){uo("star",P);continue}if(C.type==="star"){if(r.noglobstar===!0){dr(P);continue}let B=C.prev,Oe=B.prev,ut=B.type==="slash"||B.type==="bos",zt=Oe&&(Oe.type==="star"||Oe.type==="globstar");if(r.bash===!0&&(!ut||H[0]&&H[0]!=="/")){de({type:"star",value:P,output:""});continue}let lt=$.braces>0&&(B.type==="comma"||B.type==="brace"),ki=re.length&&(B.type==="pipe"||B.type==="paren");if(!ut&&B.type!=="paren"&&!lt&&!ki){de({type:"star",value:P,output:""});continue}for(;H.slice(0,3)==="/**";){let Ei=t[$.index+4];if(Ei&&Ei!=="/")break;H=H.slice(3),dr("/**",3)}if(B.type==="bos"&&Ir()){C.type="globstar",C.value+=P,C.output=O(r),$.output=C.output,$.globstar=!0,dr(P);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&!zt&&Ir()){$.output=$.output.slice(0,-(B.output+C.output).length),B.output=`(?:${B.output}`,C.type="globstar",C.output=O(r)+(r.strictSlashes?")":"|$)"),C.value+=P,$.globstar=!0,$.output+=B.output+C.output,dr(P);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&H[0]==="/"){let Ei=H[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(B.output+C.output).length),B.output=`(?:${B.output}`,C.type="globstar",C.output=`${O(r)}${f}|${f}${Ei})`,C.value+=P,$.output+=B.output+C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}if(B.type==="bos"&&H[0]==="/"){C.type="globstar",C.value+=P,C.output=`(?:^|${f}|${O(r)}${f})`,$.output=C.output,$.globstar=!0,dr(P+Ce()),de({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-C.output.length),C.type="globstar",C.output=O(r),C.value+=P,$.output+=C.output,$.globstar=!0,dr(P);continue}let ht={type:"star",value:P,output:D};if(r.bash===!0){ht.output=".*?",(C.type==="bos"||C.type==="slash")&&(ht.output=T+ht.output),de(ht);continue}if(C&&(C.type==="bracket"||C.type==="paren")&&r.regex===!0){ht.output=P,de(ht);continue}($.index===$.start||C.type==="slash"||C.type==="dot")&&(C.type==="dot"?($.output+=g,C.output+=g):r.dot===!0?($.output+=b,C.output+=b):($.output+=T,C.output+=T),se()!=="*"&&($.output+=p,C.output+=p)),de(ht)}for(;$.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing","]"));$.output=an.escapeLast($.output,"["),Xr("brackets")}for(;$.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing",")"));$.output=an.escapeLast($.output,"("),Xr("parens")}for(;$.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Hl("closing","}"));$.output=an.escapeLast($.output,"{"),Xr("braces")}if(r.strictSlashes!==!0&&(C.type==="star"||C.type==="bracket")&&de({type:"maybe_slash",value:"",output:`${f}?`}),$.backtrack===!0){$.output="";for(let H of $.tokens)$.output+=H.output!=null?H.output:H.value,H.suffix&&($.output+=H.suffix)}return $};zP.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Fv,r.maxLength):Fv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=n8[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=_p.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=T=>T.noglobstar===!0?_:`(${g}(?:(?!${p}${T.dot?c:o}).)*?)`,x=T=>{switch(T){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${S(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${S(r)}${s})?${o}${a}${_}`;default:{let A=/^(.*?)\.(\w+)$/.exec(T);if(!A)return;let D=x(A[1]);return D?D+o+A[2]:void 0}}},w=an.removePrefix(t,b),O=x(w);return O&&r.strictSlashes!==!0&&(O+=`${s}?`),O};s8.exports=zP});var u8=v((adt,l8)=>{"use strict";var sTe=r8(),UP=a8(),c8=gp(),aTe=hp(),cTe=t=>t&&typeof t=="object"&&!Array.isArray(t),Rt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Rt(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=cTe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?Rt.compileRe(t,e):Rt.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Rt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Rt.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};Rt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?c8.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Rt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Rt.matchBase=(t,e,r)=>(e instanceof RegExp?e:Rt.makeRe(e,r)).test(c8.basename(t));Rt.isMatch=(t,e,r)=>Rt(e,r)(t);Rt.parse=(t,e)=>Array.isArray(t)?t.map(r=>Rt.parse(r,e)):UP(t,{...e,fastpaths:!1});Rt.scan=(t,e)=>sTe(t,e);Rt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Rt.toRegex(a,e);return n===!0&&(c.state=t),c};Rt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=UP.fastpaths(t,e)),i.output||(i=UP(t,e)),Rt.compileRe(i,e,r,n)};Rt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Rt.constants=aTe;l8.exports=Rt});var m8=v((cdt,p8)=>{"use strict";var d8=u8(),lTe=gp();function f8(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:lTe.isWindows()}),d8(t,e,r)}Object.assign(f8,d8);p8.exports=f8});import{readdir as uTe,readdirSync as dTe,realpath as fTe,realpathSync as pTe,stat as mTe,statSync as hTe}from"fs";import{isAbsolute as gTe,posix as Ha,resolve as yTe}from"path";import{fileURLToPath as _Te}from"url";function STe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&vTe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>Ha.relative(t,n)||".":n=>Ha.relative(t,`${e}/${n}`)||"."}function $Te(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=Ha.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function _8(t){var e;let r=Gl.default.scan(t,kTe);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function ITe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Gl.default.scan(t);return r.isGlob||r.negated}function bp(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function b8(t){return typeof t=="string"?[t]:t??[]}function qP(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=RTe(o);s=gTe(s.replace(CTe,""))?Ha.relative(a,s):Ha.normalize(s);let c=(i=PTe.exec(s))===null||i===void 0?void 0:i[0],l=_8(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?Ha.join(o,...d):o}return s}function DTe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(qP(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(qP(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(qP(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function NTe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=DTe(t,e,n);t.debug&&bp("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(g8,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Gl.default)(i.match,f),m=(0,Gl.default)(i.ignore,f),h=STe(i.match,f),g=h8(r,d,o),b=o?g:h8(r,d,!0),_=(w,O)=>{let T=b(O,!0);return T!=="."&&!h(T)||m(T)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let x=new qJ({filters:[a?(w,O)=>{let T=g(w,O),A=p(T)&&!m(T);return A&&bp(`matched ${T}`),A}:(w,O)=>{let T=g(w,O);return p(T)&&!m(T)}],exclude:a?(w,O)=>{let T=_(w,O);return bp(`${T?"skipped":"crawling"} ${O}`),T}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:S,signal:t.signal}).crawl(d);return t.debug&&bp("internal properties:",{...n,root:d}),[x,r!==d&&!o&&$Te(r,d)]}function jTe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function FTe(t){let e={...MTe,...t};return e.cwd=(e.cwd instanceof URL?_Te(e.cwd):yTe(e.cwd)).replace(g8,"/"),e.ignore=b8(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||uTe,readdirSync:e.fs.readdirSync||dTe,realpath:e.fs.realpath||fTe,realpathSync:e.fs.realpathSync||pTe,stat:e.fs.stat||mTe,statSync:e.fs.statSync||hTe}),e.debug&&bp("globbing with options:",e),e}function LTe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=bTe(t)||typeof t=="string",i=b8((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=FTe(n?e:t);return i.length>0?NTe(o,i):[]}function ys(t,e){let[r,n]=LTe(t,e);return r?jTe(r.sync(),n):[]}var Gl,bTe,g8,y8,vTe,wTe,xTe,kTe,ETe,ATe,TTe,OTe,RTe,PTe,CTe,MTe,vp=y(()=>{BJ();Gl=St(m8(),1),bTe=Array.isArray,g8=/\\/g,y8=process.platform==="win32",vTe=/^(\/?\.\.)+$/;wTe=/^[A-Z]:\/$/i,xTe=y8?t=>wTe.test(t):t=>t==="/";kTe={parts:!0};ETe=/(?t.replace(ETe,"\\$&"),OTe=t=>t.replace(ATe,"\\$&"),RTe=y8?OTe:TTe;PTe=/^(\/?\.\.)+/,CTe=/\\(?=[()[\]{}!*+?@|])/g;MTe={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as Sp,readFileSync as zTe,readdirSync as UTe,statSync as v8}from"node:fs";import{join as Ga}from"node:path";function qTe(t){let{cwd:e="."}=t,r,n;try{let c=q(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=Fi(e,n),o=[],{layers:s,forbiddenImports:a}=BP(r);return(s.size>0||a.length>0)&&!Sp(Ga(e,i.mainRoot))?[{detector:wp,severity:"info",path:`${i.mainRoot}/`,message:`architecture layers declared but ${i.mainRoot}/ not found \u2014 layer checks skipped (flat layout not yet supported)`}]:(s.size>0&&(BTe(e,i,s,o),HTe(e,i,s,o)),a.length>0&>e(e,i,a,o),o)}function BP(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function BTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of UTe(o)){let a=Ga(o,s);v8(a).isDirectory()&&(r.has(s)||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function HTe(t,e,r,n){let i=e.mainRoot,o=Ga(t,i);if(Sp(o))for(let s of r){let a=Ga(o,s);Sp(a)&&v8(a).isDirectory()||n.push({detector:wp,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function GTe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Ga(t,i,s.from);if(!Sp(a))continue;let c=ys([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Ga(a,l),d;try{d=zTe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];ZTe(p,s.to,e.importStyle)&&n.push({detector:wp,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function ZTe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var wp,S8,HP=y(()=>{"use strict";vp();Ue();Ba();wp="ARCHITECTURE_FROM_SPEC";S8={name:wp,run:qTe}});import{existsSync as VTe,readFileSync as WTe}from"node:fs";import{join as KTe}from"node:path";function YTe(t){let{cwd:e="."}=t,r=KTe(e,"spec/capabilities.yaml");if(!VTe(r))return[];let n;try{let u=WTe(r,"utf8"),d=w8.default.parse(u);if(!d||typeof d!="object")return[];n=d}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o,s=!1;try{let u=q(e);o=new Set(u.features.map(d=>d.id)),s=u.project.onboarding_seeded===!0}catch{return[]}let a=[],c=new Set,l=s&&o.size{"use strict";w8=St(er(),1);Ue();Lv="CAPABILITIES_FEATURE_MAPPING",JTe=8;x8={name:Lv,run:YTe}});import{existsSync as XTe,readFileSync as QTe}from"node:fs";import{join as eOe}from"node:path";function tOe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("#")||e.startsWith('"""')||e.startsWith("'''")}function rOe(t){let{cwd:e="."}=t;return ge(e,GP,r=>nOe(r,e))}function nOe(t,e){let r=Fi(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=eOe(e,o);if(!XTe(s))continue;let a=QTe(s,"utf8");tOe(a)||n.push({detector:GP,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var GP,k8,E8=y(()=>{"use strict";Ba();wt();GP="CONVENTION_DRIFT";k8={name:GP,run:rOe}});import{existsSync as ZP,readFileSync as A8}from"node:fs";import{join as zv}from"node:path";function iOe(t){return JSON.parse(t).total?.lines?.pct??0}function T8(t){let e=/]*\bline-rate="([0-9]*\.?[0-9]+)"/.exec(t);return e?Number(e[1])*100:null}function aOe(t,e){if(!$v(dt(t).gates.coverage?.cmd))return null;let r;try{r=kv(t,e)}catch(c){return[{detector:$o,severity:"error",message:c.message}]}let n=0,i=0,o=0,s=[];for(let c of r){let l=xP.find(d=>ZP(zv(c.dir,d)));if(!l){s.push(c.path);continue}let u=T8(A8(zv(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:$o,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=O8(n,i);return a0?[{detector:$o,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function cOe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let a=aOe(e,t.focusModules);if(a)return a}let r;try{r=q(e).project?.language}catch{}let n=Fi(e,r),i=dt(e).language==="kotlin"?xP.find(a=>ZP(zv(e,a)))??uJ(e):n.coverageSummary,o=zv(e,i);if(!ZP(o))return[{detector:$o,severity:"info",message:`${i} not present \u2014 run stage_2.2 first`}];let s;try{let a=A8(o,"utf8");s=n.coverageFormat==="jacoco-xml"?oOe(a):n.coverageFormat==="cobertura-xml"?sOe(a):iOe(a)}catch(a){return[{detector:$o,severity:"warn",message:`${i} unparseable: ${a.message}`}]}return s===null?n.coverageFormat==="cobertura-xml"?[]:[{detector:$o,severity:"warn",message:`${i} contained no line-coverage counter`}]:s>=Uv?[]:[{detector:$o,severity:"warn",message:`line coverage ${s.toFixed(1)}% < floor ${Uv}%`}]}var $o,Uv,R8,I8=y(()=>{"use strict";Ue();Tv();Ba();Ev();sn();$o="COVERAGE_DROP",Uv=70;R8={name:$o,run:cOe}});import{existsSync as lOe}from"node:fs";import{join as uOe}from"node:path";function fOe(t){let{cwd:e="."}=t;return ge(e,qv,r=>pOe(r,e))}function pOe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);if(!r){if(n.length===0)return[];let i=t.project.onboarding_seeded===!0&&t.features.length{"use strict";wt();qv="DELIVERABLE_INTEGRITY",dOe=8;P8={name:qv,run:fOe}});function mOe(t){let e=new Set((t.features??[]).map(n=>n.id)),r=[];for(let n of t.project?.smoke??[]){let i=n.feature;if(i===void 0||e.has(i))continue;let o=(n.run??[]).join(" ")||`kind:${n.kind}`;r.push({detector:Bv,severity:"warn",path:"spec.yaml",message:`smoke probe '${o}' binds feature ${i}, which is not in the spec \u2014 a dangling binding is annotation drift (the bound feature was renamed, archived, or never existed). Fix the id or drop the binding.`})}return r}function hOe(t){let e=mOe(t),r=(t.features??[]).filter(o=>o.status==="done");return r.length===0||!!!t.project?.deliverable||(t.project?.smoke??[]).length>0?e:[...e,{detector:Bv,severity:"warn",path:"spec.yaml",message:`${r.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function gOe(t){let{cwd:e="."}=t;return ge(e,Bv,r=>hOe(r))}var Bv,D8,N8=y(()=>{"use strict";wt();Bv="SMOKE_PROBE_DEMAND";D8={name:Bv,run:gOe}});function yOe(t){let{cwd:e="."}=t;return ge(e,Hv,r=>_Oe(r,e))}function _Oe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=as(e);if(n===null)return[{detector:Hv,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=H_(n,e,o);s.state!=="fresh"&&i.push({detector:Hv,severity:"warn",path:"spec/attestation.yaml",message:s.state==="unattested"?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:s.module?`${o.id}'s module ${s.module} changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var Hv,Gv,VP=y(()=>{"use strict";vl();wt();Hv="STALE_ATTESTATION";Gv={name:Hv,run:yOe}});function bOe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}return vOe(r)}function vOe(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:j8,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var j8,Zv,WP=y(()=>{"use strict";Ue();j8="DEPENDENCY_CYCLE";Zv={name:j8,run:bOe}});import{appendFileSync as SOe,existsSync as M8,mkdirSync as wOe,readFileSync as xOe}from"node:fs";import{dirname as $Oe,join as kOe}from"node:path";function F8(t){return kOe(t,EOe,AOe)}function L8(t){return KP.add(t),()=>KP.delete(t)}function Za(t,e){let r=F8(t),n=$Oe(r);M8(n)||wOe(n,{recursive:!0}),SOe(r,`${JSON.stringify(e)} `,"utf8");for(let i of KP)try{i(t,e)}catch{}}function In(t){let e=F8(t);if(!M8(e))return[];let r=xOe(e,"utf8").trim();return r.length===0?[]:r.split(` `).filter(n=>n.length>0).map(n=>JSON.parse(n))}var EOe,AOe,KP,ni=y(()=>{"use strict";EOe=".cladding",AOe="audit.log.jsonl";KP=new Set});import{existsSync as TOe}from"node:fs";import{join as OOe}from"node:path";function ROe(t){let{cwd:e="."}=t,r=In(e);if(r.length===0)return[{detector:JP,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=[];for(let i of r)i.artifact&&(TOe(OOe(e,i.artifact))||n.push({detector:JP,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var JP,z8,U8=y(()=>{"use strict";ni();JP="EVIDENCE_MISMATCH";z8={name:JP,run:ROe}});import{existsSync as IOe,readFileSync as POe}from"node:fs";import{join as COe}from"node:path";function DOe(t){let e=COe(t,G8);if(!IOe(e))return null;try{let n=((0,H8.parse)(POe(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*B8(t,e){for(let r of t??[])r.startsWith(q8)&&(yield{ref:r,name:r.slice(q8.length),field:e})}function NOe(t){let{cwd:e="."}=t,r=DOe(e);if(r===null)return[];let n;try{n=q(e)}catch(o){return[{detector:YP,severity:"info",message:`spec.yaml not loaded: ${o.message}`}]}let i=[];for(let o of n.features)for(let s of o.acceptance_criteria??[]){let a=[...B8(s.evidence_refs,"evidence_refs"),...B8(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:YP,severity:"warn",path:G8,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var H8,YP,q8,G8,Z8,V8=y(()=>{"use strict";H8=St(er(),1);Ue();YP="FIXTURE_REFERENCE_INVALID",q8="fixture:",G8="conformance/fixtures.yaml";Z8={name:YP,run:NOe}});import{existsSync as Zl,readFileSync as XP}from"node:fs";import{join as Va}from"node:path";function jOe(t){return ys(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec|spec-first-window)\.ts$/.test(r)).length}function xp(t){if(!Zl(t))return null;try{return JSON.parse(XP(t,"utf8"))}catch{return null}}function MOe(t,e){let r=Va(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(XP(r,"utf8"))}catch(c){e.push({detector:ko,severity:"info",message:`plugin.json not loaded: ${c.message}`});return}let i=n.ironclad?.current?.detectors;if(!i)return;let o=i.match(/^(\d+)\/(\d+)$/);if(!o){e.push({detector:ko,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=jOe(t);s!==a&&e.push({detector:ko,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function FOe(t,e){for(let r of W8){let n=Va(t,r.path);if(!Zl(n))continue;let i=xp(n);if(!i){e.push({detector:ko,severity:"warn",message:`${r.host}: ${r.path} could not be parsed as JSON`});continue}for(let o of r.required)(i[o]===void 0||i[o]===null||i[o]==="")&&e.push({detector:ko,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function LOe(t,e){let r=xp(Va(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of W8){let s=Va(t,o.path);if(!Zl(s))continue;let a=xp(s);a?.version&&a.version!==n&&e.push({detector:ko,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=Va(t,".claude-plugin","marketplace.json");if(Zl(i)){let o=xp(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:ko,severity:"error",message:`marketplace: .claude-plugin/marketplace.json plugin '${s.name??"?"}' version='${s.version}' but package.json version='${n}' \u2014 the catalog advertises a stale version; bump it in lockstep`})}}function zOe(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function UOe(t,e){let r=Va(t,"src","cli","clad.ts"),n=Va(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!Zl(r)||!Zl(n))return;let i=zOe(XP(r,"utf8"));if(i.length===0)return;let s=xp(n)?.ironclad?.current?.["stages-implemented"];if(!Array.isArray(s))return;let a=new Set(i),c=new Set(s),l=i.filter(f=>!c.has(f)),u=s.filter(f=>!a.has(f));if(l.length===0&&u.length===0)return;let d=[l.length?`missing [${l.join(", ")}]`:"",u.length?`unexpected [${u.join(", ")}]`:""].filter(Boolean).join("; ");e.push({detector:ko,severity:"error",message:`plugins/claude-code/.claude-plugin/plugin.json stages-implemented disagrees with TIER_STAGES.all (src/cli/clad.ts): ${d} \u2014 run \`npm run build:plugin\` to re-derive`})}function qOe(t){let{cwd:e="."}=t,r=[];return MOe(e,r),UOe(e,r),FOe(e,r),LOe(e,r),r}var ko,W8,K8,J8=y(()=>{"use strict";vp();ko="HARNESS_INTEGRITY",W8=[{host:"claude-code",path:"plugins/claude-code/.claude-plugin/plugin.json",required:["name","version"]},{host:"codex",path:"plugins/codex/.codex-plugin/plugin.json",required:["name","version","description"]},{host:"gemini-cli",path:"plugins/gemini-cli/gemini-extension.json",required:["name","version"]}];K8={name:ko,run:qOe}});import{existsSync as BOe,readFileSync as HOe}from"node:fs";import{join as GOe}from"node:path";function VOe(t){let{cwd:e="."}=t;return ge(e,Vv,r=>KOe(r,e))}function WOe(t){let e=GOe(t,"spec/capabilities.yaml");if(!BOe(e))return!1;try{let r=Y8.default.parse(HOe(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function KOe(t,e){let r=t.features.length;if(r{"use strict";Y8=St(er(),1);wt();Vv="HOLLOW_GOVERNANCE",ZOe=8;X8={name:Vv,run:VOe}});import{existsSync as e5,readFileSync as t5}from"node:fs";import{join as r5}from"node:path";function n5(t,e){let r=t.match(e);if(!r)return null;try{let n=JSON.parse(r[1]),i={};for(let[o,s]of Object.entries(n))typeof s=="string"&&(i[o]=s);return i}catch{return null}}function XOe(t){switch(t){case"fail":case"wiring-fail":return 0;case"wiring-ok":case"wiring-only":return 1;case"verified":return 2;default:return null}}function QOe(t){switch(t){case"wiring-only":return 1;case"verified":return 2;default:return null}}function eRe(t){let e=r5(t,"README.md"),r=r5(t,"docs","dogfood","matrix.md");if(!e5(e)||!e5(r))return[];let n=n5(t5(e,"utf8"),JOe),i=n5(t5(r,"utf8"),YOe);if(!n||!i)return[];let o=[];for(let[s,a]of Object.entries(n)){let c=QOe(a);if(c===null)continue;let l=i[s]??"not-run",u=XOe(l);u!==null&&c>u&&o.push({detector:i5,severity:"warn",path:"README.md",message:`README host-claims: '${s}' claims '${a}' but the newest matrix evidence is '${l}' \u2014 the claim exceeds the evidence. Re-run \`clad doctor --hosts\` (with consent) or lower the README claim for '${s}'.`})}return o}function tRe(t){let{cwd:e="."}=t;return eRe(e)}var i5,JOe,YOe,o5,s5=y(()=>{"use strict";i5="HOST_CLAIM_DRIFT",JOe=//,YOe=//;o5={name:i5,run:tRe}});function rRe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}let n=[];return a5(r.features.map(i=>i.id),"feature","spec/features/",n),a5((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function a5(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:c5,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var c5,l5,u5=y(()=>{"use strict";Ue();c5="ID_COLLISION";l5={name:c5,run:rRe}});import{existsSync as $p,readFileSync as QP,readdirSync as eC,statSync as nRe,writeFileSync as f5}from"node:fs";import{join as Eo}from"node:path";function d5(t){if(!$p(t))return 0;try{return eC(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function iRe(t){if(!$p(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=eC(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=Eo(n,o),a;try{a=nRe(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function oRe(t){let e=Eo(t,"spec","capabilities.yaml");if(!$p(e))return 0;try{let r=Wv.default.parse(QP(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function _s(t="."){let e=d5(Eo(t,"spec","features")),r=d5(Eo(t,"spec","scenarios")),n=oRe(t),i=iRe(Eo(t,"tests"));return{features:e,scenarios:r,capabilities:n,test_files:i}}function Vl(t,e){let r=Eo(t,"spec.yaml");if(!$p(r))return;let n=QP(r,"utf8"),i=sRe(n,e);i!==n&&f5(r,i)}function sRe(t,e){let r=t.includes(`\r `)?`\r @@ -306,7 +306,7 @@ ${o}`:`[${t}]`),o&&s?`${o} ${s}`:o||s}function UC(t,{maxDepth:e=1e3,numbersAsFloat:r=!1}={}){if(Up(t)!=="object")throw new TypeError("stringify can only be called with an object");let n=zC(0,t,"",e,r);return n[n.length-1]!==` `?n+` `:n}var CY,DY=y(()=>{CY=/^[a-z0-9-_]+$/i});var qC={};Pr(qC,{TomlDate:()=>Ya,TomlError:()=>me,default:()=>BPe,parse:()=>MC,stringify:()=>UC});var BPe,BC=y(()=>{PY();DY();CC();Ja();BPe={parse:MC,stringify:UC,TomlDate:Ya,TomlError:me}});import dX from"node:process";function rc(t={}){let e=t.cwd??".",n=(Z_(Ua.name,e)??Ua.run(t)).filter(s=>s.severity==="error"),i=n.length===0,o={stage:f1e,pass:i,exitCode:i?0:1};return i?o:{...o,stderr:n.map(s=>s.message).join(` -`)}}var f1e,p1e,wS=y(()=>{"use strict";Sl();Iv();f1e="stage_1.5";p1e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${dX.argv[1]}`;if(p1e){let t=rc();console.log(JSON.stringify(t)),dX.exit(t.exitCode)}});var b7={};Pr(b7,{clearHostMcpServerForTesting:()=>FNe,getHostMcpServer:()=>ac,setHostMcpServer:()=>MNe});function MNe(t){let e=ru;return ru=t,()=>{ru===t&&(ru=e)}}function ac(){return ru}function FNe(){ru=null}var ru,Qp=y(()=>{"use strict";ru=null});var _t=v(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.__setModuleDefault=Ui.__createBinding=void 0;Ui.__classPrivateFieldSet=LNe;Ui.__classPrivateFieldGet=zNe;Ui.__importStar=UNe;Ui.__exportStar=qNe;function LNe(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function zNe(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var j1=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};Ui.__createBinding=j1;var v7=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};Ui.__setModuleDefault=v7;var N1=function(t){return N1=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},N1(t)};function UNe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=N1(t),n=0;n{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.uuid4=void 0;var BNe=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return em.uuid4=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))};em.uuid4=BNe});var nu=v(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});tm.castToError=void 0;tm.isAbortError=HNe;function HNe(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var GNe=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};tm.castToError=GNe});var pr=v(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.InternalServerError=Xe.RateLimitError=Xe.UnprocessableEntityError=Xe.ConflictError=Xe.NotFoundError=Xe.PermissionDeniedError=Xe.AuthenticationError=Xe.BadRequestError=Xe.APIConnectionTimeoutError=Xe.APIConnectionError=Xe.APIUserAbortError=Xe.APIError=Xe.AnthropicError=void 0;var ZNe=nu(),RS=class extends Error{};Xe.AnthropicError=RS;var un=class t extends RS{constructor(e,r,n,i,o){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=i,this.requestID=i?.get("request-id"),this.error=r,this.type=o??null}static makeMessage(e,r,n){let i=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&i?`${e} ${i}`:e?`${e} status code (no body)`:i||"(no status code or body)"}static generate(e,r,n,i){if(!e||!i)return new rm({message:n,cause:(0,ZNe.castToError)(r)});let o=r,s=o?.error?.type;return e===400?new IS(e,o,n,i,s):e===401?new PS(e,o,n,i,s):e===403?new CS(e,o,n,i,s):e===404?new DS(e,o,n,i,s):e===409?new NS(e,o,n,i,s):e===422?new jS(e,o,n,i,s):e===429?new MS(e,o,n,i,s):e>=500?new FS(e,o,n,i,s):new t(e,o,n,i,s)}};Xe.APIError=un;var F1=class extends un{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}};Xe.APIUserAbortError=F1;var rm=class extends un{constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}};Xe.APIConnectionError=rm;var L1=class extends rm{constructor({message:e}={}){super({message:e??"Request timed out."})}};Xe.APIConnectionTimeoutError=L1;var IS=class extends un{};Xe.BadRequestError=IS;var PS=class extends un{};Xe.AuthenticationError=PS;var CS=class extends un{};Xe.PermissionDeniedError=CS;var DS=class extends un{};Xe.NotFoundError=DS;var NS=class extends un{};Xe.ConflictError=NS;var jS=class extends un{};Xe.UnprocessableEntityError=jS;var MS=class extends un{};Xe.RateLimitError=MS;var FS=class extends un{};Xe.InternalServerError=FS});var qi=v(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.pop=Ae.safeJSON=Ae.maybeCoerceBoolean=Ae.maybeCoerceFloat=Ae.maybeCoerceInteger=Ae.coerceBoolean=Ae.coerceFloat=Ae.coerceInteger=Ae.validatePositiveInteger=Ae.ensurePresent=Ae.isReadonlyArray=Ae.isArray=Ae.isAbsoluteURL=void 0;Ae.maybeObj=JNe;Ae.isEmptyObj=YNe;Ae.hasOwn=XNe;Ae.isObj=QNe;var nm=pr(),VNe=/^[a-z][a-z0-9+.-]*:/i,WNe=t=>VNe.test(t);Ae.isAbsoluteURL=WNe;var KNe=t=>(Ae.isArray=Array.isArray,(0,Ae.isArray)(t));Ae.isArray=KNe;Ae.isReadonlyArray=Ae.isArray;function JNe(t){return typeof t!="object"?{}:t??{}}function YNe(t){if(!t)return!0;for(let e in t)return!1;return!0}function XNe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function QNe(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var eje=t=>{if(t==null)throw new nm.AnthropicError(`Expected a value to be given but received ${t} instead.`);return t};Ae.ensurePresent=eje;var tje=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new nm.AnthropicError(`${t} must be an integer`);if(e<0)throw new nm.AnthropicError(`${t} must be a positive integer`);return e};Ae.validatePositiveInteger=tje;var rje=t=>{if(typeof t=="number")return Math.round(t);if(typeof t=="string")return parseInt(t,10);throw new nm.AnthropicError(`Could not coerce ${t} (type: ${typeof t}) into a number`)};Ae.coerceInteger=rje;var nje=t=>{if(typeof t=="number")return t;if(typeof t=="string")return parseFloat(t);throw new nm.AnthropicError(`Could not coerce ${t} (type: ${typeof t}) into a number`)};Ae.coerceFloat=nje;var ije=t=>typeof t=="boolean"?t:typeof t=="string"?t==="true":!!t;Ae.coerceBoolean=ije;var oje=t=>{if(t!=null)return(0,Ae.coerceInteger)(t)};Ae.maybeCoerceInteger=oje;var sje=t=>{if(t!=null)return(0,Ae.coerceFloat)(t)};Ae.maybeCoerceFloat=sje;var aje=t=>{if(t!=null)return(0,Ae.coerceBoolean)(t)};Ae.maybeCoerceBoolean=aje;var cje=t=>{try{return JSON.parse(t)}catch{return}};Ae.safeJSON=cje;var lje=(t,e)=>{let r=t[e];return delete t[e],r};Ae.pop=lje});var z1=v(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});LS.sleep=void 0;var uje=t=>new Promise(e=>setTimeout(e,t));LS.sleep=uje});var im=v(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});zS.VERSION=void 0;zS.VERSION="0.96.0"});var US=v(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.getPlatformHeaders=iu.isRunningInBrowser=void 0;var om=im(),dje=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";iu.isRunningInBrowser=dje;function fje(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}var pje=()=>{let t=fje();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":om.VERSION,"X-Stainless-OS":w7(Deno.build.os),"X-Stainless-Arch":S7(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":om.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":om.VERSION,"X-Stainless-OS":w7(globalThis.process.platform??"unknown"),"X-Stainless-Arch":S7(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=mje();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":om.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":om.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function mje(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let i=n[1]||0,o=n[2]||0,s=n[3]||0;return{browser:e,version:`${i}.${o}.${s}`}}}return null}var S7=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",w7=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),x7,hje=()=>x7??(x7=pje());iu.getPlatformHeaders=hje});var ou=v(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.getDefaultFetch=gje;cc.makeReadableStream=$7;cc.ReadableStreamFrom=yje;cc.ReadableStreamToAsyncIterable=_je;cc.CancelReadableStream=bje;function gje(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function $7(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function yje(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return $7({start(){},async pull(r){let{done:n,value:i}=await e.next();n?r.close():r.enqueue(i)},async cancel(){await e.return?.()}})}function _je(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function bje(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}});var k7=v(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});qS.FallbackEncoder=void 0;var vje=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});qS.FallbackEncoder=vje});var U1=v(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.RFC3986=dn.RFC1738=dn.formatters=dn.default_formatter=dn.default_format=void 0;dn.default_format="RFC3986";var Sje=t=>String(t);dn.default_formatter=Sje;dn.formatters={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:dn.default_formatter};dn.RFC1738="RFC1738";dn.RFC3986="RFC3986"});var E7=v(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.encode=Bt.has=void 0;Bt.merge=B1;Bt.assign_single_source=Eje;Bt.decode=Aje;Bt.compact=Oje;Bt.is_regexp=Rje;Bt.is_buffer=Ije;Bt.combine=Pje;Bt.maybe_map=Cje;var wje=U1(),lc=qi(),xje=(t,e)=>(Bt.has=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),(0,Bt.has)(t,e));Bt.has=xje;var Bi=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})();function $je(t){for(;t.length>1;){let e=t.pop();if(!e)continue;let r=e.obj[e.prop];if((0,lc.isArray)(r)){let n=[];for(let i=0;i{if(t.length===0)return t;let o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let s="";for(let a=0;a=q1?o.slice(a,a+q1):o,l=[];for(let u=0;u=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===wje.RFC1738&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=Bi[d];continue}if(d<2048){l[l.length]=Bi[192|d>>6]+Bi[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=Bi[224|d>>12]+Bi[128|d>>6&63]+Bi[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=Bi[240|d>>18]+Bi[128|d>>12&63]+Bi[128|d>>6&63]+Bi[128|d&63]}s+=l.join("")}return s};Bt.encode=Tje;function Oje(t){let e=[{obj:{o:t},prop:"o"}],r=[];for(let n=0;n{"use strict";Object.defineProperty(G1,"__esModule",{value:!0});G1.stringify=jje;var sm=E7(),am=U1(),Hi=qi(),T7={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},O7=function(t,e){Array.prototype.push.apply(t,(0,Hi.isArray)(e)?e:[e])},A7,Ht={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:sm.encode,encodeValuesOnly:!1,format:am.default_format,formatter:am.default_formatter,indices:!1,serializeDate(t){return(A7??(A7=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};function Dje(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}var H1={};function R7(t,e,r,n,i,o,s,a,c,l,u,d,f,p,m,h,g,b){let _=t,S=b,x=0,w=!1;for(;(S=S.get(H1))!==void 0&&!w;){let $=S.get(t);if(x+=1,typeof $<"u"){if($===x)throw new RangeError("Cyclic object value");w=!0}typeof S.get(H1)>"u"&&(x=0)}if(typeof l=="function"?_=l(e,_):_ instanceof Date?_=f?.(_):r==="comma"&&(0,Hi.isArray)(_)&&(_=(0,sm.maybe_map)(_,function($){return $ instanceof Date?f?.($):$})),_===null){if(o)return c&&!h?c(e,Ht.encoder,g,"key",p):e;_=""}if(Dje(_)||(0,sm.is_buffer)(_)){if(c){let $=h?e:c(e,Ht.encoder,g,"key",p);return[m?.($)+"="+m?.(c(_,Ht.encoder,g,"value",p))]}return[m?.(e)+"="+m?.(String(_))]}let O=[];if(typeof _>"u")return O;let T;if(r==="comma"&&(0,Hi.isArray)(_))h&&c&&(_=(0,sm.maybe_map)(_,c)),T=[{value:_.length>0?_.join(",")||null:void 0}];else if((0,Hi.isArray)(l))T=l;else{let $=Object.keys(_);T=u?$.sort(u):$}let A=a?String(e).replace(/\./g,"%2E"):String(e),D=n&&(0,Hi.isArray)(_)&&_.length===1?A+"[]":A;if(i&&(0,Hi.isArray)(_)&&_.length===0)return D+"[]";for(let $=0;$"u"?t.encodeDotInKeys?!0:Ht.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Ht.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Ht.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Ht.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Ht.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Ht.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Ht.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Ht.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Ht.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Ht.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Ht.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Ht.strictNullHandling}}function jje(t,e={}){let r=t,n=Nje(e),i,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):(0,Hi.isArray)(n.filter)&&(o=n.filter,i=o);let s=[];if(typeof r!="object"||r===null)return"";let a=T7[n.arrayFormat],c=a==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);let l=new WeakMap;for(let f=0;f0?d+u:""}});var V1=v(Z1=>{"use strict";Object.defineProperty(Z1,"__esModule",{value:!0});Z1.stringifyQuery=Lje;var Mje=_t(),Fje=Mje.__importStar(I7());function Lje(t){return Fje.stringify(t,{arrayFormat:"brackets"})}});var au=v(He=>{"use strict";var zje=He&&He.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Uje=He&&He.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K1=He&&He.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i`}return JSON.stringify(su(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))Gje.has(r)&&(e[r]=n);return e}return null}async function Zje(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await Promise.resolve().then(()=>K1(Ge("node:fs"))),n=t,i;try{n=await r.promises.realpath(t),i=await r.promises.stat(n)}catch{return}let o=i.mode&511;if(o&18)throw new Gi(`Credentials file at ${n} is group/world-writable (mode 0o${o.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(o&36)throw new Gi(`Credentials file at ${n} is group/world-readable (mode 0o${o.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&i.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${i.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function Vje(t,e){let r=await Promise.resolve().then(()=>K1(Ge("node:fs"))),i=(await Promise.resolve().then(()=>K1(Ge("node:path")))).dirname(t);await r.promises.mkdir(i,{recursive:!0,mode:448});let o=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(e,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(o,t)}catch(s){throw await r.promises.unlink(o).catch(()=>{}),s}try{let s=await r.promises.open(i,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function Wje(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:o,value:s}=await e.read();if(o)break;if(n+s.length>P7){let a=P7-n;a>0&&r.push(s.subarray(0,a)),await e.cancel();break}r.push(s),n+=s.length}let i;if(r.length===1)i=r[0];else{i=new Uint8Array(r.reduce((s,a)=>s+a.length,0));let o=0;for(let s of r)i.set(s,o),o+=s.length}return new TextDecoder("utf-8").decode(i)}var Gi=class extends qje.AnthropicError{constructor(e,r=null,n=null,i=null){super(e),this.statusCode=r,this.body=n,this.requestId=i}};He.WorkloadIdentityError=Gi});var cm=v(J1=>{"use strict";Object.defineProperty(J1,"__esModule",{value:!0});J1.nowAsSeconds=Kje;function Kje(){return Math.floor(Date.now()/1e3)}});var C7=v(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});BS.TokenCache=void 0;var Y1=au(),X1=cm(),Q1=class{constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-(0,X1.nowAsSeconds)();return n>Y1.ADVISORY_REFRESH_THRESHOLD_IN_SECONDS?r.token:n>Y1.MANDATORY_REFRESH_THRESHOLD_IN_SECONDS?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||(0,X1.nowAsSeconds)()-this.lastAdvisoryError{this.lastAdvisoryError=(0,X1.nowAsSeconds)(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}};BS.TokenCache=Q1});var GS=v(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});HS.readEnv=void 0;var Jje=t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0};HS.readEnv=Jje});var ZS=v(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.concatBytes=Yje;lm.encodeUTF8=Xje;lm.decodeUTF8=Qje;function Yje(t){let e=0;for(let i of t)e+=i.length;let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}var D7;function Xje(t){let e;return(D7??(e=new globalThis.TextEncoder,D7=e.encode.bind(e)))(t)}var N7;function Qje(t){let e;return(N7??(e=new globalThis.TextDecoder,N7=e.decode.bind(e)))(t)}});var M7=v(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.fromBase64=cu.toBase64=void 0;var j7=pr(),eMe=ZS(),tMe=t=>{if(!t)return"";if(typeof globalThis.Buffer<"u")return globalThis.Buffer.from(t).toString("base64");if(typeof t=="string"&&(t=(0,eMe.encodeUTF8)(t)),typeof btoa<"u")return btoa(String.fromCharCode.apply(null,t));throw new j7.AnthropicError("Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined")};cu.toBase64=tMe;var rMe=t=>{if(typeof globalThis.Buffer<"u"){let e=globalThis.Buffer.from(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}if(typeof atob<"u"){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.formatRequestDetails=uc.parseLogLevel=void 0;uc.loggerFor=L7;var nMe=qi(),WS={off:0,error:200,warn:300,info:400,debug:500},iMe=(t,e,r)=>{if(t){if((0,nMe.hasOwn)(WS,t))return t;L7(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(WS))}`)}};uc.parseLogLevel=iMe;function um(){}function VS(t,e,r){return!e||WS[t]>WS[r]?um:e[t].bind(e)}var oMe={error:um,warn:um,info:um,debug:um},F7=new WeakMap;function L7(t){let e=t.logger,r=t.logLevel??"off";if(!e)return oMe;let n=F7.get(e);if(n&&n[0]===r)return n[1];let i={error:VS("error",e,r),warn:VS("warn",e,r),info:VS("info",e,r),debug:VS("debug",e,r)};return F7.set(e,[r,i]),i}var sMe=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t);uc.formatRequestDetails=sMe});var z7=v(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});var dc=_t();dc.__exportStar(qi(),Oo);dc.__exportStar(M7(),Oo);dc.__exportStar(GS(),Oo);dc.__exportStar(dm(),Oo);dc.__exportStar(M1(),Oo);dc.__exportStar(z1(),Oo);dc.__exportStar(V1(),Oo)});var tD=v(bt=>{"use strict";var aMe=bt&&bt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cMe=bt&&bt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fc=bt&&bt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i(await(0,bt.loadConfigWithSource)(t))?.config??null;bt.loadConfig=uMe;var dMe=async t=>{var e,r;let n=await eD();if(n===null)return null;let i=t??await B7();if(i===null)return null;q7(i);let o=await Promise.resolve().then(()=>fc(Ge("node:fs"))),a=(await Promise.resolve().then(()=>fc(Ge("node:path")))).join(n,"configs",`${i}.json`),c;try{c=await o.promises.readFile(a,"utf-8")}catch(d){if(d?.code!=="ENOENT")throw new Error(`failed to read config file ${a}: ${d}`);c=null}if(c===null){let d=(0,jt.readEnv)("ANTHROPIC_ORGANIZATION_ID"),f=(0,jt.readEnv)("ANTHROPIC_IDENTITY_TOKEN_FILE"),p=(0,jt.readEnv)("ANTHROPIC_FEDERATION_RULE_ID");return p&&d?{fromFile:!1,config:{organization_id:d,workspace_id:(0,jt.readEnv)("ANTHROPIC_WORKSPACE_ID"),base_url:(0,jt.readEnv)("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:p,service_account_id:(0,jt.readEnv)("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:f?{source:"file",path:f}:void 0,scope:(0,jt.readEnv)("ANTHROPIC_SCOPE")}}}:null}let l;try{l=JSON.parse(c)}catch(d){throw new Error(`failed to parse config file ${a}: ${d}`)}if(!l.authentication)throw new Error(`config file ${a} is missing "authentication"`);let u=l.authentication.type;if(u!=="oidc_federation"&&u!=="user_oauth")throw new Error(`authentication.type "${u}" is not a known authentication type`);if(l.organization_id??(l.organization_id=(0,jt.readEnv)("ANTHROPIC_ORGANIZATION_ID")),l.workspace_id??(l.workspace_id=(0,jt.readEnv)("ANTHROPIC_WORKSPACE_ID")),l.base_url??(l.base_url=(0,jt.readEnv)("ANTHROPIC_BASE_URL")),(e=l.authentication).scope??(e.scope=(0,jt.readEnv)("ANTHROPIC_SCOPE")),l.authentication.type==="oidc_federation"){if(!l.authentication.identity_token){let d=(0,jt.readEnv)("ANTHROPIC_IDENTITY_TOKEN_FILE");d&&(l.authentication.identity_token={source:"file",path:d})}l.authentication.federation_rule_id||(l.authentication.federation_rule_id=(0,jt.readEnv)("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=l.authentication).service_account_id??(r.service_account_id=(0,jt.readEnv)("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:l,fromFile:!0}};bt.loadConfigWithSource=dMe;var fMe=async()=>{let t=await(0,bt.loadConfig)(),e=await(0,bt.getCredentialsPath)(t);if(!e)return null;let r=await Promise.resolve().then(()=>fc(Ge("node:fs"))),n;try{n=await r.promises.readFile(e,"utf-8")}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read credentials file ${e}: ${o}`);return null}let i;try{i=JSON.parse(n)}catch(o){throw new Error(`failed to parse credentials file ${e}: ${o}`)}if(i.type&&i.type!=="oauth_token")throw new Error(`credentials file ${e} has unsupported type "${i.type}" (want "oauth_token")`);return i};bt.loadCredentials=fMe;var pMe=async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await eD();if(!r)return null;let n=e??await B7();return n?(q7(n),(await Promise.resolve().then(()=>fc(Ge("node:path")))).join(r,"credentials",`${n}.json`)):null};bt.getCredentialsPath=pMe;var eD=async()=>{if(!mMe())return null;let t=await Promise.resolve().then(()=>fc(Ge("node:path"))),e=(0,jt.readEnv)("ANTHROPIC_CONFIG_DIR");if(e)return e;if((0,U7.getPlatformHeaders)()["X-Stainless-OS"]==="Windows"){let o=(0,jt.readEnv)("APPDATA");if(o)return t.join(o,"Anthropic");let s=(0,jt.readEnv)("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let n=(0,jt.readEnv)("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let i=(0,jt.readEnv)("HOME");return i?t.join(i,".config","anthropic"):null},mMe=()=>{let t=(0,U7.getPlatformHeaders)()["X-Stainless-Runtime"];return t==="node"||t==="deno"},B7=async()=>{let t=await eD();if(!t)return null;let e=(0,jt.readEnv)("ANTHROPIC_PROFILE");if(e)return e;let r=await Promise.resolve().then(()=>fc(Ge("node:fs"))),i=(await Promise.resolve().then(()=>fc(Ge("node:path")))).join(t,"active_config");try{return(await r.promises.readFile(i,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read ${i}: ${o}`);return"default"}}});var H7=v(Zi=>{"use strict";var hMe=Zi&&Zi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gMe=Zi&&Zi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),yMe=Zi&&Zi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i{let e=await Promise.resolve().then(()=>yMe(Ge("node:fs"))),r;try{r=await e.promises.readFile(t,"utf-8")}catch(i){throw new KS.AnthropicError(`Failed to read identity token file at ${t}: ${i}`)}let n=r.trim();if(!n)throw new KS.AnthropicError(`Identity token file at ${t} is empty`);return n}}function bMe(t){if(!t)throw new KS.AnthropicError("Identity token value is empty");return()=>t}});var G7=v(rD=>{"use strict";Object.defineProperty(rD,"__esModule",{value:!0});rD.oidcFederationProvider=wMe;var fn=au(),vMe=cm(),SMe=im();function wMe(t){return async()=>{(0,fn.requireSecureTokenEndpoint)(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new fn.WorkloadIdentityError(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:fn.GRANT_TYPE_JWT_BEARER,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${fn.TOKEN_ENDPOINT}`,i;try{i=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${fn.OAUTH_API_BETA_HEADER},${fn.FEDERATION_BETA_HEADER}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${SMe.VERSION} oidcFederationProvider`},body:JSON.stringify(r)})}catch(c){throw new fn.WorkloadIdentityError(`Failed to reach token endpoint ${n}: ${c}`)}let o=i.headers.get("Request-Id");if(!i.ok){let c=await i.text().catch(()=>""),l=(0,fn.redactSensitive)(c),u="";throw i.status===401&&(u=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new fn.WorkloadIdentityError(`Token exchange failed with status ${i.status}${o?` (request-id ${o})`:""}: ${l}${u}`,i.status,l,o)}let s=await(0,fn.parseTokenResponse)(i,o),a=Number(s.expires_in);if(!Number.isFinite(a))throw new fn.WorkloadIdentityError(`Token endpoint response missing required fields: ${JSON.stringify((0,fn.redactSensitive)(s))}`,i.status,(0,fn.redactSensitive)(s),o);return{token:s.access_token,expiresAt:(0,vMe.nowAsSeconds)()+a}}}});var V7=v(Ro=>{"use strict";var xMe=Ro&&Ro.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Me=Ro&&Ro.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kMe=Ro&&Ro.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i{let r=await Promise.resolve().then(()=>kMe(Ge("node:fs")));await(0,Gt.checkCredentialsFileSafety)(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(g){throw new Gt.WorkloadIdentityError(`Credentials file not found at ${t.credentialsPath}: ${g}`)}let i;try{i=JSON.parse(n)}catch(g){throw new Gt.WorkloadIdentityError(`Credentials file at ${t.credentialsPath} is not valid JSON: ${g}`)}let o=i.access_token;if(!o)throw new Gt.WorkloadIdentityError(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let s=i.expires_at;if(!e?.forceRefresh&&(s==null||(0,Z7.nowAsSeconds)()"");throw new Gt.WorkloadIdentityError(`User OAuth refresh failed (HTTP ${u.status}): ${(0,Gt.redactSensitive)(g)}`,u.status,(0,Gt.redactSensitive)(g),d)}let f=await(0,Gt.parseTokenResponse)(u,d),p=Number(f.expires_in);if(!Number.isFinite(p))throw new Gt.WorkloadIdentityError(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify((0,Gt.redactSensitive)(f))}`,u.status,(0,Gt.redactSensitive)(f),d);let m=(0,Z7.nowAsSeconds)()+p,h=f.refresh_token||a;return await(0,Gt.writeCredentialsFileAtomic)(t.credentialsPath,{...i,version:EMe.CREDENTIALS_FILE_VERSION,type:"oauth_token",access_token:f.access_token,expires_at:m,refresh_token:h}),{token:f.access_token,expiresAt:m}}}});var J7=v(Wi=>{"use strict";var OMe=Wi&&Wi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RMe=Wi&&Wi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),IMe=Wi&&Wi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i/credentials/.json)");return(0,DMe.userOAuthProvider)({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let i=t.authentication.type;throw new Vi.WorkloadIdentityError(`authentication.type "${i}" is not a known authentication type`)}}}function MMe(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Vi.WorkloadIdentityError(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Vi.WorkloadIdentityError('identity_token.source "file" requires a non-empty path');return(0,nD.identityTokenFromFile)(t.identity_token.path)}let e=(0,W7.readEnv)("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return(0,nD.identityTokenFromFile)(e);let r=(0,W7.readEnv)("ANTHROPIC_IDENTITY_TOKEN");return r?(0,nD.identityTokenFromValue)(r):null}function FMe(t,e,r,n){return async i=>{let o=await Promise.resolve().then(()=>IMe(Ge("node:fs")));await(0,Vi.checkCredentialsFileSafety)(e,n);let s;try{let c=await o.promises.readFile(e,"utf-8");s=JSON.parse(c);let l=s?.access_token;if(l&&!i?.forceRefresh){let u=s?.expires_at;if(u==null||(0,PMe.nowAsSeconds)(){"use strict";var pn,mn;Object.defineProperty(pm,"__esModule",{value:!0});pm.LineDecoder=void 0;pm.findDoubleNewlineIndex=zMe;var $t=_t(),JS=ZS(),fm=class{constructor(){pn.set(this,void 0),mn.set(this,void 0),$t.__classPrivateFieldSet(this,pn,new Uint8Array,"f"),$t.__classPrivateFieldSet(this,mn,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?(0,JS.encodeUTF8)(e):e;$t.__classPrivateFieldSet(this,pn,(0,JS.concatBytes)([$t.__classPrivateFieldGet(this,pn,"f"),r]),"f");let n=[],i;for(;(i=LMe($t.__classPrivateFieldGet(this,pn,"f"),$t.__classPrivateFieldGet(this,mn,"f")))!=null;){if(i.carriage&&$t.__classPrivateFieldGet(this,mn,"f")==null){$t.__classPrivateFieldSet(this,mn,i.index,"f");continue}if($t.__classPrivateFieldGet(this,mn,"f")!=null&&(i.index!==$t.__classPrivateFieldGet(this,mn,"f")+1||i.carriage)){n.push((0,JS.decodeUTF8)($t.__classPrivateFieldGet(this,pn,"f").subarray(0,$t.__classPrivateFieldGet(this,mn,"f")-1))),$t.__classPrivateFieldSet(this,pn,$t.__classPrivateFieldGet(this,pn,"f").subarray($t.__classPrivateFieldGet(this,mn,"f")),"f"),$t.__classPrivateFieldSet(this,mn,null,"f");continue}let o=$t.__classPrivateFieldGet(this,mn,"f")!==null?i.preceding-1:i.preceding,s=(0,JS.decodeUTF8)($t.__classPrivateFieldGet(this,pn,"f").subarray(0,o));n.push(s),$t.__classPrivateFieldSet(this,pn,$t.__classPrivateFieldGet(this,pn,"f").subarray(i.index),"f"),$t.__classPrivateFieldSet(this,mn,null,"f")}return n}flush(){return $t.__classPrivateFieldGet(this,pn,"f").length?this.decode(` +`)}}var f1e,p1e,wS=y(()=>{"use strict";Sl();Iv();f1e="stage_1.5";p1e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${dX.argv[1]}`;if(p1e){let t=rc();console.log(JSON.stringify(t)),dX.exit(t.exitCode)}});var b7={};Pr(b7,{clearHostMcpServerForTesting:()=>FNe,getHostMcpServer:()=>ac,setHostMcpServer:()=>MNe});function MNe(t){let e=ru;return ru=t,()=>{ru===t&&(ru=e)}}function ac(){return ru}function FNe(){ru=null}var ru,Qp=y(()=>{"use strict";ru=null});var _t=v(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.__setModuleDefault=Ui.__createBinding=void 0;Ui.__classPrivateFieldSet=LNe;Ui.__classPrivateFieldGet=zNe;Ui.__importStar=UNe;Ui.__exportStar=qNe;function LNe(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function zNe(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var j1=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};Ui.__createBinding=j1;var v7=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};Ui.__setModuleDefault=v7;var N1=function(t){return N1=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},N1(t)};function UNe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=N1(t),n=0;n{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.uuid4=void 0;var BNe=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return em.uuid4=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))};em.uuid4=BNe});var nu=v(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});tm.castToError=void 0;tm.isAbortError=HNe;function HNe(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var GNe=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};tm.castToError=GNe});var pr=v(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.InternalServerError=Xe.RateLimitError=Xe.UnprocessableEntityError=Xe.ConflictError=Xe.NotFoundError=Xe.PermissionDeniedError=Xe.AuthenticationError=Xe.BadRequestError=Xe.APIConnectionTimeoutError=Xe.APIConnectionError=Xe.APIUserAbortError=Xe.APIError=Xe.AnthropicError=void 0;var ZNe=nu(),RS=class extends Error{};Xe.AnthropicError=RS;var un=class t extends RS{constructor(e,r,n,i,o){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=i,this.requestID=i?.get("request-id"),this.error=r,this.type=o??null}static makeMessage(e,r,n){let i=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&i?`${e} ${i}`:e?`${e} status code (no body)`:i||"(no status code or body)"}static generate(e,r,n,i){if(!e||!i)return new rm({message:n,cause:(0,ZNe.castToError)(r)});let o=r,s=o?.error?.type;return e===400?new IS(e,o,n,i,s):e===401?new PS(e,o,n,i,s):e===403?new CS(e,o,n,i,s):e===404?new DS(e,o,n,i,s):e===409?new NS(e,o,n,i,s):e===422?new jS(e,o,n,i,s):e===429?new MS(e,o,n,i,s):e>=500?new FS(e,o,n,i,s):new t(e,o,n,i,s)}};Xe.APIError=un;var F1=class extends un{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}};Xe.APIUserAbortError=F1;var rm=class extends un{constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}};Xe.APIConnectionError=rm;var L1=class extends rm{constructor({message:e}={}){super({message:e??"Request timed out."})}};Xe.APIConnectionTimeoutError=L1;var IS=class extends un{};Xe.BadRequestError=IS;var PS=class extends un{};Xe.AuthenticationError=PS;var CS=class extends un{};Xe.PermissionDeniedError=CS;var DS=class extends un{};Xe.NotFoundError=DS;var NS=class extends un{};Xe.ConflictError=NS;var jS=class extends un{};Xe.UnprocessableEntityError=jS;var MS=class extends un{};Xe.RateLimitError=MS;var FS=class extends un{};Xe.InternalServerError=FS});var qi=v(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.pop=Ae.safeJSON=Ae.maybeCoerceBoolean=Ae.maybeCoerceFloat=Ae.maybeCoerceInteger=Ae.coerceBoolean=Ae.coerceFloat=Ae.coerceInteger=Ae.validatePositiveInteger=Ae.ensurePresent=Ae.isReadonlyArray=Ae.isArray=Ae.isAbsoluteURL=void 0;Ae.maybeObj=JNe;Ae.isEmptyObj=YNe;Ae.hasOwn=XNe;Ae.isObj=QNe;var nm=pr(),VNe=/^[a-z][a-z0-9+.-]*:/i,WNe=t=>VNe.test(t);Ae.isAbsoluteURL=WNe;var KNe=t=>(Ae.isArray=Array.isArray,(0,Ae.isArray)(t));Ae.isArray=KNe;Ae.isReadonlyArray=Ae.isArray;function JNe(t){return typeof t!="object"?{}:t??{}}function YNe(t){if(!t)return!0;for(let e in t)return!1;return!0}function XNe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function QNe(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var eje=t=>{if(t==null)throw new nm.AnthropicError(`Expected a value to be given but received ${t} instead.`);return t};Ae.ensurePresent=eje;var tje=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new nm.AnthropicError(`${t} must be an integer`);if(e<0)throw new nm.AnthropicError(`${t} must be a positive integer`);return e};Ae.validatePositiveInteger=tje;var rje=t=>{if(typeof t=="number")return Math.round(t);if(typeof t=="string")return parseInt(t,10);throw new nm.AnthropicError(`Could not coerce ${t} (type: ${typeof t}) into a number`)};Ae.coerceInteger=rje;var nje=t=>{if(typeof t=="number")return t;if(typeof t=="string")return parseFloat(t);throw new nm.AnthropicError(`Could not coerce ${t} (type: ${typeof t}) into a number`)};Ae.coerceFloat=nje;var ije=t=>typeof t=="boolean"?t:typeof t=="string"?t==="true":!!t;Ae.coerceBoolean=ije;var oje=t=>{if(t!=null)return(0,Ae.coerceInteger)(t)};Ae.maybeCoerceInteger=oje;var sje=t=>{if(t!=null)return(0,Ae.coerceFloat)(t)};Ae.maybeCoerceFloat=sje;var aje=t=>{if(t!=null)return(0,Ae.coerceBoolean)(t)};Ae.maybeCoerceBoolean=aje;var cje=t=>{try{return JSON.parse(t)}catch{return}};Ae.safeJSON=cje;var lje=(t,e)=>{let r=t[e];return delete t[e],r};Ae.pop=lje});var z1=v(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});LS.sleep=void 0;var uje=t=>new Promise(e=>setTimeout(e,t));LS.sleep=uje});var im=v(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});zS.VERSION=void 0;zS.VERSION="0.96.0"});var US=v(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.getPlatformHeaders=iu.isRunningInBrowser=void 0;var om=im(),dje=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";iu.isRunningInBrowser=dje;function fje(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}var pje=()=>{let t=fje();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":om.VERSION,"X-Stainless-OS":w7(Deno.build.os),"X-Stainless-Arch":S7(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":om.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":om.VERSION,"X-Stainless-OS":w7(globalThis.process.platform??"unknown"),"X-Stainless-Arch":S7(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=mje();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":om.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":om.VERSION,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function mje(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let i=n[1]||0,o=n[2]||0,s=n[3]||0;return{browser:e,version:`${i}.${o}.${s}`}}}return null}var S7=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",w7=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),x7,hje=()=>x7??(x7=pje());iu.getPlatformHeaders=hje});var ou=v(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.getDefaultFetch=gje;cc.makeReadableStream=$7;cc.ReadableStreamFrom=yje;cc.ReadableStreamToAsyncIterable=_je;cc.CancelReadableStream=bje;function gje(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function $7(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function yje(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return $7({start(){},async pull(r){let{done:n,value:i}=await e.next();n?r.close():r.enqueue(i)},async cancel(){await e.return?.()}})}function _je(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function bje(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}});var k7=v(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});qS.FallbackEncoder=void 0;var vje=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});qS.FallbackEncoder=vje});var U1=v(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.RFC3986=dn.RFC1738=dn.formatters=dn.default_formatter=dn.default_format=void 0;dn.default_format="RFC3986";var Sje=t=>String(t);dn.default_formatter=Sje;dn.formatters={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:dn.default_formatter};dn.RFC1738="RFC1738";dn.RFC3986="RFC3986"});var E7=v(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.encode=Bt.has=void 0;Bt.merge=B1;Bt.assign_single_source=Eje;Bt.decode=Aje;Bt.compact=Oje;Bt.is_regexp=Rje;Bt.is_buffer=Ije;Bt.combine=Pje;Bt.maybe_map=Cje;var wje=U1(),lc=qi(),xje=(t,e)=>(Bt.has=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),(0,Bt.has)(t,e));Bt.has=xje;var Bi=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})();function $je(t){for(;t.length>1;){let e=t.pop();if(!e)continue;let r=e.obj[e.prop];if((0,lc.isArray)(r)){let n=[];for(let i=0;i{if(t.length===0)return t;let o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let s="";for(let a=0;a=q1?o.slice(a,a+q1):o,l=[];for(let u=0;u=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===wje.RFC1738&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=Bi[d];continue}if(d<2048){l[l.length]=Bi[192|d>>6]+Bi[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=Bi[224|d>>12]+Bi[128|d>>6&63]+Bi[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=Bi[240|d>>18]+Bi[128|d>>12&63]+Bi[128|d>>6&63]+Bi[128|d&63]}s+=l.join("")}return s};Bt.encode=Tje;function Oje(t){let e=[{obj:{o:t},prop:"o"}],r=[];for(let n=0;n{"use strict";Object.defineProperty(G1,"__esModule",{value:!0});G1.stringify=jje;var sm=E7(),am=U1(),Hi=qi(),T7={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},O7=function(t,e){Array.prototype.push.apply(t,(0,Hi.isArray)(e)?e:[e])},A7,Ht={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:sm.encode,encodeValuesOnly:!1,format:am.default_format,formatter:am.default_formatter,indices:!1,serializeDate(t){return(A7??(A7=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};function Dje(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}var H1={};function R7(t,e,r,n,i,o,s,a,c,l,u,d,f,p,m,h,g,b){let _=t,S=b,x=0,w=!1;for(;(S=S.get(H1))!==void 0&&!w;){let $=S.get(t);if(x+=1,typeof $<"u"){if($===x)throw new RangeError("Cyclic object value");w=!0}typeof S.get(H1)>"u"&&(x=0)}if(typeof l=="function"?_=l(e,_):_ instanceof Date?_=f?.(_):r==="comma"&&(0,Hi.isArray)(_)&&(_=(0,sm.maybe_map)(_,function($){return $ instanceof Date?f?.($):$})),_===null){if(o)return c&&!h?c(e,Ht.encoder,g,"key",p):e;_=""}if(Dje(_)||(0,sm.is_buffer)(_)){if(c){let $=h?e:c(e,Ht.encoder,g,"key",p);return[m?.($)+"="+m?.(c(_,Ht.encoder,g,"value",p))]}return[m?.(e)+"="+m?.(String(_))]}let O=[];if(typeof _>"u")return O;let T;if(r==="comma"&&(0,Hi.isArray)(_))h&&c&&(_=(0,sm.maybe_map)(_,c)),T=[{value:_.length>0?_.join(",")||null:void 0}];else if((0,Hi.isArray)(l))T=l;else{let $=Object.keys(_);T=u?$.sort(u):$}let A=a?String(e).replace(/\./g,"%2E"):String(e),D=n&&(0,Hi.isArray)(_)&&_.length===1?A+"[]":A;if(i&&(0,Hi.isArray)(_)&&_.length===0)return D+"[]";for(let $=0;$"u"?t.encodeDotInKeys?!0:Ht.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Ht.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Ht.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Ht.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Ht.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Ht.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Ht.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Ht.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Ht.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Ht.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Ht.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Ht.strictNullHandling}}function jje(t,e={}){let r=t,n=Nje(e),i,o;typeof n.filter=="function"?(o=n.filter,r=o("",r)):(0,Hi.isArray)(n.filter)&&(o=n.filter,i=o);let s=[];if(typeof r!="object"||r===null)return"";let a=T7[n.arrayFormat],c=a==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);let l=new WeakMap;for(let f=0;f0?d+u:""}});var V1=v(Z1=>{"use strict";Object.defineProperty(Z1,"__esModule",{value:!0});Z1.stringifyQuery=Lje;var Mje=_t(),Fje=Mje.__importStar(I7());function Lje(t){return Fje.stringify(t,{arrayFormat:"brackets"})}});var au=v(He=>{"use strict";var zje=He&&He.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Uje=He&&He.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K1=He&&He.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i`}return JSON.stringify(su(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))Gje.has(r)&&(e[r]=n);return e}return null}async function Zje(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await Promise.resolve().then(()=>K1(Ge("node:fs"))),n=t,i;try{n=await r.promises.realpath(t),i=await r.promises.stat(n)}catch{return}let o=i.mode&511;if(o&18)throw new Gi(`Credentials file at ${n} is group/world-writable (mode 0o${o.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(o&36)throw new Gi(`Credentials file at ${n} is group/world-readable (mode 0o${o.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&i.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${i.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function Vje(t,e){let r=await Promise.resolve().then(()=>K1(Ge("node:fs"))),i=(await Promise.resolve().then(()=>K1(Ge("node:path")))).dirname(t);await r.promises.mkdir(i,{recursive:!0,mode:448});let o=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(e,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(o,t)}catch(s){throw await r.promises.unlink(o).catch(()=>{}),s}try{let s=await r.promises.open(i,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function Wje(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:o,value:s}=await e.read();if(o)break;if(n+s.length>P7){let a=P7-n;a>0&&r.push(s.subarray(0,a)),await e.cancel();break}r.push(s),n+=s.length}let i;if(r.length===1)i=r[0];else{i=new Uint8Array(r.reduce((s,a)=>s+a.length,0));let o=0;for(let s of r)i.set(s,o),o+=s.length}return new TextDecoder("utf-8").decode(i)}var Gi=class extends qje.AnthropicError{constructor(e,r=null,n=null,i=null){super(e),this.statusCode=r,this.body=n,this.requestId=i}};He.WorkloadIdentityError=Gi});var cm=v(J1=>{"use strict";Object.defineProperty(J1,"__esModule",{value:!0});J1.nowAsSeconds=Kje;function Kje(){return Math.floor(Date.now()/1e3)}});var C7=v(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});BS.TokenCache=void 0;var Y1=au(),X1=cm(),Q1=class{constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-(0,X1.nowAsSeconds)();return n>Y1.ADVISORY_REFRESH_THRESHOLD_IN_SECONDS?r.token:n>Y1.MANDATORY_REFRESH_THRESHOLD_IN_SECONDS?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||(0,X1.nowAsSeconds)()-this.lastAdvisoryError{this.lastAdvisoryError=(0,X1.nowAsSeconds)(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}};BS.TokenCache=Q1});var GS=v(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});HS.readEnv=void 0;var Jje=t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0};HS.readEnv=Jje});var ZS=v(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.concatBytes=Yje;lm.encodeUTF8=Xje;lm.decodeUTF8=Qje;function Yje(t){let e=0;for(let i of t)e+=i.length;let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}var D7;function Xje(t){let e;return(D7??(e=new globalThis.TextEncoder,D7=e.encode.bind(e)))(t)}var N7;function Qje(t){let e;return(N7??(e=new globalThis.TextDecoder,N7=e.decode.bind(e)))(t)}});var M7=v(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.fromBase64=cu.toBase64=void 0;var j7=pr(),eMe=ZS(),tMe=t=>{if(!t)return"";if(typeof globalThis.Buffer<"u")return globalThis.Buffer.from(t).toString("base64");if(typeof t=="string"&&(t=(0,eMe.encodeUTF8)(t)),typeof btoa<"u")return btoa(String.fromCharCode.apply(null,t));throw new j7.AnthropicError("Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined")};cu.toBase64=tMe;var rMe=t=>{if(typeof globalThis.Buffer<"u"){let e=globalThis.Buffer.from(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}if(typeof atob<"u"){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.formatRequestDetails=uc.parseLogLevel=void 0;uc.loggerFor=L7;var nMe=qi(),WS={off:0,error:200,warn:300,info:400,debug:500},iMe=(t,e,r)=>{if(t){if((0,nMe.hasOwn)(WS,t))return t;L7(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(WS))}`)}};uc.parseLogLevel=iMe;function um(){}function VS(t,e,r){return!e||WS[t]>WS[r]?um:e[t].bind(e)}var oMe={error:um,warn:um,info:um,debug:um},F7=new WeakMap;function L7(t){let e=t.logger,r=t.logLevel??"off";if(!e)return oMe;let n=F7.get(e);if(n&&n[0]===r)return n[1];let i={error:VS("error",e,r),warn:VS("warn",e,r),info:VS("info",e,r),debug:VS("debug",e,r)};return F7.set(e,[r,i]),i}var sMe=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t);uc.formatRequestDetails=sMe});var z7=v(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});var dc=_t();dc.__exportStar(qi(),Oo);dc.__exportStar(M7(),Oo);dc.__exportStar(GS(),Oo);dc.__exportStar(dm(),Oo);dc.__exportStar(M1(),Oo);dc.__exportStar(z1(),Oo);dc.__exportStar(V1(),Oo)});var tD=v(bt=>{"use strict";var aMe=bt&&bt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cMe=bt&&bt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fc=bt&&bt.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i(await(0,bt.loadConfigWithSource)(t))?.config??null;bt.loadConfig=uMe;var dMe=async t=>{var e,r;let n=await eD();if(n===null)return null;let i=t??await B7();if(i===null)return null;q7(i);let o=await Promise.resolve().then(()=>fc(Ge("node:fs"))),a=(await Promise.resolve().then(()=>fc(Ge("node:path")))).join(n,"configs",`${i}.json`),c;try{c=await o.promises.readFile(a,"utf-8")}catch(d){if(d?.code!=="ENOENT")throw new Error(`failed to read config file ${a}: ${d}`);c=null}if(c===null){let d=(0,jt.readEnv)("ANTHROPIC_ORGANIZATION_ID"),f=(0,jt.readEnv)("ANTHROPIC_IDENTITY_TOKEN_FILE"),p=(0,jt.readEnv)("ANTHROPIC_FEDERATION_RULE_ID");return p&&d?{fromFile:!1,config:{organization_id:d,workspace_id:(0,jt.readEnv)("ANTHROPIC_WORKSPACE_ID"),base_url:(0,jt.readEnv)("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:p,service_account_id:(0,jt.readEnv)("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:f?{source:"file",path:f}:void 0,scope:(0,jt.readEnv)("ANTHROPIC_SCOPE")}}}:null}let l;try{l=JSON.parse(c)}catch(d){throw new Error(`failed to parse config file ${a}: ${d}`)}if(!l.authentication)throw new Error(`config file ${a} is missing "authentication"`);let u=l.authentication.type;if(u!=="oidc_federation"&&u!=="user_oauth")throw new Error(`authentication.type "${u}" is not a known authentication type`);if(l.organization_id??(l.organization_id=(0,jt.readEnv)("ANTHROPIC_ORGANIZATION_ID")),l.workspace_id??(l.workspace_id=(0,jt.readEnv)("ANTHROPIC_WORKSPACE_ID")),l.base_url??(l.base_url=(0,jt.readEnv)("ANTHROPIC_BASE_URL")),(e=l.authentication).scope??(e.scope=(0,jt.readEnv)("ANTHROPIC_SCOPE")),l.authentication.type==="oidc_federation"){if(!l.authentication.identity_token){let d=(0,jt.readEnv)("ANTHROPIC_IDENTITY_TOKEN_FILE");d&&(l.authentication.identity_token={source:"file",path:d})}l.authentication.federation_rule_id||(l.authentication.federation_rule_id=(0,jt.readEnv)("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=l.authentication).service_account_id??(r.service_account_id=(0,jt.readEnv)("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:l,fromFile:!0}};bt.loadConfigWithSource=dMe;var fMe=async()=>{let t=await(0,bt.loadConfig)(),e=await(0,bt.getCredentialsPath)(t);if(!e)return null;let r=await Promise.resolve().then(()=>fc(Ge("node:fs"))),n;try{n=await r.promises.readFile(e,"utf-8")}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read credentials file ${e}: ${o}`);return null}let i;try{i=JSON.parse(n)}catch(o){throw new Error(`failed to parse credentials file ${e}: ${o}`)}if(i.type&&i.type!=="oauth_token")throw new Error(`credentials file ${e} has unsupported type "${i.type}" (want "oauth_token")`);return i};bt.loadCredentials=fMe;var pMe=async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await eD();if(!r)return null;let n=e??await B7();return n?(q7(n),(await Promise.resolve().then(()=>fc(Ge("node:path")))).join(r,"credentials",`${n}.json`)):null};bt.getCredentialsPath=pMe;var eD=async()=>{if(!mMe())return null;let t=await Promise.resolve().then(()=>fc(Ge("node:path"))),e=(0,jt.readEnv)("ANTHROPIC_CONFIG_DIR");if(e)return e;if((0,U7.getPlatformHeaders)()["X-Stainless-OS"]==="Windows"){let o=(0,jt.readEnv)("APPDATA");if(o)return t.join(o,"Anthropic");let s=(0,jt.readEnv)("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let n=(0,jt.readEnv)("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let i=(0,jt.readEnv)("HOME");return i?t.join(i,".config","anthropic"):null},mMe=()=>{let t=(0,U7.getPlatformHeaders)()["X-Stainless-Runtime"];return t==="node"||t==="deno"},B7=async()=>{let t=await eD();if(!t)return null;let e=(0,jt.readEnv)("ANTHROPIC_PROFILE");if(e)return e;let r=await Promise.resolve().then(()=>fc(Ge("node:fs"))),i=(await Promise.resolve().then(()=>fc(Ge("node:path")))).join(t,"active_config");try{return(await r.promises.readFile(i,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw new Error(`failed to read ${i}: ${o}`);return"default"}}});var H7=v(Zi=>{"use strict";var hMe=Zi&&Zi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gMe=Zi&&Zi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),yMe=Zi&&Zi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i{let e=await Promise.resolve().then(()=>yMe(Ge("node:fs"))),r;try{r=await e.promises.readFile(t,"utf-8")}catch(i){throw new KS.AnthropicError(`Failed to read identity token file at ${t}: ${i}`)}let n=r.trim();if(!n)throw new KS.AnthropicError(`Identity token file at ${t} is empty`);return n}}function bMe(t){if(!t)throw new KS.AnthropicError("Identity token value is empty");return()=>t}});var G7=v(rD=>{"use strict";Object.defineProperty(rD,"__esModule",{value:!0});rD.oidcFederationProvider=wMe;var fn=au(),vMe=cm(),SMe=im();function wMe(t){return async()=>{(0,fn.requireSecureTokenEndpoint)(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new fn.WorkloadIdentityError(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:fn.GRANT_TYPE_JWT_BEARER,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${fn.TOKEN_ENDPOINT}`,i;try{i=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${fn.OAUTH_API_BETA_HEADER},${fn.FEDERATION_BETA_HEADER}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${SMe.VERSION} oidcFederationProvider`},body:JSON.stringify(r)})}catch(c){throw new fn.WorkloadIdentityError(`Failed to reach token endpoint ${n}: ${c}`)}let o=i.headers.get("Request-Id");if(!i.ok){let c=await i.text().catch(()=>""),l=(0,fn.redactSensitive)(c),u="";throw i.status===401&&(u=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new fn.WorkloadIdentityError(`Token exchange failed with status ${i.status}${o?` (request-id ${o})`:""}: ${l}${u}`,i.status,l,o)}let s=await(0,fn.parseTokenResponse)(i,o),a=Number(s.expires_in);if(!Number.isFinite(a))throw new fn.WorkloadIdentityError(`Token endpoint response missing required fields: ${JSON.stringify((0,fn.redactSensitive)(s))}`,i.status,(0,fn.redactSensitive)(s),o);return{token:s.access_token,expiresAt:(0,vMe.nowAsSeconds)()+a}}}});var V7=v(Ro=>{"use strict";var xMe=Ro&&Ro.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Me=Ro&&Ro.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kMe=Ro&&Ro.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i{let r=await Promise.resolve().then(()=>kMe(Ge("node:fs")));await(0,Gt.checkCredentialsFileSafety)(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(g){throw new Gt.WorkloadIdentityError(`Credentials file not found at ${t.credentialsPath}: ${g}`)}let i;try{i=JSON.parse(n)}catch(g){throw new Gt.WorkloadIdentityError(`Credentials file at ${t.credentialsPath} is not valid JSON: ${g}`)}let o=i.access_token;if(!o)throw new Gt.WorkloadIdentityError(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let s=i.expires_at;if(!e?.forceRefresh&&(s==null||(0,Z7.nowAsSeconds)()"");throw new Gt.WorkloadIdentityError(`User OAuth refresh failed (HTTP ${u.status}): ${(0,Gt.redactSensitive)(g)}`,u.status,(0,Gt.redactSensitive)(g),d)}let f=await(0,Gt.parseTokenResponse)(u,d),p=Number(f.expires_in);if(!Number.isFinite(p))throw new Gt.WorkloadIdentityError(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify((0,Gt.redactSensitive)(f))}`,u.status,(0,Gt.redactSensitive)(f),d);let m=(0,Z7.nowAsSeconds)()+p,h=f.refresh_token||a;return await(0,Gt.writeCredentialsFileAtomic)(t.credentialsPath,{...i,version:EMe.CREDENTIALS_FILE_VERSION,type:"oauth_token",access_token:f.access_token,expires_at:m,refresh_token:h}),{token:f.access_token,expiresAt:m}}}});var J7=v(Wi=>{"use strict";var OMe=Wi&&Wi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RMe=Wi&&Wi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),IMe=Wi&&Wi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i/credentials/.json)");return(0,DMe.userOAuthProvider)({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let i=t.authentication.type;throw new Vi.WorkloadIdentityError(`authentication.type "${i}" is not a known authentication type`)}}}function MMe(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Vi.WorkloadIdentityError(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Vi.WorkloadIdentityError('identity_token.source "file" requires a non-empty path');return(0,nD.identityTokenFromFile)(t.identity_token.path)}let e=(0,W7.readEnv)("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return(0,nD.identityTokenFromFile)(e);let r=(0,W7.readEnv)("ANTHROPIC_IDENTITY_TOKEN");return r?(0,nD.identityTokenFromValue)(r):null}function FMe(t,e,r,n){return async i=>{let o=await Promise.resolve().then(()=>IMe(Ge("node:fs")));await(0,Vi.checkCredentialsFileSafety)(e,n);let s;try{let c=await o.promises.readFile(e,"utf-8");s=JSON.parse(c);let l=s?.access_token;if(l&&!i?.forceRefresh){let u=s?.expires_at;if(u==null||(0,PMe.nowAsSeconds)(){"use strict";var pn,mn;Object.defineProperty(pm,"__esModule",{value:!0});pm.LineDecoder=void 0;pm.findDoubleNewlineIndex=zMe;var $t=_t(),JS=ZS(),fm=class{constructor(){pn.set(this,void 0),mn.set(this,void 0),$t.__classPrivateFieldSet(this,pn,new Uint8Array,"f"),$t.__classPrivateFieldSet(this,mn,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?(0,JS.encodeUTF8)(e):e;$t.__classPrivateFieldSet(this,pn,(0,JS.concatBytes)([$t.__classPrivateFieldGet(this,pn,"f"),r]),"f");let n=[],i;for(;(i=LMe($t.__classPrivateFieldGet(this,pn,"f"),$t.__classPrivateFieldGet(this,mn,"f")))!=null;){if(i.carriage&&$t.__classPrivateFieldGet(this,mn,"f")==null){$t.__classPrivateFieldSet(this,mn,i.index,"f");continue}if($t.__classPrivateFieldGet(this,mn,"f")!=null&&(i.index!==$t.__classPrivateFieldGet(this,mn,"f")+1||i.carriage)){n.push((0,JS.decodeUTF8)($t.__classPrivateFieldGet(this,pn,"f").subarray(0,$t.__classPrivateFieldGet(this,mn,"f")-1))),$t.__classPrivateFieldSet(this,pn,$t.__classPrivateFieldGet(this,pn,"f").subarray($t.__classPrivateFieldGet(this,mn,"f")),"f"),$t.__classPrivateFieldSet(this,mn,null,"f");continue}let o=$t.__classPrivateFieldGet(this,mn,"f")!==null?i.preceding-1:i.preceding,s=(0,JS.decodeUTF8)($t.__classPrivateFieldGet(this,pn,"f").subarray(0,o));n.push(s),$t.__classPrivateFieldSet(this,pn,$t.__classPrivateFieldGet(this,pn,"f").subarray(i.index),"f"),$t.__classPrivateFieldSet(this,mn,null,"f")}return n}flush(){return $t.__classPrivateFieldGet(this,pn,"f").length?this.decode(` `):[]}};pm.LineDecoder=fm;pn=new WeakMap,mn=new WeakMap;fm.NEWLINE_CHARS=new Set([` `,"\r"]);fm.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function LMe(t,e){for(let i=e??0;i{"use strict";var mm;Object.defineProperty(hm,"__esModule",{value:!0});hm.Stream=void 0;hm._iterSSEMessages=eQ;var sD=_t(),YS=pr(),UMe=ou(),lD=oD(),X7=ou(),Y7=nu(),qMe=qi(),Q7=ZS(),BMe=dm(),HMe=pr(),aD=class t{constructor(e,r,n){this.iterator=e,mm.set(this,void 0),this.controller=r,sD.__classPrivateFieldSet(this,mm,n,"f")}static fromSSEResponse(e,r,n){let i=!1,o=n?(0,BMe.loggerFor)(n):console;async function*s(){if(i)throw new YS.AnthropicError("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let a=!1;try{for await(let c of eQ(e,r)){if(c.event==="completion")try{yield JSON.parse(c.data)}catch(l){throw o.error("Could not parse message into JSON:",c.data),o.error("From chunk:",c.raw),l}if(c.event==="message_start"||c.event==="message_delta"||c.event==="message_stop"||c.event==="content_block_start"||c.event==="content_block_delta"||c.event==="content_block_stop"||c.event==="message"||c.event==="user.message"||c.event==="user.interrupt"||c.event==="user.tool_confirmation"||c.event==="user.custom_tool_result"||c.event==="agent.message"||c.event==="agent.thinking"||c.event==="agent.tool_use"||c.event==="agent.tool_result"||c.event==="agent.mcp_tool_use"||c.event==="agent.mcp_tool_result"||c.event==="agent.custom_tool_use"||c.event==="agent.thread_context_compacted"||c.event==="session.status_running"||c.event==="session.status_idle"||c.event==="session.status_rescheduled"||c.event==="session.status_terminated"||c.event==="session.error"||c.event==="session.deleted"||c.event==="span.model_request_start"||c.event==="span.model_request_end"||c.event==="span.outcome_evaluation_start"||c.event==="span.outcome_evaluation_ongoing"||c.event==="span.outcome_evaluation_end"||c.event==="user.define_outcome"||c.event==="agent.thread_message_received"||c.event==="agent.thread_message_sent"||c.event==="agent.session_thread_message_received"||c.event==="agent.session_thread_message_sent"||c.event==="session.thread_created"||c.event==="session.thread_status_created"||c.event==="session.thread_status_running"||c.event==="session.thread_status_idle"||c.event==="session.thread_status_rescheduled"||c.event==="session.thread_status_terminated")try{yield JSON.parse(c.data)}catch(l){throw o.error("Could not parse message into JSON:",c.data),o.error("From chunk:",c.raw),l}if(c.event!=="ping"&&c.event==="error"){let l=(0,qMe.safeJSON)(c.data)??c.data,u=l?.error?.type;throw new HMe.APIError(void 0,l,void 0,e.headers,u)}}a=!0}catch(c){if((0,Y7.isAbortError)(c))return;throw c}finally{a||r.abort()}}return new t(s,r,n)}static fromReadableStream(e,r,n){let i=!1;async function*o(){let a=new lD.LineDecoder,c=(0,X7.ReadableStreamToAsyncIterable)(e);for await(let l of c)for(let u of a.decode(l))yield u;for(let l of a.flush())yield l}async function*s(){if(i)throw new YS.AnthropicError("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let a=!1;try{for await(let c of o())a||c&&(yield JSON.parse(c));a=!0}catch(c){if((0,Y7.isAbortError)(c))return;throw c}finally{a||r.abort()}}return new t(s,r,n)}[(mm=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),i=o=>({next:()=>{if(o.length===0){let s=n.next();e.push(s),r.push(s)}return o.shift()}});return[new t(()=>i(e),this.controller,sD.__classPrivateFieldGet(this,mm,"f")),new t(()=>i(r),this.controller,sD.__classPrivateFieldGet(this,mm,"f"))]}toReadableStream(){let e=this,r;return(0,UMe.makeReadableStream)({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:i,done:o}=await r.next();if(o)return n.close();let s=(0,Q7.encodeUTF8)(JSON.stringify(i)+` `);n.enqueue(s)}catch(i){n.error(i)}},async cancel(){await r.return?.()}})}};hm.Stream=aD;async function*eQ(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new YS.AnthropicError("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new YS.AnthropicError("Attempted to iterate over a response with no body");let r=new cD,n=new lD.LineDecoder,i=(0,X7.ReadableStreamToAsyncIterable)(t.body);for await(let o of GMe(i))for(let s of n.decode(o)){let a=r.decode(s);a&&(yield a)}for(let o of n.flush()){let s=r.decode(o);s&&(yield s)}}async function*GMe(t){let e=new Uint8Array;for await(let r of t){if(r==null)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):typeof r=="string"?(0,Q7.encodeUTF8)(r):r,i=new Uint8Array(e.length+n.length);i.set(e),i.set(n,e.length),e=i;let o;for(;(o=(0,lD.findDoubleNewlineIndex)(e))!==-1;)yield e.slice(0,o),e=e.slice(o)}e.length>0&&(yield e)}var cD=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(` @@ -314,7 +314,7 @@ ${s}`:o||s}function UC(t,{maxDepth:e=1e3,numbersAsFloat:r=!1}={}){if(Up(t)!=="ob ${o.map(f=>f.error).join(` `)} ${s} -${d}`)}return s};xs.createPathTagFunction=hFe;xs.path=(0,xs.createPathTagFunction)(kD)});var AD=v(cw=>{"use strict";Object.defineProperty(cw,"__esModule",{value:!0});cw.Environments=void 0;var gFe=ot(),yFe=gt(),fu=st(),aw=kt(),ED=class extends gFe.APIResource{create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/environments?beta=true",{body:i,...r,headers:(0,fu.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,aw.path)`/v1/environments/${e}?beta=true`,{...n,headers:(0,fu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,aw.path)`/v1/environments/${e}?beta=true`,{body:o,...n,headers:(0,fu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/environments?beta=true",yFe.PageCursor,{query:i,...r,headers:(0,fu.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,aw.path)`/v1/environments/${e}?beta=true`,{...n,headers:(0,fu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:i}=r??{};return this._client.post((0,aw.path)`/v1/environments/${e}/archive?beta=true`,{...n,headers:(0,fu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};cw.Environments=ED});var bm=v(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.SDK_HELPER_SYMBOL=void 0;hn.wasCreatedByStainlessHelper=_m;hn.collectStainlessHelpers=mQ;hn.stainlessHelperHeader=_Fe;hn.stainlessHelperHeaderFromFile=bFe;hn.SDK_HELPER_SYMBOL=Symbol("anthropic.sdk.stainlessHelper");function _m(t){return typeof t=="object"&&t!==null&&hn.SDK_HELPER_SYMBOL in t}function mQ(t,e){let r=new Set;if(t)for(let n of t)_m(n)&&r.add(n[hn.SDK_HELPER_SYMBOL]);if(e){for(let n of e)if(_m(n)&&r.add(n[hn.SDK_HELPER_SYMBOL]),Array.isArray(n.content))for(let i of n.content)_m(i)&&r.add(i[hn.SDK_HELPER_SYMBOL])}return Array.from(r)}function _Fe(t,e){let r=mQ(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function bFe(t){return _m(t)?{"x-stainless-helper":t[hn.SDK_HELPER_SYMBOL]}:{}}});var RD=v(lw=>{"use strict";Object.defineProperty(lw,"__esModule",{value:!0});lw.Files=void 0;var vFe=ot(),SFe=gt(),vm=st(),wFe=bm(),xFe=uu(),TD=kt(),OD=class extends vFe.APIResource{list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/files?beta=true",SFe.Page,{query:i,...r,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,TD.path)`/v1/files/${e}?beta=true`,{...n,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:i}=r??{};return this._client.get((0,TD.path)`/v1/files/${e}/content?beta=true`,{...n,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:i}=r??{};return this._client.get((0,TD.path)`/v1/files/${e}?beta=true`,{...n,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...i}=e;return this._client.post("/v1/files?beta=true",(0,xFe.multipartFormRequestOptions)({body:i,...r,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},(0,wFe.stainlessHelperHeaderFromFile)(i.file),r?.headers])},this._client))}};lw.Files=OD});var PD=v(uw=>{"use strict";Object.defineProperty(uw,"__esModule",{value:!0});uw.Models=void 0;var $Fe=ot(),kFe=gt(),hQ=st(),EFe=kt(),ID=class extends $Fe.APIResource{retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,EFe.path)`/v1/models/${e}?beta=true`,{...n,headers:(0,hQ.buildHeaders)([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/models?beta=true",kFe.Page,{query:i,...r,headers:(0,hQ.buildHeaders)([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}};uw.Models=ID});var ND=v(dw=>{"use strict";Object.defineProperty(dw,"__esModule",{value:!0});dw.UserProfiles=void 0;var AFe=ot(),TFe=gt(),Sm=st(),CD=kt(),DD=class extends AFe.APIResource{create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/user_profiles?beta=true",{body:i,...r,headers:(0,Sm.buildHeaders)([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,CD.path)`/v1/user_profiles/${e}?beta=true`,{...n,headers:(0,Sm.buildHeaders)([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,CD.path)`/v1/user_profiles/${e}?beta=true`,{body:o,...n,headers:(0,Sm.buildHeaders)([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",TFe.PageCursor,{query:i,...r,headers:(0,Sm.buildHeaders)([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:i}=r??{};return this._client.post((0,CD.path)`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:(0,Sm.buildHeaders)([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}};dw.UserProfiles=DD});var yQ=v(fw=>{"use strict";Object.defineProperty(fw,"__esModule",{value:!0});fw.timingSafeEqual=void 0;function gQ(t,e=""){if(!t)throw new Error(e)}function OFe(t,e){if(t.byteLength!==e.byteLength)return!1;t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),gQ(t instanceof DataView),gQ(e instanceof DataView);let r=t.byteLength,n=0,i=-1;for(;++i{"use strict";var RFe=gn&&gn.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(gn,"__esModule",{value:!0});var Mt=256,jD=(function(){function t(e){e===void 0&&(e="="),this._paddingCharacter=e}return t.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},t.prototype.encode=function(e){for(var r="",n=0;n>>18&63),r+=this._encodeByte(i>>>12&63),r+=this._encodeByte(i>>>6&63),r+=this._encodeByte(i>>>0&63)}var o=e.length-n;if(o>0){var i=e[n]<<16|(o===2?e[n+1]<<8:0);r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),o===2?r+=this._encodeByte(i>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},t.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},t.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},t.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(e),n=e.length-r,i=new Uint8Array(this.maxDecodedLength(n)),o=0,s=0,a=0,c=0,l=0,u=0,d=0;s>>4,i[o++]=l<<4|u>>>2,i[o++]=u<<6|d,a|=c&Mt,a|=l&Mt,a|=u&Mt,a|=d&Mt;if(s>>4,a|=c&Mt,a|=l&Mt),s>>2,a|=u&Mt),s>>8&6,r+=51-e>>>8&-75,r+=61-e>>>8&-15,r+=62-e>>>8&3,String.fromCharCode(r)},t.prototype._decodeChar=function(e){var r=Mt;return r+=(42-e&e-44)>>>8&-Mt+e-43+62,r+=(46-e&e-48)>>>8&-Mt+e-47+63,r+=(47-e&e-58)>>>8&-Mt+e-48+52,r+=(64-e&e-91)>>>8&-Mt+e-65+0,r+=(96-e&e-123)>>>8&-Mt+e-97+26,r},t.prototype._getPaddingLength=function(e){var r=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)r++;if(e.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},t})();gn.Coder=jD;var wm=new jD;function IFe(t){return wm.encode(t)}gn.encode=IFe;function PFe(t){return wm.decode(t)}gn.decode=PFe;var _Q=(function(t){RFe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},e.prototype._decodeChar=function(r){var n=Mt;return n+=(44-r&r-46)>>>8&-Mt+r-45+62,n+=(94-r&r-96)>>>8&-Mt+r-95+63,n+=(47-r&r-58)>>>8&-Mt+r-48+52,n+=(64-r&r-91)>>>8&-Mt+r-65+0,n+=(96-r&r-123)>>>8&-Mt+r-97+26,n},e})(jD);gn.URLSafeCoder=_Q;var bQ=new _Q;function CFe(t){return bQ.encode(t)}gn.encodeURLSafe=CFe;function DFe(t){return bQ.decode(t)}gn.decodeURLSafe=DFe;gn.encodedLength=function(t){return wm.encodedLength(t)};gn.maxDecodedLength=function(t){return wm.maxDecodedLength(t)};gn.decodedLength=function(t){return wm.decodedLength(t)}});var wQ=v((SQ,pw)=>{(function(t,e){var r={};e(r);var n=r.default;for(var i in r)n[i]=r[i];typeof pw=="object"&&typeof pw.exports=="object"?pw.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(SQ,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(d,f,p,m,h){for(var g,b,_,S,x,w,O,T,A,D,$,ie,K;h>=64;){for(g=f[0],b=f[1],_=f[2],S=f[3],x=f[4],w=f[5],O=f[6],T=f[7],D=0;D<16;D++)$=m+D*4,d[D]=(p[$]&255)<<24|(p[$+1]&255)<<16|(p[$+2]&255)<<8|p[$+3]&255;for(D=16;D<64;D++)A=d[D-2],ie=(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10,A=d[D-15],K=(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3,d[D]=(ie+d[D-7]|0)+(K+d[D-16]|0);for(D=0;D<64;D++)ie=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&w^~x&O)|0)+(T+(e[D]+d[D]|0)|0)|0,K=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&b^g&_^b&_)|0,T=O,O=w,w=x,x=S+ie|0,S=_,_=b,b=g,g=ie+K|0;f[0]+=g,f[1]+=b,f[2]+=_,f[3]+=S,f[4]+=x,f[5]+=w,f[6]+=O,f[7]+=T,m+=64,h-=64}return m}var n=(function(){function d(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var f=0;f0){for(;this.bufferLength<64&&p>0;)this.buffer[this.bufferLength++]=f[m++],p--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(p>=64&&(m=r(this.temp,this.state,f,m,p),p%=64);p>0;)this.buffer[this.bufferLength++]=f[m++],p--;return this},d.prototype.finish=function(f){if(!this.finished){var p=this.bytesHashed,m=this.bufferLength,h=p/536870912|0,g=p<<3,b=p%64<56?64:128;this.buffer[m]=128;for(var _=m+1;_>>24&255,this.buffer[b-7]=h>>>16&255,this.buffer[b-6]=h>>>8&255,this.buffer[b-5]=h>>>0&255,this.buffer[b-4]=g>>>24&255,this.buffer[b-3]=g>>>16&255,this.buffer[b-2]=g>>>8&255,this.buffer[b-1]=g>>>0&255,r(this.temp,this.state,this.buffer,0,b),this.finished=!0}for(var _=0;_<8;_++)f[_*4+0]=this.state[_]>>>24&255,f[_*4+1]=this.state[_]>>>16&255,f[_*4+2]=this.state[_]>>>8&255,f[_*4+3]=this.state[_]>>>0&255;return this},d.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},d.prototype._saveState=function(f){for(var p=0;pthis.blockSize)new n().update(f).finish(p).clean();else for(var m=0;m1&&f.update(d),p&&f.update(p),f.update(m),f.finish(d),m[0]++}var c=new Uint8Array(t.digestLength);function l(d,f,p,m){f===void 0&&(f=c),m===void 0&&(m=32);for(var h=new Uint8Array([1]),g=s(f,d),b=new i(g),_=new Uint8Array(b.digestLength),S=_.length,x=new Uint8Array(m),w=0;w>>24&255,b[1]=O>>>16&255,b[2]=O>>>8&255,b[3]=O>>>0&255,h.reset(),h.update(f),h.update(b),h.finish(S);for(var T=0;T{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.Webhook=pu.WebhookVerificationError=void 0;var NFe=yQ(),xQ=vQ(),jFe=wQ(),$Q=300,MD=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},$s=class t extends MD{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};pu.WebhookVerificationError=$s;var mw=class t{constructor(e,r){if(!e)throw new Error("Secret can't be empty.");if(r?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,n=>n.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(t.prefix)&&(e=e.substring(t.prefix.length)),this.key=xQ.decode(e)}}verify(e,r){let n={};for(let f of Object.keys(r))n[f.toLowerCase()]=r[f];let i=n["webhook-id"],o=n["webhook-signature"],s=n["webhook-timestamp"];if(!o||!i||!s)throw new $s("Missing required headers");let a=this.verifyTimestamp(s),l=this.sign(i,a,e).split(",")[1],u=o.split(" "),d=new globalThis.TextEncoder;for(let f of u){let[p,m]=f.split(",");if(p==="v1"&&(0,NFe.timingSafeEqual)(d.encode(m),d.encode(l)))return JSON.parse(e.toString())}throw new $s("No matching signature found")}sign(e,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,o=Math.floor(r.getTime()/1e3),s=i.encode(`${e}.${o}.${n}`);return`v1,${xQ.encode(jFe.hmac(this.key,s))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new $s("Invalid Signature Headers");if(r-n>$Q)throw new $s("Message timestamp too old");if(n>r+$Q)throw new $s("Message timestamp too new");return new Date(n*1e3)}};pu.Webhook=mw;mw.prefix="whsec_"});var LD=v(hw=>{"use strict";Object.defineProperty(hw,"__esModule",{value:!0});hw.Webhooks=void 0;var MFe=ot(),FFe=kQ(),FD=class extends MFe.APIResource{unwrap(e,{headers:r,key:n}){if(r!==void 0){let i=n===void 0?this._client.webhookKey:n;if(i===null)throw new Error("Webhook key must not be null in order to unwrap");new FFe.Webhook(i).verify(e,r)}return JSON.parse(e)}};hw.Webhooks=FD});var UD=v(gw=>{"use strict";Object.defineProperty(gw,"__esModule",{value:!0});gw.Versions=void 0;var LFe=ot(),zFe=gt(),UFe=st(),qFe=kt(),zD=class extends LFe.APIResource{list(e,r={},n){let{betas:i,...o}=r??{};return this._client.getAPIList((0,qFe.path)`/v1/agents/${e}/versions?beta=true`,zFe.PageCursor,{query:o,...n,headers:(0,UFe.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};gw.Versions=zD});var BD=v(_w=>{"use strict";Object.defineProperty(_w,"__esModule",{value:!0});_w.Agents=void 0;var BFe=_t(),HFe=ot(),GFe=BFe.__importStar(UD()),ZFe=UD(),VFe=gt(),xm=st(),qD=kt(),yw=class extends HFe.APIResource{constructor(){super(...arguments),this.versions=new GFe.Versions(this._client)}create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/agents?beta=true",{body:i,...r,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i,...o}=r??{};return this._client.get((0,qD.path)`/v1/agents/${e}?beta=true`,{query:o,...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,qD.path)`/v1/agents/${e}?beta=true`,{body:o,...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/agents?beta=true",VFe.PageCursor,{query:i,...r,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:i}=r??{};return this._client.post((0,qD.path)`/v1/agents/${e}/archive?beta=true`,{...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};_w.Agents=yw;yw.Versions=ZFe.Versions});var GD=v(bw=>{"use strict";Object.defineProperty(bw,"__esModule",{value:!0});bw.Memories=void 0;var WFe=ot(),KFe=gt(),$m=st(),km=kt(),HD=class extends WFe.APIResource{create(e,r,n){let{view:i,betas:o,...s}=r;return this._client.post((0,km.path)`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:i},body:s,...n,headers:(0,$m.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:i,betas:o,...s}=r;return this._client.get((0,km.path)`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:s,...n,headers:(0,$m.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:i,view:o,betas:s,...a}=r;return this._client.post((0,km.path)`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:{view:o},body:a,...n,headers:(0,$m.buildHeaders)([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:i,...o}=r??{};return this._client.getAPIList((0,km.path)`/v1/memory_stores/${e}/memories?beta=true`,KFe.PageCursor,{query:o,...n,headers:(0,$m.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:i,expected_content_sha256:o,betas:s}=r;return this._client.delete((0,km.path)`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:{expected_content_sha256:o},...n,headers:(0,$m.buildHeaders)([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};bw.Memories=HD});var KD=v(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0});vw.MemoryVersions=void 0;var JFe=ot(),YFe=gt(),ZD=st(),VD=kt(),WD=class extends JFe.APIResource{retrieve(e,r,n){let{memory_store_id:i,betas:o,...s}=r;return this._client.get((0,VD.path)`/v1/memory_stores/${i}/memory_versions/${e}?beta=true`,{query:s,...n,headers:(0,ZD.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:i,...o}=r??{};return this._client.getAPIList((0,VD.path)`/v1/memory_stores/${e}/memory_versions?beta=true`,YFe.PageCursor,{query:o,...n,headers:(0,ZD.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:i,betas:o}=r;return this._client.post((0,VD.path)`/v1/memory_stores/${i}/memory_versions/${e}/redact?beta=true`,{...n,headers:(0,ZD.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};vw.MemoryVersions=WD});var JD=v(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});ww.MemoryStores=void 0;var EQ=_t(),XFe=ot(),QFe=EQ.__importStar(GD()),eLe=GD(),tLe=EQ.__importStar(KD()),rLe=KD(),nLe=gt(),mu=st(),Sw=kt(),Em=class extends XFe.APIResource{constructor(){super(...arguments),this.memories=new QFe.Memories(this._client),this.memoryVersions=new tLe.MemoryVersions(this._client)}create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/memory_stores?beta=true",{body:i,...r,headers:(0,mu.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,Sw.path)`/v1/memory_stores/${e}?beta=true`,{...n,headers:(0,mu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,Sw.path)`/v1/memory_stores/${e}?beta=true`,{body:o,...n,headers:(0,mu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",nLe.PageCursor,{query:i,...r,headers:(0,mu.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,Sw.path)`/v1/memory_stores/${e}?beta=true`,{...n,headers:(0,mu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:i}=r??{};return this._client.post((0,Sw.path)`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:(0,mu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};ww.MemoryStores=Em;Em.Memories=eLe.Memories;Em.MemoryVersions=rLe.MemoryVersions});var hu=v(YD=>{"use strict";Object.defineProperty(YD,"__esModule",{value:!0});var iLe=_t();iLe.__exportStar(pr(),YD)});var QD=v(xw=>{"use strict";Object.defineProperty(xw,"__esModule",{value:!0});xw.JSONLDecoder=void 0;var AQ=pr(),oLe=ou(),sLe=oD(),XD=class t{constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new sLe.LineDecoder;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new AQ.AnthropicError("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new AQ.AnthropicError("Attempted to iterate over a response with no body");return new t((0,oLe.ReadableStreamToAsyncIterable)(e.body),r)}};xw.JSONLDecoder=XD});var rN=v($w=>{"use strict";Object.defineProperty($w,"__esModule",{value:!0});$w.Batches=void 0;var aLe=ot(),cLe=gt(),gu=st(),lLe=QD(),uLe=hu(),eN=kt(),tN=class extends aLe.APIResource{create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/messages/batches?beta=true",{body:i,...r,headers:(0,gu.buildHeaders)([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,eN.path)`/v1/messages/batches/${e}?beta=true`,{...n,headers:(0,gu.buildHeaders)([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",cLe.Page,{query:i,...r,headers:(0,gu.buildHeaders)([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,eN.path)`/v1/messages/batches/${e}?beta=true`,{...n,headers:(0,gu.buildHeaders)([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:i}=r??{};return this._client.post((0,eN.path)`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:(0,gu.buildHeaders)([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let i=await this.retrieve(e);if(!i.results_url)throw new uLe.AnthropicError(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{betas:o}=r??{};return this._client.get(i.results_url,{...n,headers:(0,gu.buildHeaders)([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,a)=>lLe.JSONLDecoder.fromResponse(a.response,a.controller))}};$w.Batches=tN});var nN=v(kw=>{"use strict";Object.defineProperty(kw,"__esModule",{value:!0});kw.MODEL_NONSTREAMING_TOKENS=void 0;kw.MODEL_NONSTREAMING_TOKENS={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});var iN=v(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0});Ew.maybeParseBetaMessage=fLe;Ew.parseBetaMessage=OQ;var dLe=pr();function TQ(t){return t?.output_format??t?.output_config?.format}function fLe(t,e,r){let n=TQ(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(i=>{if(i.type==="text"){let o=Object.defineProperty({...i},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return i}),parsed_output:null}:OQ(t,e,r)}function OQ(t,e,r){let n=null,i=t.content.map(o=>{if(o.type==="text"){let s=pLe(e,o.text);n===null&&(n=s);let a=Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),s},enumerable:!1})}return o});return{...t,content:i,parsed_output:n}}function pLe(t,e){let r=TQ(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new dLe.AnthropicError(`Failed to parse structured output: ${n}`)}}});var oN=v(Aw=>{"use strict";Object.defineProperty(Aw,"__esModule",{value:!0});Aw.partialParse=void 0;var mLe=t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),yu(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),yu(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),yu(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),yu(t);break;case"delimiter":return t=t.slice(0,t.length-1),yu(t);break}return t},hLe=t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},gLe=t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},yLe=t=>JSON.parse(gLe(hLe(yu(mLe(t)))));Aw.partialParse=yLe});var aN=v(sN=>{"use strict";Object.defineProperty(sN,"__esModule",{value:!0});var _Le=_t();_Le.__exportStar(uD(),sN)});var jQ=v(Nw=>{"use strict";var Nn,ks,_u,Am,Tw,Tm,Om,Ow,Rm,Io,Im,Rw,Iw,pc,Pw,Cw,Pm,cN,RQ,Dw,lN,uN,dN,IQ;Object.defineProperty(Nw,"__esModule",{value:!0});Nw.BetaMessageStream=void 0;var X=_t(),bLe=oN(),xr=hu(),vLe=nu(),PQ=aN(),CQ=iN(),DQ="__json_buf";function NQ(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var fN=class t{constructor(e,r){Nn.add(this),this.messages=[],this.receivedMessages=[],ks.set(this,void 0),_u.set(this,null),this.controller=new AbortController,Am.set(this,void 0),Tw.set(this,()=>{}),Tm.set(this,()=>{}),Om.set(this,void 0),Ow.set(this,()=>{}),Rm.set(this,()=>{}),Io.set(this,{}),Im.set(this,!1),Rw.set(this,!1),Iw.set(this,!1),pc.set(this,!1),Pw.set(this,void 0),Cw.set(this,void 0),Pm.set(this,void 0),Dw.set(this,n=>{if(X.__classPrivateFieldSet(this,Rw,!0,"f"),(0,vLe.isAbortError)(n)&&(n=new xr.APIUserAbortError),n instanceof xr.APIUserAbortError)return X.__classPrivateFieldSet(this,Iw,!0,"f"),this._emit("abort",n);if(n instanceof xr.AnthropicError)return this._emit("error",n);if(n instanceof Error){let i=new xr.AnthropicError(n.message);return i.cause=n,this._emit("error",i)}return this._emit("error",new xr.AnthropicError(String(n)))}),X.__classPrivateFieldSet(this,Am,new Promise((n,i)=>{X.__classPrivateFieldSet(this,Tw,n,"f"),X.__classPrivateFieldSet(this,Tm,i,"f")}),"f"),X.__classPrivateFieldSet(this,Om,new Promise((n,i)=>{X.__classPrivateFieldSet(this,Ow,n,"f"),X.__classPrivateFieldSet(this,Rm,i,"f")}),"f"),X.__classPrivateFieldGet(this,Am,"f").catch(()=>{}),X.__classPrivateFieldGet(this,Om,"f").catch(()=>{}),X.__classPrivateFieldSet(this,_u,e,"f"),X.__classPrivateFieldSet(this,Pm,r?.logger??console,"f")}get response(){return X.__classPrivateFieldGet(this,Pw,"f")}get request_id(){return X.__classPrivateFieldGet(this,Cw,"f")}async withResponse(){X.__classPrivateFieldSet(this,pc,!0,"f");let e=await X.__classPrivateFieldGet(this,Am,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:i}={}){let o=new t(r,{logger:i});for(let s of r.messages)o._addMessageParam(s);return X.__classPrivateFieldSet(o,_u,{...r,stream:!0},"f"),o._run(()=>o._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),o}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},X.__classPrivateFieldGet(this,Dw,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let i=n?.signal,o;i&&(i.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),i.addEventListener("abort",o));try{X.__classPrivateFieldGet(this,Nn,"m",lN).call(this);let{response:s,data:a}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(s);for await(let c of a)X.__classPrivateFieldGet(this,Nn,"m",uN).call(this,c);if(a.controller.signal?.aborted)throw new xr.APIUserAbortError;X.__classPrivateFieldGet(this,Nn,"m",dN).call(this)}finally{i&&o&&i.removeEventListener("abort",o)}}_connected(e){this.ended||(X.__classPrivateFieldSet(this,Pw,e,"f"),X.__classPrivateFieldSet(this,Cw,e?.headers.get("request-id"),"f"),X.__classPrivateFieldGet(this,Tw,"f").call(this,e),this._emit("connect"))}get ended(){return X.__classPrivateFieldGet(this,Im,"f")}get errored(){return X.__classPrivateFieldGet(this,Rw,"f")}get aborted(){return X.__classPrivateFieldGet(this,Iw,"f")}abort(){this.controller.abort()}on(e,r){return(X.__classPrivateFieldGet(this,Io,"f")[e]||(X.__classPrivateFieldGet(this,Io,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=X.__classPrivateFieldGet(this,Io,"f")[e];if(!n)return this;let i=n.findIndex(o=>o.listener===r);return i>=0&&n.splice(i,1),this}once(e,r){return(X.__classPrivateFieldGet(this,Io,"f")[e]||(X.__classPrivateFieldGet(this,Io,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{X.__classPrivateFieldSet(this,pc,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){X.__classPrivateFieldSet(this,pc,!0,"f"),await X.__classPrivateFieldGet(this,Om,"f")}get currentMessage(){return X.__classPrivateFieldGet(this,ks,"f")}async finalMessage(){return await this.done(),X.__classPrivateFieldGet(this,Nn,"m",cN).call(this)}async finalText(){return await this.done(),X.__classPrivateFieldGet(this,Nn,"m",RQ).call(this)}_emit(e,...r){if(X.__classPrivateFieldGet(this,Im,"f"))return;e==="end"&&(X.__classPrivateFieldSet(this,Im,!0,"f"),X.__classPrivateFieldGet(this,Ow,"f").call(this));let n=X.__classPrivateFieldGet(this,Io,"f")[e];if(n&&(X.__classPrivateFieldGet(this,Io,"f")[e]=n.filter(i=>!i.once),n.forEach(({listener:i})=>i(...r))),e==="abort"){let i=r[0];!X.__classPrivateFieldGet(this,pc,"f")&&!n?.length&&Promise.reject(i),X.__classPrivateFieldGet(this,Tm,"f").call(this,i),X.__classPrivateFieldGet(this,Rm,"f").call(this,i),this._emit("end");return}if(e==="error"){let i=r[0];!X.__classPrivateFieldGet(this,pc,"f")&&!n?.length&&Promise.reject(i),X.__classPrivateFieldGet(this,Tm,"f").call(this,i),X.__classPrivateFieldGet(this,Rm,"f").call(this,i),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",X.__classPrivateFieldGet(this,Nn,"m",cN).call(this))}async _fromReadableStream(e,r){let n=r?.signal,i;n&&(n.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),n.addEventListener("abort",i));try{X.__classPrivateFieldGet(this,Nn,"m",lN).call(this),this._connected(null);let o=PQ.Stream.fromReadableStream(e,this.controller);for await(let s of o)X.__classPrivateFieldGet(this,Nn,"m",uN).call(this,s);if(o.controller.signal?.aborted)throw new xr.APIUserAbortError;X.__classPrivateFieldGet(this,Nn,"m",dN).call(this)}finally{n&&i&&n.removeEventListener("abort",i)}}[(ks=new WeakMap,_u=new WeakMap,Am=new WeakMap,Tw=new WeakMap,Tm=new WeakMap,Om=new WeakMap,Ow=new WeakMap,Rm=new WeakMap,Io=new WeakMap,Im=new WeakMap,Rw=new WeakMap,Iw=new WeakMap,pc=new WeakMap,Pw=new WeakMap,Cw=new WeakMap,Pm=new WeakMap,Dw=new WeakMap,Nn=new WeakSet,cN=function(){if(this.receivedMessages.length===0)throw new xr.AnthropicError("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},RQ=function(){if(this.receivedMessages.length===0)throw new xr.AnthropicError("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new xr.AnthropicError("stream ended without producing a content block with type=text");return r.join(" ")},lN=function(){this.ended||X.__classPrivateFieldSet(this,ks,void 0,"f")},uN=function(r){if(this.ended)return;let n=X.__classPrivateFieldGet(this,Nn,"m",IQ).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let i=n.content.at(-1);switch(r.delta.type){case"text_delta":{i.type==="text"&&this._emit("text",r.delta.text,i.text||"");break}case"citations_delta":{i.type==="text"&&this._emit("citation",r.delta.citation,i.citations??[]);break}case"input_json_delta":{NQ(i)&&i.input&&this._emit("inputJson",r.delta.partial_json,i.input);break}case"thinking_delta":{i.type==="thinking"&&this._emit("thinking",r.delta.thinking,i.thinking);break}case"signature_delta":{i.type==="thinking"&&this._emit("signature",i.signature);break}case"compaction_delta":{i.type==="compaction"&&i.content&&this._emit("compaction",i.content);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage((0,CQ.maybeParseBetaMessage)(n,X.__classPrivateFieldGet(this,_u,"f"),{logger:X.__classPrivateFieldGet(this,Pm,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{X.__classPrivateFieldSet(this,ks,n,"f");break}case"content_block_start":case"message_delta":break}},dN=function(){if(this.ended)throw new xr.AnthropicError("stream has ended, this shouldn't happen");let r=X.__classPrivateFieldGet(this,ks,"f");if(!r)throw new xr.AnthropicError("request ended without sending any chunks");return X.__classPrivateFieldSet(this,ks,void 0,"f"),(0,CQ.maybeParseBetaMessage)(r,X.__classPrivateFieldGet(this,_u,"f"),{logger:X.__classPrivateFieldGet(this,Pm,"f")})},IQ=function(r){let n=X.__classPrivateFieldGet(this,ks,"f");if(r.type==="message_start"){if(n)throw new xr.AnthropicError(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new xr.AnthropicError(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.container=r.delta.container,n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,n.context_management=r.context_management,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),r.usage.iterations!=null&&(n.usage.iterations=r.usage.iterations),n;case"content_block_start":return n.content.push(r.content_block),n;case"content_block_delta":{let i=n.content.at(r.index);switch(r.delta.type){case"text_delta":{i?.type==="text"&&(n.content[r.index]={...i,text:(i.text||"")+r.delta.text});break}case"citations_delta":{i?.type==="text"&&(n.content[r.index]={...i,citations:[...i.citations??[],r.delta.citation]});break}case"input_json_delta":{if(i&&NQ(i)){let o=i[DQ]||"";o+=r.delta.partial_json;let s={...i};if(Object.defineProperty(s,DQ,{value:o,enumerable:!1,writable:!0}),o)try{s.input=(0,bLe.partialParse)(o)}catch(a){let c=new xr.AnthropicError(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${a}. JSON: ${o}`);X.__classPrivateFieldGet(this,Dw,"f").call(this,c)}n.content[r.index]=s}break}case"thinking_delta":{i?.type==="thinking"&&(n.content[r.index]={...i,thinking:i.thinking+r.delta.thinking});break}case"signature_delta":{i?.type==="thinking"&&(n.content[r.index]={...i,signature:r.delta.signature});break}case"compaction_delta":{i?.type==="compaction"&&(n.content[r.index]={...i,content:(i.content||"")+r.delta.content});break}default:r.delta}return n}case"content_block_stop":return n}},Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",i=>{let o=r.shift();o?o.resolve(i):e.push(i)}),this.on("end",()=>{n=!0;for(let i of r)i.resolve(void 0);r.length=0}),this.on("abort",i=>{n=!0;for(let o of r)o.reject(i);r.length=0}),this.on("error",i=>{n=!0;for(let o of r)o.reject(i);r.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new PQ.Stream(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}};Nw.BetaMessageStream=fN});var Mw=v(jw=>{"use strict";Object.defineProperty(jw,"__esModule",{value:!0});jw.ToolError=void 0;var pN=class extends Error{constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}};jw.ToolError=pN});var MQ=v(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.DEFAULT_SUMMARY_PROMPT=bu.DEFAULT_TOKEN_THRESHOLD=void 0;bu.DEFAULT_TOKEN_THRESHOLD=1e5;bu.DEFAULT_SUMMARY_PROMPT=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: +${d}`)}return s};xs.createPathTagFunction=hFe;xs.path=(0,xs.createPathTagFunction)(kD)});var AD=v(cw=>{"use strict";Object.defineProperty(cw,"__esModule",{value:!0});cw.Environments=void 0;var gFe=ot(),yFe=gt(),fu=st(),aw=kt(),ED=class extends gFe.APIResource{create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/environments?beta=true",{body:i,...r,headers:(0,fu.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,aw.path)`/v1/environments/${e}?beta=true`,{...n,headers:(0,fu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,aw.path)`/v1/environments/${e}?beta=true`,{body:o,...n,headers:(0,fu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/environments?beta=true",yFe.PageCursor,{query:i,...r,headers:(0,fu.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,aw.path)`/v1/environments/${e}?beta=true`,{...n,headers:(0,fu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:i}=r??{};return this._client.post((0,aw.path)`/v1/environments/${e}/archive?beta=true`,{...n,headers:(0,fu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};cw.Environments=ED});var bm=v(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.SDK_HELPER_SYMBOL=void 0;hn.wasCreatedByStainlessHelper=_m;hn.collectStainlessHelpers=mQ;hn.stainlessHelperHeader=_Fe;hn.stainlessHelperHeaderFromFile=bFe;hn.SDK_HELPER_SYMBOL=Symbol("anthropic.sdk.stainlessHelper");function _m(t){return typeof t=="object"&&t!==null&&hn.SDK_HELPER_SYMBOL in t}function mQ(t,e){let r=new Set;if(t)for(let n of t)_m(n)&&r.add(n[hn.SDK_HELPER_SYMBOL]);if(e){for(let n of e)if(_m(n)&&r.add(n[hn.SDK_HELPER_SYMBOL]),Array.isArray(n.content))for(let i of n.content)_m(i)&&r.add(i[hn.SDK_HELPER_SYMBOL])}return Array.from(r)}function _Fe(t,e){let r=mQ(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function bFe(t){return _m(t)?{"x-stainless-helper":t[hn.SDK_HELPER_SYMBOL]}:{}}});var RD=v(lw=>{"use strict";Object.defineProperty(lw,"__esModule",{value:!0});lw.Files=void 0;var vFe=ot(),SFe=gt(),vm=st(),wFe=bm(),xFe=uu(),TD=kt(),OD=class extends vFe.APIResource{list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/files?beta=true",SFe.Page,{query:i,...r,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,TD.path)`/v1/files/${e}?beta=true`,{...n,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:i}=r??{};return this._client.get((0,TD.path)`/v1/files/${e}/content?beta=true`,{...n,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:i}=r??{};return this._client.get((0,TD.path)`/v1/files/${e}?beta=true`,{...n,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...i??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...i}=e;return this._client.post("/v1/files?beta=true",(0,xFe.multipartFormRequestOptions)({body:i,...r,headers:(0,vm.buildHeaders)([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},(0,wFe.stainlessHelperHeaderFromFile)(i.file),r?.headers])},this._client))}};lw.Files=OD});var PD=v(uw=>{"use strict";Object.defineProperty(uw,"__esModule",{value:!0});uw.Models=void 0;var $Fe=ot(),kFe=gt(),hQ=st(),EFe=kt(),ID=class extends $Fe.APIResource{retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,EFe.path)`/v1/models/${e}?beta=true`,{...n,headers:(0,hQ.buildHeaders)([{...i?.toString()!=null?{"anthropic-beta":i?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/models?beta=true",kFe.Page,{query:i,...r,headers:(0,hQ.buildHeaders)([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}};uw.Models=ID});var ND=v(dw=>{"use strict";Object.defineProperty(dw,"__esModule",{value:!0});dw.UserProfiles=void 0;var AFe=ot(),TFe=gt(),Sm=st(),CD=kt(),DD=class extends AFe.APIResource{create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/user_profiles?beta=true",{body:i,...r,headers:(0,Sm.buildHeaders)([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,CD.path)`/v1/user_profiles/${e}?beta=true`,{...n,headers:(0,Sm.buildHeaders)([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,CD.path)`/v1/user_profiles/${e}?beta=true`,{body:o,...n,headers:(0,Sm.buildHeaders)([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",TFe.PageCursor,{query:i,...r,headers:(0,Sm.buildHeaders)([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:i}=r??{};return this._client.post((0,CD.path)`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:(0,Sm.buildHeaders)([{"anthropic-beta":[...i??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}};dw.UserProfiles=DD});var yQ=v(fw=>{"use strict";Object.defineProperty(fw,"__esModule",{value:!0});fw.timingSafeEqual=void 0;function gQ(t,e=""){if(!t)throw new Error(e)}function OFe(t,e){if(t.byteLength!==e.byteLength)return!1;t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),gQ(t instanceof DataView),gQ(e instanceof DataView);let r=t.byteLength,n=0,i=-1;for(;++i{"use strict";var RFe=gn&&gn.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(gn,"__esModule",{value:!0});var Mt=256,jD=(function(){function t(e){e===void 0&&(e="="),this._paddingCharacter=e}return t.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},t.prototype.encode=function(e){for(var r="",n=0;n>>18&63),r+=this._encodeByte(i>>>12&63),r+=this._encodeByte(i>>>6&63),r+=this._encodeByte(i>>>0&63)}var o=e.length-n;if(o>0){var i=e[n]<<16|(o===2?e[n+1]<<8:0);r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),o===2?r+=this._encodeByte(i>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},t.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},t.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},t.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(e),n=e.length-r,i=new Uint8Array(this.maxDecodedLength(n)),o=0,s=0,a=0,c=0,l=0,u=0,d=0;s>>4,i[o++]=l<<4|u>>>2,i[o++]=u<<6|d,a|=c&Mt,a|=l&Mt,a|=u&Mt,a|=d&Mt;if(s>>4,a|=c&Mt,a|=l&Mt),s>>2,a|=u&Mt),s>>8&6,r+=51-e>>>8&-75,r+=61-e>>>8&-15,r+=62-e>>>8&3,String.fromCharCode(r)},t.prototype._decodeChar=function(e){var r=Mt;return r+=(42-e&e-44)>>>8&-Mt+e-43+62,r+=(46-e&e-48)>>>8&-Mt+e-47+63,r+=(47-e&e-58)>>>8&-Mt+e-48+52,r+=(64-e&e-91)>>>8&-Mt+e-65+0,r+=(96-e&e-123)>>>8&-Mt+e-97+26,r},t.prototype._getPaddingLength=function(e){var r=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)r++;if(e.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},t})();gn.Coder=jD;var wm=new jD;function IFe(t){return wm.encode(t)}gn.encode=IFe;function PFe(t){return wm.decode(t)}gn.decode=PFe;var _Q=(function(t){RFe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},e.prototype._decodeChar=function(r){var n=Mt;return n+=(44-r&r-46)>>>8&-Mt+r-45+62,n+=(94-r&r-96)>>>8&-Mt+r-95+63,n+=(47-r&r-58)>>>8&-Mt+r-48+52,n+=(64-r&r-91)>>>8&-Mt+r-65+0,n+=(96-r&r-123)>>>8&-Mt+r-97+26,n},e})(jD);gn.URLSafeCoder=_Q;var bQ=new _Q;function CFe(t){return bQ.encode(t)}gn.encodeURLSafe=CFe;function DFe(t){return bQ.decode(t)}gn.decodeURLSafe=DFe;gn.encodedLength=function(t){return wm.encodedLength(t)};gn.maxDecodedLength=function(t){return wm.maxDecodedLength(t)};gn.decodedLength=function(t){return wm.decodedLength(t)}});var wQ=v((SQ,pw)=>{(function(t,e){var r={};e(r);var n=r.default;for(var i in r)n[i]=r[i];typeof pw=="object"&&typeof pw.exports=="object"?pw.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(SQ,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(d,f,p,m,h){for(var g,b,_,S,x,w,O,T,A,D,$,re,K;h>=64;){for(g=f[0],b=f[1],_=f[2],S=f[3],x=f[4],w=f[5],O=f[6],T=f[7],D=0;D<16;D++)$=m+D*4,d[D]=(p[$]&255)<<24|(p[$+1]&255)<<16|(p[$+2]&255)<<8|p[$+3]&255;for(D=16;D<64;D++)A=d[D-2],re=(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10,A=d[D-15],K=(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3,d[D]=(re+d[D-7]|0)+(K+d[D-16]|0);for(D=0;D<64;D++)re=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&w^~x&O)|0)+(T+(e[D]+d[D]|0)|0)|0,K=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&b^g&_^b&_)|0,T=O,O=w,w=x,x=S+re|0,S=_,_=b,b=g,g=re+K|0;f[0]+=g,f[1]+=b,f[2]+=_,f[3]+=S,f[4]+=x,f[5]+=w,f[6]+=O,f[7]+=T,m+=64,h-=64}return m}var n=(function(){function d(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var f=0;f0){for(;this.bufferLength<64&&p>0;)this.buffer[this.bufferLength++]=f[m++],p--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(p>=64&&(m=r(this.temp,this.state,f,m,p),p%=64);p>0;)this.buffer[this.bufferLength++]=f[m++],p--;return this},d.prototype.finish=function(f){if(!this.finished){var p=this.bytesHashed,m=this.bufferLength,h=p/536870912|0,g=p<<3,b=p%64<56?64:128;this.buffer[m]=128;for(var _=m+1;_>>24&255,this.buffer[b-7]=h>>>16&255,this.buffer[b-6]=h>>>8&255,this.buffer[b-5]=h>>>0&255,this.buffer[b-4]=g>>>24&255,this.buffer[b-3]=g>>>16&255,this.buffer[b-2]=g>>>8&255,this.buffer[b-1]=g>>>0&255,r(this.temp,this.state,this.buffer,0,b),this.finished=!0}for(var _=0;_<8;_++)f[_*4+0]=this.state[_]>>>24&255,f[_*4+1]=this.state[_]>>>16&255,f[_*4+2]=this.state[_]>>>8&255,f[_*4+3]=this.state[_]>>>0&255;return this},d.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},d.prototype._saveState=function(f){for(var p=0;pthis.blockSize)new n().update(f).finish(p).clean();else for(var m=0;m1&&f.update(d),p&&f.update(p),f.update(m),f.finish(d),m[0]++}var c=new Uint8Array(t.digestLength);function l(d,f,p,m){f===void 0&&(f=c),m===void 0&&(m=32);for(var h=new Uint8Array([1]),g=s(f,d),b=new i(g),_=new Uint8Array(b.digestLength),S=_.length,x=new Uint8Array(m),w=0;w>>24&255,b[1]=O>>>16&255,b[2]=O>>>8&255,b[3]=O>>>0&255,h.reset(),h.update(f),h.update(b),h.finish(S);for(var T=0;T{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.Webhook=pu.WebhookVerificationError=void 0;var NFe=yQ(),xQ=vQ(),jFe=wQ(),$Q=300,MD=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},$s=class t extends MD{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};pu.WebhookVerificationError=$s;var mw=class t{constructor(e,r){if(!e)throw new Error("Secret can't be empty.");if(r?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,n=>n.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(t.prefix)&&(e=e.substring(t.prefix.length)),this.key=xQ.decode(e)}}verify(e,r){let n={};for(let f of Object.keys(r))n[f.toLowerCase()]=r[f];let i=n["webhook-id"],o=n["webhook-signature"],s=n["webhook-timestamp"];if(!o||!i||!s)throw new $s("Missing required headers");let a=this.verifyTimestamp(s),l=this.sign(i,a,e).split(",")[1],u=o.split(" "),d=new globalThis.TextEncoder;for(let f of u){let[p,m]=f.split(",");if(p==="v1"&&(0,NFe.timingSafeEqual)(d.encode(m),d.encode(l)))return JSON.parse(e.toString())}throw new $s("No matching signature found")}sign(e,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,o=Math.floor(r.getTime()/1e3),s=i.encode(`${e}.${o}.${n}`);return`v1,${xQ.encode(jFe.hmac(this.key,s))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new $s("Invalid Signature Headers");if(r-n>$Q)throw new $s("Message timestamp too old");if(n>r+$Q)throw new $s("Message timestamp too new");return new Date(n*1e3)}};pu.Webhook=mw;mw.prefix="whsec_"});var LD=v(hw=>{"use strict";Object.defineProperty(hw,"__esModule",{value:!0});hw.Webhooks=void 0;var MFe=ot(),FFe=kQ(),FD=class extends MFe.APIResource{unwrap(e,{headers:r,key:n}){if(r!==void 0){let i=n===void 0?this._client.webhookKey:n;if(i===null)throw new Error("Webhook key must not be null in order to unwrap");new FFe.Webhook(i).verify(e,r)}return JSON.parse(e)}};hw.Webhooks=FD});var UD=v(gw=>{"use strict";Object.defineProperty(gw,"__esModule",{value:!0});gw.Versions=void 0;var LFe=ot(),zFe=gt(),UFe=st(),qFe=kt(),zD=class extends LFe.APIResource{list(e,r={},n){let{betas:i,...o}=r??{};return this._client.getAPIList((0,qFe.path)`/v1/agents/${e}/versions?beta=true`,zFe.PageCursor,{query:o,...n,headers:(0,UFe.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};gw.Versions=zD});var BD=v(_w=>{"use strict";Object.defineProperty(_w,"__esModule",{value:!0});_w.Agents=void 0;var BFe=_t(),HFe=ot(),GFe=BFe.__importStar(UD()),ZFe=UD(),VFe=gt(),xm=st(),qD=kt(),yw=class extends HFe.APIResource{constructor(){super(...arguments),this.versions=new GFe.Versions(this._client)}create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/agents?beta=true",{body:i,...r,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i,...o}=r??{};return this._client.get((0,qD.path)`/v1/agents/${e}?beta=true`,{query:o,...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,qD.path)`/v1/agents/${e}?beta=true`,{body:o,...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/agents?beta=true",VFe.PageCursor,{query:i,...r,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:i}=r??{};return this._client.post((0,qD.path)`/v1/agents/${e}/archive?beta=true`,{...n,headers:(0,xm.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};_w.Agents=yw;yw.Versions=ZFe.Versions});var GD=v(bw=>{"use strict";Object.defineProperty(bw,"__esModule",{value:!0});bw.Memories=void 0;var WFe=ot(),KFe=gt(),$m=st(),km=kt(),HD=class extends WFe.APIResource{create(e,r,n){let{view:i,betas:o,...s}=r;return this._client.post((0,km.path)`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:i},body:s,...n,headers:(0,$m.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:i,betas:o,...s}=r;return this._client.get((0,km.path)`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:s,...n,headers:(0,$m.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:i,view:o,betas:s,...a}=r;return this._client.post((0,km.path)`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:{view:o},body:a,...n,headers:(0,$m.buildHeaders)([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:i,...o}=r??{};return this._client.getAPIList((0,km.path)`/v1/memory_stores/${e}/memories?beta=true`,KFe.PageCursor,{query:o,...n,headers:(0,$m.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:i,expected_content_sha256:o,betas:s}=r;return this._client.delete((0,km.path)`/v1/memory_stores/${i}/memories/${e}?beta=true`,{query:{expected_content_sha256:o},...n,headers:(0,$m.buildHeaders)([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};bw.Memories=HD});var KD=v(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0});vw.MemoryVersions=void 0;var JFe=ot(),YFe=gt(),ZD=st(),VD=kt(),WD=class extends JFe.APIResource{retrieve(e,r,n){let{memory_store_id:i,betas:o,...s}=r;return this._client.get((0,VD.path)`/v1/memory_stores/${i}/memory_versions/${e}?beta=true`,{query:s,...n,headers:(0,ZD.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:i,...o}=r??{};return this._client.getAPIList((0,VD.path)`/v1/memory_stores/${e}/memory_versions?beta=true`,YFe.PageCursor,{query:o,...n,headers:(0,ZD.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:i,betas:o}=r;return this._client.post((0,VD.path)`/v1/memory_stores/${i}/memory_versions/${e}/redact?beta=true`,{...n,headers:(0,ZD.buildHeaders)([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};vw.MemoryVersions=WD});var JD=v(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});ww.MemoryStores=void 0;var EQ=_t(),XFe=ot(),QFe=EQ.__importStar(GD()),eLe=GD(),tLe=EQ.__importStar(KD()),rLe=KD(),nLe=gt(),mu=st(),Sw=kt(),Em=class extends XFe.APIResource{constructor(){super(...arguments),this.memories=new QFe.Memories(this._client),this.memoryVersions=new tLe.MemoryVersions(this._client)}create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/memory_stores?beta=true",{body:i,...r,headers:(0,mu.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,Sw.path)`/v1/memory_stores/${e}?beta=true`,{...n,headers:(0,mu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:i,...o}=r;return this._client.post((0,Sw.path)`/v1/memory_stores/${e}?beta=true`,{body:o,...n,headers:(0,mu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",nLe.PageCursor,{query:i,...r,headers:(0,mu.buildHeaders)([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,Sw.path)`/v1/memory_stores/${e}?beta=true`,{...n,headers:(0,mu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:i}=r??{};return this._client.post((0,Sw.path)`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:(0,mu.buildHeaders)([{"anthropic-beta":[...i??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};ww.MemoryStores=Em;Em.Memories=eLe.Memories;Em.MemoryVersions=rLe.MemoryVersions});var hu=v(YD=>{"use strict";Object.defineProperty(YD,"__esModule",{value:!0});var iLe=_t();iLe.__exportStar(pr(),YD)});var QD=v(xw=>{"use strict";Object.defineProperty(xw,"__esModule",{value:!0});xw.JSONLDecoder=void 0;var AQ=pr(),oLe=ou(),sLe=oD(),XD=class t{constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new sLe.LineDecoder;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new AQ.AnthropicError("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new AQ.AnthropicError("Attempted to iterate over a response with no body");return new t((0,oLe.ReadableStreamToAsyncIterable)(e.body),r)}};xw.JSONLDecoder=XD});var rN=v($w=>{"use strict";Object.defineProperty($w,"__esModule",{value:!0});$w.Batches=void 0;var aLe=ot(),cLe=gt(),gu=st(),lLe=QD(),uLe=hu(),eN=kt(),tN=class extends aLe.APIResource{create(e,r){let{betas:n,...i}=e;return this._client.post("/v1/messages/batches?beta=true",{body:i,...r,headers:(0,gu.buildHeaders)([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:i}=r??{};return this._client.get((0,eN.path)`/v1/messages/batches/${e}?beta=true`,{...n,headers:(0,gu.buildHeaders)([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...i}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",cLe.Page,{query:i,...r,headers:(0,gu.buildHeaders)([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:i}=r??{};return this._client.delete((0,eN.path)`/v1/messages/batches/${e}?beta=true`,{...n,headers:(0,gu.buildHeaders)([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:i}=r??{};return this._client.post((0,eN.path)`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:(0,gu.buildHeaders)([{"anthropic-beta":[...i??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let i=await this.retrieve(e);if(!i.results_url)throw new uLe.AnthropicError(`No batch \`results_url\`; Has it finished processing? ${i.processing_status} - ${i.id}`);let{betas:o}=r??{};return this._client.get(i.results_url,{...n,headers:(0,gu.buildHeaders)([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((s,a)=>lLe.JSONLDecoder.fromResponse(a.response,a.controller))}};$w.Batches=tN});var nN=v(kw=>{"use strict";Object.defineProperty(kw,"__esModule",{value:!0});kw.MODEL_NONSTREAMING_TOKENS=void 0;kw.MODEL_NONSTREAMING_TOKENS={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});var iN=v(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0});Ew.maybeParseBetaMessage=fLe;Ew.parseBetaMessage=OQ;var dLe=pr();function TQ(t){return t?.output_format??t?.output_config?.format}function fLe(t,e,r){let n=TQ(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(i=>{if(i.type==="text"){let o=Object.defineProperty({...i},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(o,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return i}),parsed_output:null}:OQ(t,e,r)}function OQ(t,e,r){let n=null,i=t.content.map(o=>{if(o.type==="text"){let s=pLe(e,o.text);n===null&&(n=s);let a=Object.defineProperty({...o},"parsed_output",{value:s,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),s},enumerable:!1})}return o});return{...t,content:i,parsed_output:n}}function pLe(t,e){let r=TQ(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new dLe.AnthropicError(`Failed to parse structured output: ${n}`)}}});var oN=v(Aw=>{"use strict";Object.defineProperty(Aw,"__esModule",{value:!0});Aw.partialParse=void 0;var mLe=t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),yu(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),yu(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),yu(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),yu(t);break;case"delimiter":return t=t.slice(0,t.length-1),yu(t);break}return t},hLe=t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},gLe=t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},yLe=t=>JSON.parse(gLe(hLe(yu(mLe(t)))));Aw.partialParse=yLe});var aN=v(sN=>{"use strict";Object.defineProperty(sN,"__esModule",{value:!0});var _Le=_t();_Le.__exportStar(uD(),sN)});var jQ=v(Nw=>{"use strict";var Nn,ks,_u,Am,Tw,Tm,Om,Ow,Rm,Io,Im,Rw,Iw,pc,Pw,Cw,Pm,cN,RQ,Dw,lN,uN,dN,IQ;Object.defineProperty(Nw,"__esModule",{value:!0});Nw.BetaMessageStream=void 0;var X=_t(),bLe=oN(),xr=hu(),vLe=nu(),PQ=aN(),CQ=iN(),DQ="__json_buf";function NQ(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var fN=class t{constructor(e,r){Nn.add(this),this.messages=[],this.receivedMessages=[],ks.set(this,void 0),_u.set(this,null),this.controller=new AbortController,Am.set(this,void 0),Tw.set(this,()=>{}),Tm.set(this,()=>{}),Om.set(this,void 0),Ow.set(this,()=>{}),Rm.set(this,()=>{}),Io.set(this,{}),Im.set(this,!1),Rw.set(this,!1),Iw.set(this,!1),pc.set(this,!1),Pw.set(this,void 0),Cw.set(this,void 0),Pm.set(this,void 0),Dw.set(this,n=>{if(X.__classPrivateFieldSet(this,Rw,!0,"f"),(0,vLe.isAbortError)(n)&&(n=new xr.APIUserAbortError),n instanceof xr.APIUserAbortError)return X.__classPrivateFieldSet(this,Iw,!0,"f"),this._emit("abort",n);if(n instanceof xr.AnthropicError)return this._emit("error",n);if(n instanceof Error){let i=new xr.AnthropicError(n.message);return i.cause=n,this._emit("error",i)}return this._emit("error",new xr.AnthropicError(String(n)))}),X.__classPrivateFieldSet(this,Am,new Promise((n,i)=>{X.__classPrivateFieldSet(this,Tw,n,"f"),X.__classPrivateFieldSet(this,Tm,i,"f")}),"f"),X.__classPrivateFieldSet(this,Om,new Promise((n,i)=>{X.__classPrivateFieldSet(this,Ow,n,"f"),X.__classPrivateFieldSet(this,Rm,i,"f")}),"f"),X.__classPrivateFieldGet(this,Am,"f").catch(()=>{}),X.__classPrivateFieldGet(this,Om,"f").catch(()=>{}),X.__classPrivateFieldSet(this,_u,e,"f"),X.__classPrivateFieldSet(this,Pm,r?.logger??console,"f")}get response(){return X.__classPrivateFieldGet(this,Pw,"f")}get request_id(){return X.__classPrivateFieldGet(this,Cw,"f")}async withResponse(){X.__classPrivateFieldSet(this,pc,!0,"f");let e=await X.__classPrivateFieldGet(this,Am,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:i}={}){let o=new t(r,{logger:i});for(let s of r.messages)o._addMessageParam(s);return X.__classPrivateFieldSet(o,_u,{...r,stream:!0},"f"),o._run(()=>o._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),o}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},X.__classPrivateFieldGet(this,Dw,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let i=n?.signal,o;i&&(i.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),i.addEventListener("abort",o));try{X.__classPrivateFieldGet(this,Nn,"m",lN).call(this);let{response:s,data:a}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(s);for await(let c of a)X.__classPrivateFieldGet(this,Nn,"m",uN).call(this,c);if(a.controller.signal?.aborted)throw new xr.APIUserAbortError;X.__classPrivateFieldGet(this,Nn,"m",dN).call(this)}finally{i&&o&&i.removeEventListener("abort",o)}}_connected(e){this.ended||(X.__classPrivateFieldSet(this,Pw,e,"f"),X.__classPrivateFieldSet(this,Cw,e?.headers.get("request-id"),"f"),X.__classPrivateFieldGet(this,Tw,"f").call(this,e),this._emit("connect"))}get ended(){return X.__classPrivateFieldGet(this,Im,"f")}get errored(){return X.__classPrivateFieldGet(this,Rw,"f")}get aborted(){return X.__classPrivateFieldGet(this,Iw,"f")}abort(){this.controller.abort()}on(e,r){return(X.__classPrivateFieldGet(this,Io,"f")[e]||(X.__classPrivateFieldGet(this,Io,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=X.__classPrivateFieldGet(this,Io,"f")[e];if(!n)return this;let i=n.findIndex(o=>o.listener===r);return i>=0&&n.splice(i,1),this}once(e,r){return(X.__classPrivateFieldGet(this,Io,"f")[e]||(X.__classPrivateFieldGet(this,Io,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{X.__classPrivateFieldSet(this,pc,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){X.__classPrivateFieldSet(this,pc,!0,"f"),await X.__classPrivateFieldGet(this,Om,"f")}get currentMessage(){return X.__classPrivateFieldGet(this,ks,"f")}async finalMessage(){return await this.done(),X.__classPrivateFieldGet(this,Nn,"m",cN).call(this)}async finalText(){return await this.done(),X.__classPrivateFieldGet(this,Nn,"m",RQ).call(this)}_emit(e,...r){if(X.__classPrivateFieldGet(this,Im,"f"))return;e==="end"&&(X.__classPrivateFieldSet(this,Im,!0,"f"),X.__classPrivateFieldGet(this,Ow,"f").call(this));let n=X.__classPrivateFieldGet(this,Io,"f")[e];if(n&&(X.__classPrivateFieldGet(this,Io,"f")[e]=n.filter(i=>!i.once),n.forEach(({listener:i})=>i(...r))),e==="abort"){let i=r[0];!X.__classPrivateFieldGet(this,pc,"f")&&!n?.length&&Promise.reject(i),X.__classPrivateFieldGet(this,Tm,"f").call(this,i),X.__classPrivateFieldGet(this,Rm,"f").call(this,i),this._emit("end");return}if(e==="error"){let i=r[0];!X.__classPrivateFieldGet(this,pc,"f")&&!n?.length&&Promise.reject(i),X.__classPrivateFieldGet(this,Tm,"f").call(this,i),X.__classPrivateFieldGet(this,Rm,"f").call(this,i),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",X.__classPrivateFieldGet(this,Nn,"m",cN).call(this))}async _fromReadableStream(e,r){let n=r?.signal,i;n&&(n.aborted&&this.controller.abort(),i=this.controller.abort.bind(this.controller),n.addEventListener("abort",i));try{X.__classPrivateFieldGet(this,Nn,"m",lN).call(this),this._connected(null);let o=PQ.Stream.fromReadableStream(e,this.controller);for await(let s of o)X.__classPrivateFieldGet(this,Nn,"m",uN).call(this,s);if(o.controller.signal?.aborted)throw new xr.APIUserAbortError;X.__classPrivateFieldGet(this,Nn,"m",dN).call(this)}finally{n&&i&&n.removeEventListener("abort",i)}}[(ks=new WeakMap,_u=new WeakMap,Am=new WeakMap,Tw=new WeakMap,Tm=new WeakMap,Om=new WeakMap,Ow=new WeakMap,Rm=new WeakMap,Io=new WeakMap,Im=new WeakMap,Rw=new WeakMap,Iw=new WeakMap,pc=new WeakMap,Pw=new WeakMap,Cw=new WeakMap,Pm=new WeakMap,Dw=new WeakMap,Nn=new WeakSet,cN=function(){if(this.receivedMessages.length===0)throw new xr.AnthropicError("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},RQ=function(){if(this.receivedMessages.length===0)throw new xr.AnthropicError("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new xr.AnthropicError("stream ended without producing a content block with type=text");return r.join(" ")},lN=function(){this.ended||X.__classPrivateFieldSet(this,ks,void 0,"f")},uN=function(r){if(this.ended)return;let n=X.__classPrivateFieldGet(this,Nn,"m",IQ).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let i=n.content.at(-1);switch(r.delta.type){case"text_delta":{i.type==="text"&&this._emit("text",r.delta.text,i.text||"");break}case"citations_delta":{i.type==="text"&&this._emit("citation",r.delta.citation,i.citations??[]);break}case"input_json_delta":{NQ(i)&&i.input&&this._emit("inputJson",r.delta.partial_json,i.input);break}case"thinking_delta":{i.type==="thinking"&&this._emit("thinking",r.delta.thinking,i.thinking);break}case"signature_delta":{i.type==="thinking"&&this._emit("signature",i.signature);break}case"compaction_delta":{i.type==="compaction"&&i.content&&this._emit("compaction",i.content);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage((0,CQ.maybeParseBetaMessage)(n,X.__classPrivateFieldGet(this,_u,"f"),{logger:X.__classPrivateFieldGet(this,Pm,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{X.__classPrivateFieldSet(this,ks,n,"f");break}case"content_block_start":case"message_delta":break}},dN=function(){if(this.ended)throw new xr.AnthropicError("stream has ended, this shouldn't happen");let r=X.__classPrivateFieldGet(this,ks,"f");if(!r)throw new xr.AnthropicError("request ended without sending any chunks");return X.__classPrivateFieldSet(this,ks,void 0,"f"),(0,CQ.maybeParseBetaMessage)(r,X.__classPrivateFieldGet(this,_u,"f"),{logger:X.__classPrivateFieldGet(this,Pm,"f")})},IQ=function(r){let n=X.__classPrivateFieldGet(this,ks,"f");if(r.type==="message_start"){if(n)throw new xr.AnthropicError(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new xr.AnthropicError(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.container=r.delta.container,n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,n.context_management=r.context_management,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),r.usage.iterations!=null&&(n.usage.iterations=r.usage.iterations),n;case"content_block_start":return n.content.push(r.content_block),n;case"content_block_delta":{let i=n.content.at(r.index);switch(r.delta.type){case"text_delta":{i?.type==="text"&&(n.content[r.index]={...i,text:(i.text||"")+r.delta.text});break}case"citations_delta":{i?.type==="text"&&(n.content[r.index]={...i,citations:[...i.citations??[],r.delta.citation]});break}case"input_json_delta":{if(i&&NQ(i)){let o=i[DQ]||"";o+=r.delta.partial_json;let s={...i};if(Object.defineProperty(s,DQ,{value:o,enumerable:!1,writable:!0}),o)try{s.input=(0,bLe.partialParse)(o)}catch(a){let c=new xr.AnthropicError(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${a}. JSON: ${o}`);X.__classPrivateFieldGet(this,Dw,"f").call(this,c)}n.content[r.index]=s}break}case"thinking_delta":{i?.type==="thinking"&&(n.content[r.index]={...i,thinking:i.thinking+r.delta.thinking});break}case"signature_delta":{i?.type==="thinking"&&(n.content[r.index]={...i,signature:r.delta.signature});break}case"compaction_delta":{i?.type==="compaction"&&(n.content[r.index]={...i,content:(i.content||"")+r.delta.content});break}default:r.delta}return n}case"content_block_stop":return n}},Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",i=>{let o=r.shift();o?o.resolve(i):e.push(i)}),this.on("end",()=>{n=!0;for(let i of r)i.resolve(void 0);r.length=0}),this.on("abort",i=>{n=!0;for(let o of r)o.reject(i);r.length=0}),this.on("error",i=>{n=!0;for(let o of r)o.reject(i);r.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new PQ.Stream(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}};Nw.BetaMessageStream=fN});var Mw=v(jw=>{"use strict";Object.defineProperty(jw,"__esModule",{value:!0});jw.ToolError=void 0;var pN=class extends Error{constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}};jw.ToolError=pN});var MQ=v(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.DEFAULT_SUMMARY_PROMPT=bu.DEFAULT_TOKEN_THRESHOLD=void 0;bu.DEFAULT_TOKEN_THRESHOLD=1e5;bu.DEFAULT_SUMMARY_PROMPT=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: 1. Task Overview The user's core request and success criteria Any clarifications or constraints they specified @@ -420,18 +420,18 @@ new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); `)}p.write("payload.value = newResult;"),p.write("return payload;");let _=p.compile();return(S,x)=>_(f,S,x)},o,s=Ac,a=!kc.jitless,l=a&&hM.value,u=e.catchall,d;t._zod.parse=(f,p)=>{d??(d=n.value);let m=f.value;return s(m)?a&&l&&p?.async===!1&&p.jitless!==!0?(o||(o=i(e.shape)),f=o(f,p),u?Bre([],m,f,p,d,t):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),f)}});td=k("$ZodUnion",(t,e)=>{ue.init(t,e),ve(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),ve(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ve(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),ve(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>vh(i.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let o=!1,s=[];for(let a of e.options){let c=a._zod.run({value:n.value,issues:[]},i);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>Are(a,n,t,i)):Are(s,n,t,i)}});o$=k("$ZodXor",(t,e)=>{td.init(t,e),e.inclusive=!1;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let o=!1,s=[];for(let a of e.options){let c=a._zod.run({value:n.value,issues:[]},i);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>Tre(a,n,t,i)):Tre(s,n,t,i)}}),s$=k("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,td.init(t,e);let r=t._zod.parse;ve(t._zod,"propValues",()=>{let i={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,c]of Object.entries(s)){i[a]||(i[a]=new Set);for(let l of c)i[a].add(l)}}return i});let n=Vu(()=>{let i=e.options,o=new Map;for(let s of i){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});t._zod.parse=(i,o)=>{let s=i.value;if(!Ac(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),i;let a=n.value.get(s?.[e.discriminator]);return a?a._zod.run(i,o):e.unionFallback||o.direction==="backward"?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:s,path:[e.discriminator],inst:t}),i)}}),a$=k("$ZodIntersection",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>{let i=r.value,o=e.left._zod.run({value:i,issues:[]},n),s=e.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>Ore(r,c,l)):Ore(r,o,s)}});Ph=k("$ZodTuple",(t,e)=>{ue.init(t,e);let r=e.items;t._zod.parse=(n,i)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];let s=[],a=Rre(r,"optin"),c=Rre(r,"optout");if(!e.rest){if(o.lengthr.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:o,inst:t,origin:"array"})}let l=new Array(r.length);for(let u=0;u{l[u]=f})):l[u]=d}if(e.rest){let u=r.length-1,d=o.slice(r.length);for(let f of d){u++;let p=e.rest._zod.run({value:f,issues:[]},i);p instanceof Promise?s.push(p.then(m=>Ire(m,n,u))):Ire(p,n,u)}}return s.length?Promise.all(s).then(()=>Pre(l,n,r,o,c)):Pre(l,n,r,o,c)}});c$=k("$ZodRecord",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Ms(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let u=e.keyType._zod.run({value:l,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>kr(p,n,Tt())),input:l,path:[l],inst:t});continue}let d=u.value,f=e.valueType._zod.run({value:i[l],issues:[]},n);f instanceof Promise?o.push(f.then(p=>{p.issues.length&&r.issues.push(...Hr(l,p.issues)),r.value[d]=p.value})):(f.issues.length&&r.issues.push(...Hr(l,f.issues)),r.value[d]=f.value)}let c;for(let l in i)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(i)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&y0.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=i[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>kr(d,n,Tt())),input:a,path:[a],inst:t});continue}let u=e.valueType._zod.run({value:i[a],issues:[]},n);u instanceof Promise?o.push(u.then(d=>{d.issues.length&&r.issues.push(...Hr(a,d.issues)),r.value[c.value]=d.value})):(u.issues.length&&r.issues.push(...Hr(a,u.issues)),r.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),l$=k("$ZodMap",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:t}),r;let o=[];r.value=new Map;for(let[s,a]of i){let c=e.keyType._zod.run({value:s,issues:[]},n),l=e.valueType._zod.run({value:a,issues:[]},n);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([u,d])=>{Cre(u,d,r,s,i,t,n)})):Cre(c,l,r,s,i,t,n)}return o.length?Promise.all(o).then(()=>r):r}});u$=k("$ZodSet",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:t,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of i){let a=e.valueType._zod.run({value:s,issues:[]},n);a instanceof Promise?o.push(a.then(c=>Dre(c,r))):Dre(a,r)}return o.length?Promise.all(o).then(()=>r):r}});d$=k("$ZodEnum",(t,e)=>{ue.init(t,e);let r=bh(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>Sh.has(typeof i)).map(i=>typeof i=="string"?Ln(i):i.toString()).join("|")})$`),t._zod.parse=(i,o)=>{let s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:r,input:s,inst:t}),i}}),f$=k("$ZodLiteral",(t,e)=>{if(ue.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Ln(n):n?Ln(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),n}}),p$=k("$ZodFile",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:t}),r}}),m$=k("$ZodTransform",(t,e)=>{ue.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(r.value=s,r.fallback=!0,r));if(i instanceof Promise)throw new mi;return r.value=i,r.fallback=!0,r}});Ch=k("$ZodOptional",(t,e)=>{ue.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ve(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ve(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${vh(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=r.value,o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Nre(s,i)):Nre(o,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),h$=k("$ZodExactOptional",(t,e)=>{Ch.init(t,e),ve(t._zod,"values",()=>e.innerType._zod.values),ve(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),g$=k("$ZodNullable",(t,e)=>{ue.init(t,e),ve(t._zod,"optin",()=>e.innerType._zod.optin),ve(t._zod,"optout",()=>e.innerType._zod.optout),ve(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${vh(r.source)}|null)$`):void 0}),ve(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),y$=k("$ZodDefault",(t,e)=>{ue.init(t,e),t._zod.optin="optional",ve(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>jre(o,e)):jre(i,e)}});_$=k("$ZodPrefault",(t,e)=>{ue.init(t,e),t._zod.optin="optional",ve(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),b$=k("$ZodNonOptional",(t,e)=>{ue.init(t,e),ve(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>Mre(o,t)):Mre(i,t)}});v$=k("$ZodSuccess",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds("ZodSuccess");let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.issues.length===0,r)):(r.value=i.issues.length===0,r)}}),S$=k("$ZodCatch",(t,e)=>{ue.init(t,e),t._zod.optin="optional",ve(t._zod,"optout",()=>e.innerType._zod.optout),ve(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>kr(s,n,Tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(o=>kr(o,n,Tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),w$=k("$ZodNaN",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),Dh=k("$ZodPipe",(t,e)=>{ue.init(t,e),ve(t._zod,"values",()=>e.in._zod.values),ve(t._zod,"optin",()=>e.in._zod.optin),ve(t._zod,"optout",()=>e.out._zod.optout),ve(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let o=e.out._zod.run(r,n);return o instanceof Promise?o.then(s=>w0(s,e.in,n)):w0(o,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(o=>w0(o,e.out,n)):w0(i,e.out,n)}});rd=k("$ZodCodec",(t,e)=>{ue.init(t,e),ve(t._zod,"values",()=>e.in._zod.values),ve(t._zod,"optin",()=>e.in._zod.optin),ve(t._zod,"optout",()=>e.out._zod.optout),ve(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>x0(s,e,n)):x0(o,e,n)}else{let o=e.out._zod.run(r,n);return o instanceof Promise?o.then(s=>x0(s,e,n)):x0(o,e,n)}}});TF=k("$ZodPreprocess",(t,e)=>{Dh.init(t,e)}),x$=k("$ZodReadonly",(t,e)=>{ue.init(t,e),ve(t._zod,"propValues",()=>e.innerType._zod.propValues),ve(t._zod,"values",()=>e.innerType._zod.values),ve(t._zod,"optin",()=>e.innerType?._zod?.optin),ve(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(Fre):Fre(i)}});$$=k("$ZodTemplateLiteral",(t,e)=>{ue.init(t,e);let r=[];for(let n of e.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let o=i.startsWith("^")?1:0,s=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(o,s))}else if(n===null||gM.has(typeof n))r.push(Ln(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"string",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),n)}),k$=k("$ZodFunction",(t,e)=>(ue.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let i=t._def.input?Tc(t._def.input,n):n,o=Reflect.apply(r,this,i);return t._def.output?Tc(t._def.output,o):o}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let i=t._def.input?await Oc(t._def.input,n):n,o=await Reflect.apply(r,this,i);return t._def.output?await Oc(t._def.output,o):o}},t._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let n=t.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Ph({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new n({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let n=t.constructor;return new n({type:"function",input:t._def.input,output:r})},t)),E$=k("$ZodPromise",(t,e)=>{ue.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(i=>e.innerType._zod.run({value:i,issues:[]},n))}),A$=k("$ZodLazy",(t,e)=>{ue.init(t,e),ve(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),ve(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),ve(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),ve(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),ve(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),T$=k("$ZodCustom",(t,e)=>{Qe.init(t,e),ue.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(o=>Lre(o,r,n,t));Lre(i,r,n,t)}})});function Hre(){return{localeError:Z6e()}}var Z6e,Gre=y(()=>{ee();Z6e=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(i){return t[i]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${i.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return i.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${N(i.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${i.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${i.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${r[o.format]??i.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${i.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${i.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${i.keys.length>1?"\u0629":""}: ${R(i.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function Zre(){return{localeError:V6e()}}var V6e,Vre=y(()=>{ee();V6e=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${i.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return i.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${N(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.format]??i.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${i.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${i.keys.length>1?"lar":""}: ${R(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${i.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function Wre(t,e,r,n){let i=Math.abs(t),o=i%10,s=i%100;return s>=11&&s<=19?n:o===1?e:o>=2&&o<=4?r:n}function Kre(){return{localeError:W6e()}}var W6e,Jre=y(()=>{ee();W6e=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(i){return t[i]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},n={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${i.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${N(i.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),c=Wre(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${i.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),c=Wre(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${i.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${i.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${R(i.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${i.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function Yre(){return{localeError:K6e()}}var K6e,Xre=y(()=>{ee();K6e=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${N(i.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${i.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${i.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u043E\u0432\u0435":""}: ${R(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function Qre(){return{localeError:J6e()}}var J6e,ene=y(()=>{ee();J6e=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(i){return t[i]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${i.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return i.values.length===1?`Valor inv\xE0lid: s'esperava ${N(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${R(i.values," o ")}`;case"too_big":{let o=i.inclusive?"com a m\xE0xim":"menys de",s=e(i.origin);return s?`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xE9s ${o} ${i.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(i.origin);return s?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${o} ${i.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${i.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${i.origin}`;default:return"Entrada inv\xE0lida"}}}});function tne(){return{localeError:Y6e()}}var Y6e,rne=y(()=>{ee();Y6e=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(i){return t[i]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},n={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${i.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${N(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${R(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${i.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${i.origin}`;default:return"Neplatn\xFD vstup"}}}});function nne(){return{localeError:X6e()}}var X6e,ine=y(()=>{ee();X6e=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(i){return t[i]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldigt input: forventede instanceof ${i.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return i.values.length===1?`Ugyldig v\xE6rdi: forventede ${N(i.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin),a=n[i.origin]??i.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin),a=n[i.origin]??i.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${i.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${R(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${i.origin}`;default:return"Ugyldigt input"}}}});function one(){return{localeError:Q6e()}}var Q6e,sne=y(()=>{ee();Q6e=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(i){return t[i]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},n={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${i.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return i.values.length===1?`Ung\xFCltige Eingabe: erwartet ${N(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ist`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ist`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.format]??i.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${R(i.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${i.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${i.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function ane(){return{localeError:eBe()}}var eBe,cne=y(()=>{ee();eBe=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(i){return t[i]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return typeof i.expected=="string"&&/^[A-Z]/.test(i.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${i.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return i.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${N(i.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${i.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${i.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${o.prefix}"`:o.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${o.suffix}"`:o.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${o.includes}"`:o.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[o.format]??i.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${i.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${i.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${i.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${R(i.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${i.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${i.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}}});function O$(){return{localeError:tBe()}}var tBe,RF=y(()=>{ee();tBe=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${N(i.values[0])}`:`Invalid option: expected one of ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${s.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}}});function lne(){return{localeError:rBe()}}var rBe,une=y(()=>{ee();rBe=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(i){return t[i]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${i.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${N(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${o}${i.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}}});function dne(){return{localeError:nBe()}}var nBe,fne=y(()=>{ee();nBe=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(i){return t[i]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${i.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: se esperaba ${N(i.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin),a=n[i.origin]??i.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${i.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin),a=n[i.origin]??i.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${i.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n[i.origin]??i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n[i.origin]??i.origin}`;default:return"Entrada inv\xE1lida"}}}});function pne(){return{localeError:iBe()}}var iBe,mne=y(()=>{ee();iBe=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(i){return t[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${i.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return i.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${N(i.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${R(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.format]??i.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${i.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${i.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${R(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${i.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${i.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function hne(){return{localeError:oBe()}}var oBe,gne=y(()=>{ee();oBe=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(i){return t[i]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return i.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${N(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${i.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${i.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${R(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function yne(){return{localeError:sBe()}}var sBe,_ne=y(()=>{ee();sBe=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return t[i]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : instanceof ${i.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : ${N(i.values[0])} attendu`:`Option invalide : une valeur parmi ${R(i.values,"|")} attendue`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Trop grand : ${n[i.origin]??"valeur"} doit ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n[i.origin]??"valeur"} doit \xEAtre ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Trop petit : ${n[i.origin]??"valeur"} doit ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Trop petit : ${n[i.origin]??"valeur"} doit \xEAtre ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${r[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${R(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}}});function bne(){return{localeError:aBe()}}var aBe,vne=y(()=>{ee();aBe=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return t[i]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : attendu instanceof ${i.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : attendu ${N(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"\u2264":"<",s=e(i.origin);return s?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${o}${i.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"\u2265":">",s=e(i.origin);return s?`Trop petit : attendu que ${i.origin} ait ${o}${i.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${i.origin} soit ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${R(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}}});function Sne(){return{localeError:cBe()}}var cBe,wne=y(()=>{ee();cBe=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?t[l]:void 0,n=l=>{let u=r(l);return u?u.label:l??t.unknown.label},i=l=>`\u05D4${n(l)}`,o=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?e[l]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,d=c[u??""]??n(u),f=j(l.input),p=c[f]??t[f]?.label??f;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${N(l.values[0])}`;let u=l.values.map(p=>N(p));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=s(l.origin),d=i(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let f=l.inclusive?"<=":"<",p=o(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),d=i(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let m=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(l.origin==="array"||l.origin==="set"){let m=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let g=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`}let h=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let f=l.inclusive?">=":">",p=o(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let d=a[u.format],f=d?.label??u.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${m}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${R(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function xne(){return{localeError:lBe()}}var lBe,$ne=y(()=>{ee();lBe=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(i){return t[i]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},n={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${i.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return i.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${N(i.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin),a=n[i.origin]??i.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${o}${i.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin),a=n[i.origin]??i.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${o}${i.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${r[o.format]??i.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${i.divisor}`;case"unrecognized_keys":return`Neprepoznat${i.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${R(i.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${n[i.origin]??i.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${n[i.origin]??i.origin}`;default:return"Neispravan unos"}}}});function kne(){return{localeError:uBe()}}var uBe,Ene=y(()=>{ee();uBe=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(i){return t[i]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},n={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${i.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return i.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${N(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${i.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${o}${i.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.format]??i.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${i.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${i.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${i.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function Ane(t,e,r){return Math.abs(t)===1?e:r}function nd(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}function Tne(){return{localeError:dBe()}}var dBe,One=y(()=>{ee();dBe=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(i){return t[i]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},n={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${i.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return i.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${N(i.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),c=Ane(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${nd(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${i.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${nd(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),c=Ane(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${nd(i.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${i.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${nd(i.origin)} \u056C\u056B\u0576\u056B ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.format]??i.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${i.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${i.keys.length>1?"\u0576\u0565\u0580":""}. ${R(i.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${nd(i.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${nd(i.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function Rne(){return{localeError:fBe()}}var fBe,Ine=y(()=>{ee();fBe=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(i){return t[i]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${N(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${o}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Terlalu kecil: diharapkan ${i.origin} memiliki ${o}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}}});function Pne(){return{localeError:pBe()}}var pBe,Cne=y(()=>{ee();pBe=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(i){return t[i]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},n={nan:"NaN",number:"n\xFAmer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${i.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return i.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${N(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${o}${i.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${o}${i.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.format]??i.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${R(i.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${i.origin}`;default:return"Rangt gildi"}}}});function Dne(){return{localeError:mBe()}}var mBe,Nne=y(()=>{ee();mBe=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(i){return t[i]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Input non valido: atteso instanceof ${i.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return i.values.length===1?`Input non valido: atteso ${N(i.values[0])}`:`Opzione non valida: atteso uno tra ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Troppo grande: ${i.origin??"valore"} deve avere ${o}${i.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Troppo piccolo: ${i.origin} deve avere ${o}${i.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${i.origin} deve essere ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${r[o.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${R(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}}});function jne(){return{localeError:hBe()}}var hBe,Mne=y(()=>{ee();hBe=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(i){return t[i]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},n={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${i.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return i.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${N(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${R(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=i.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(i.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=i.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(i.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.format]??i.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${i.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${i.keys.length>1?"\u7FA4":""}: ${R(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function Fne(){return{localeError:gBe()}}var gBe,Lne=y(()=>{ee();gBe=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(i){return t[i]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},n={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return i.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${N(i.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${R(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${i.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${i.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${R(i.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${i.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${i.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function R$(){return{localeError:yBe()}}var yBe,IF=y(()=>{ee();yBe=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(i){return t[i]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},n={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${i.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return i.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${N(i.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${i.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${o} ${i.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${i.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${R(i.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function zne(){return R$()}var Une=y(()=>{IF()});function qne(){return{localeError:_Be()}}var _Be,Bne=y(()=>{ee();_Be=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${i.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return i.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${N(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${R(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),c=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${c} ${o}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${o}${s}`}case"too_small":{let o=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),c=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${c} ${o}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.format]??i.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${i.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${R(i.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${i.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${i.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function Hne(t){let e=Math.abs(t),r=e%10,n=e%100;return n>=11&&n<=19||r===0?"many":r===1?"one":"few"}function Gne(){return{localeError:bBe()}}var Nh,bBe,Zne=y(()=>{ee();Nh=t=>t.charAt(0).toUpperCase()+t.slice(1);bBe=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(i,o,s,a){let c=t[i]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},n={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${i.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${N(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${R(i.values,"|")} pasirinkim\u0173`;case"too_big":{let o=n[i.origin]??i.origin,s=e(i.origin,Hne(Number(i.maximum)),i.inclusive??!1,"smaller");if(s?.verb)return`${Nh(o??i.origin??"reik\u0161m\u0117")} ${s.verb} ${i.maximum.toString()} ${s.unit??"element\u0173"}`;let a=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Nh(o??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.maximum.toString()} ${s?.unit}`}case"too_small":{let o=n[i.origin]??i.origin,s=e(i.origin,Hne(Number(i.minimum)),i.inclusive??!1,"bigger");if(s?.verb)return`${Nh(o??i.origin??"reik\u0161m\u0117")} ${s.verb} ${i.minimum.toString()} ${s.unit??"element\u0173"}`;let a=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Nh(o??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.format]??i.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${R(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=n[i.origin]??i.origin;return`${Nh(o??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function Vne(){return{localeError:vBe()}}var vBe,Wne=y(()=>{ee();vBe=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(i){return t[i]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},n={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${i.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${N(i.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${i.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${r[o.format]??i.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${R(i.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${i.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${i.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function Kne(){return{localeError:SBe()}}var SBe,Jne=y(()=>{ee();SBe=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(i){return t[i]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${N(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Terlalu besar: dijangka ${i.origin??"nilai"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Terlalu kecil: dijangka ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${R(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}}});function Yne(){return{localeError:wBe()}}var wBe,Xne=y(()=>{ee();wBe=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(i){return t[i]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},n={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${N(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin),a=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} is`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin),a=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${i.origin} ${o}${i.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${i.origin} ${o}${i.minimum.toString()} is`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}}});function Qne(){return{localeError:xBe()}}var xBe,eie=y(()=>{ee();xBe=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(i){return t[i]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventet instanceof ${i.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${N(i.values[0])}`:`Ugyldig valg: forventet en av ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${R(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}}});function tie(){return{localeError:$Be()}}var $Be,rie=y(()=>{ee();$Be=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(i){return t[i]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`F\xE2sit giren: umulan instanceof ${i.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return i.values.length===1?`F\xE2sit giren: umulan ${N(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=i;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.format]??i.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${i.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${i.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function nie(){return{localeError:kBe()}}var kBe,iie=y(()=>{ee();kBe=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(i){return t[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${i.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return i.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${N(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${R(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.format]??i.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${i.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${i.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${R(i.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${i.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${i.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function oie(){return{localeError:EBe()}}var EBe,sie=y(()=>{ee();EBe=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(i){return t[i]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},n={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${i.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return i.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${N(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${i.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${i.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.format]??i.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${i.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${i.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function aie(){return{localeError:ABe()}}var ABe,cie=y(()=>{ee();ABe=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(i){return t[i]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",number:"n\xFAmero",null:"nulo"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Tipo inv\xE1lido: esperado instanceof ${i.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: esperado ${N(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${o}${i.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Muito pequeno: esperado que ${i.origin} tivesse ${o}${i.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${r[o.format]??i.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${R(i.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${i.origin}`;default:return"Campo inv\xE1lido"}}}});function lie(){return{localeError:TBe()}}var TBe,uie=y(()=>{ee();TBe=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(i){return t[i]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},n={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return i.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${N(i.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} s\u0103 fie ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Prea mic: a\u0219teptat ca ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${i.origin} s\u0103 fie ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${r[o.format]??i.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${i.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${R(i.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${i.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${i.origin}`;default:return"Intrare invalid\u0103"}}}});function die(t,e,r,n){let i=Math.abs(t),o=i%10,s=i%100;return s>=11&&s<=19?n:o===1?e:o>=2&&o<=4?r:n}function fie(){return{localeError:OBe()}}var OBe,pie=y(()=>{ee();OBe=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${N(i.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),c=die(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${i.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),c=die(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${i.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${i.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0438":""}: ${R(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function mie(){return{localeError:RBe()}}var RBe,hie=y(()=>{ee();RBe=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(i){return t[i]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},n={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${i.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return i.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${N(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${o}${i.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${o}${i.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.format]??i.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${R(i.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}}});function gie(){return{localeError:IBe()}}var IBe,yie=y(()=>{ee();IBe=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(i){return t[i]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},n={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${i.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return i.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${N(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${R(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${i.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function _ie(){return{localeError:PBe()}}var PBe,bie=y(()=>{ee();PBe=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(i){return t[i]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${i.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return i.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${N(i.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${R(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${i.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${o}${i.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${o}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${i.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${i.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${R(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function vie(){return{localeError:CBe()}}var CBe,Sie=y(()=>{ee();CBe=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(i){return t[i]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},n={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${i.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return i.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${N(i.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(i.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(i.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.format]??i.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${i.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${R(i.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function wie(){return{localeError:DBe()}}var DBe,xie=y(()=>{ee();DBe=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(i){return t[i]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${i.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${N(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${o}${i.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${R(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function I$(){return{localeError:NBe()}}var NBe,PF=y(()=>{ee();NBe=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${i.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${N(i.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} \u0431\u0443\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0456":""}: ${R(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${i.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function $ie(){return I$()}var kie=y(()=>{PF()});function Eie(){return{localeError:jBe()}}var jBe,Aie=y(()=>{ee();jBe=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(i){return t[i]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},n={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${i.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return i.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${N(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${R(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${o}${i.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u0627 ${o}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${i.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${i.keys.length>1?"\u0632":""}: ${R(i.keys,"\u060C ")}`;case"invalid_key":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function Tie(){return{localeError:MBe()}}var MBe,Oie=y(()=>{ee();MBe=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(i){return t[i]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},n={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return i.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${N(i.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.format]??i.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${i.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${i.keys.length>1?"lar":""}: ${R(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${i.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function Rie(){return{localeError:FBe()}}var FBe,Iie=y(()=>{ee();FBe=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(i){return t[i]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},n={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${i.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return i.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${N(i.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${i.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${s.verb} ${o}${i.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.format]??i.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${i.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${R(i.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function Pie(){return{localeError:LBe()}}var LBe,Cie=y(()=>{ee();LBe=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(i){return t[i]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},n={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${i.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return i.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${N(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.format]??i.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${i.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${R(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${i.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function Die(){return{localeError:zBe()}}var zBe,Nie=y(()=>{ee();zBe=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(i){return t[i]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${i.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return i.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${N(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.format]??i.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${i.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${i.keys.length>1?"\u5011":""}\uFF1A${R(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function jie(){return{localeError:UBe()}}var UBe,Mie=y(()=>{ee();UBe=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(i){return t[i]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},n={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,s=j(i.input),a=n[s]??s;return/^[A-Z]/.test(i.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${i.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return i.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${N(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${R(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",s=e(i.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin??"iye"} ${s.verb} ${o}${i.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.maximum}`}case"too_small":{let o=i.inclusive?">=":">",s=e(i.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin} ${s.verb} ${o}${i.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.minimum}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.format]??i.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${i.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${R(i.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var id={};Pr(id,{ar:()=>Hre,az:()=>Zre,be:()=>Kre,bg:()=>Yre,ca:()=>Qre,cs:()=>tne,da:()=>nne,de:()=>one,el:()=>ane,en:()=>O$,eo:()=>lne,es:()=>dne,fa:()=>pne,fi:()=>hne,fr:()=>yne,frCA:()=>bne,he:()=>Sne,hr:()=>xne,hu:()=>kne,hy:()=>Tne,id:()=>Rne,is:()=>Pne,it:()=>Dne,ja:()=>jne,ka:()=>Fne,kh:()=>zne,km:()=>R$,ko:()=>qne,lt:()=>Gne,mk:()=>Vne,ms:()=>Kne,nl:()=>Yne,no:()=>Qne,ota:()=>tie,pl:()=>oie,ps:()=>nie,pt:()=>aie,ro:()=>lie,ru:()=>fie,sl:()=>mie,sv:()=>gie,ta:()=>_ie,th:()=>vie,tr:()=>wie,ua:()=>$ie,uk:()=>I$,ur:()=>Eie,uz:()=>Tie,vi:()=>Rie,yo:()=>jie,zhCN:()=>Pie,zhTW:()=>Die});var P$=y(()=>{Gre();Vre();Jre();Xre();ene();rne();ine();sne();cne();RF();une();fne();mne();gne();_ne();vne();wne();$ne();Ene();One();Ine();Cne();Nne();Mne();Lne();Une();IF();Bne();Zne();Wne();Jne();Xne();eie();rie();iie();sie();cie();uie();pie();hie();yie();bie();Sie();xie();kie();PF();Aie();Oie();Iie();Cie();Nie();Mie()});function D$(){return new C$}var Fie,CF,DF,C$,ir,jh=y(()=>{CF=Symbol("ZodOutput"),DF=Symbol("ZodInput"),C$=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(Fie=globalThis).__zod_globalRegistry??(Fie.__zod_globalRegistry=D$());ir=globalThis.__zod_globalRegistry});function N$(t,e){return new t({type:"string",...U(e)})}function NF(t,e){return new t({type:"string",coerce:!0,...U(e)})}function Mh(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...U(e)})}function od(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...U(e)})}function Fh(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...U(e)})}function Lh(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...U(e)})}function zh(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...U(e)})}function Uh(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...U(e)})}function sd(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...U(e)})}function qh(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...U(e)})}function Bh(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...U(e)})}function Hh(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...U(e)})}function Gh(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...U(e)})}function Zh(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...U(e)})}function Vh(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...U(e)})}function Wh(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...U(e)})}function Kh(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...U(e)})}function Jh(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...U(e)})}function j$(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...U(e)})}function Yh(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...U(e)})}function Xh(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...U(e)})}function Qh(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...U(e)})}function eg(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...U(e)})}function tg(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...U(e)})}function rg(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...U(e)})}function MF(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...U(e)})}function FF(t,e){return new t({type:"string",format:"date",check:"string_format",...U(e)})}function LF(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...U(e)})}function zF(t,e){return new t({type:"string",format:"duration",check:"string_format",...U(e)})}function M$(t,e){return new t({type:"number",checks:[],...U(e)})}function UF(t,e){return new t({type:"number",coerce:!0,checks:[],...U(e)})}function F$(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...U(e)})}function L$(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...U(e)})}function z$(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...U(e)})}function U$(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...U(e)})}function q$(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...U(e)})}function B$(t,e){return new t({type:"boolean",...U(e)})}function qF(t,e){return new t({type:"boolean",coerce:!0,...U(e)})}function H$(t,e){return new t({type:"bigint",...U(e)})}function BF(t,e){return new t({type:"bigint",coerce:!0,...U(e)})}function G$(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...U(e)})}function Z$(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...U(e)})}function V$(t,e){return new t({type:"symbol",...U(e)})}function W$(t,e){return new t({type:"undefined",...U(e)})}function K$(t,e){return new t({type:"null",...U(e)})}function J$(t){return new t({type:"any"})}function Y$(t){return new t({type:"unknown"})}function X$(t,e){return new t({type:"never",...U(e)})}function Q$(t,e){return new t({type:"void",...U(e)})}function ek(t,e){return new t({type:"date",...U(e)})}function HF(t,e){return new t({type:"date",coerce:!0,...U(e)})}function tk(t,e){return new t({type:"nan",...U(e)})}function Qi(t,e){return new b0({check:"less_than",...U(e),value:t,inclusive:!1})}function wn(t,e){return new b0({check:"less_than",...U(e),value:t,inclusive:!0})}function eo(t,e){return new v0({check:"greater_than",...U(e),value:t,inclusive:!1})}function Er(t,e){return new v0({check:"greater_than",...U(e),value:t,inclusive:!0})}function rk(t){return eo(0,t)}function nk(t){return Qi(0,t)}function ik(t){return wn(0,t)}function ok(t){return Er(0,t)}function qs(t,e){return new eF({check:"multiple_of",...U(e),value:t})}function Bs(t,e){return new nF({check:"max_size",...U(e),maximum:t})}function to(t,e){return new iF({check:"min_size",...U(e),minimum:t})}function Ic(t,e){return new oF({check:"size_equals",...U(e),size:t})}function Pc(t,e){return new sF({check:"max_length",...U(e),maximum:t})}function Uo(t,e){return new aF({check:"min_length",...U(e),minimum:t})}function Cc(t,e){return new cF({check:"length_equals",...U(e),length:t})}function ad(t,e){return new lF({check:"string_format",format:"regex",...U(e),pattern:t})}function cd(t){return new uF({check:"string_format",format:"lowercase",...U(t)})}function ld(t){return new dF({check:"string_format",format:"uppercase",...U(t)})}function ud(t,e){return new fF({check:"string_format",format:"includes",...U(e),includes:t})}function dd(t,e){return new pF({check:"string_format",format:"starts_with",...U(e),prefix:t})}function fd(t,e){return new mF({check:"string_format",format:"ends_with",...U(e),suffix:t})}function sk(t,e,r){return new hF({check:"property",property:t,schema:e,...U(r)})}function pd(t,e){return new gF({check:"mime_type",mime:t,...U(e)})}function hi(t){return new yF({check:"overwrite",tx:t})}function md(t){return hi(e=>e.normalize(t))}function hd(){return hi(t=>t.trim())}function gd(){return hi(t=>t.toLowerCase())}function yd(){return hi(t=>t.toUpperCase())}function _d(){return hi(t=>mM(t))}function GF(t,e,r){return new t({type:"array",element:e,...U(r)})}function BBe(t,e,r){return new t({type:"union",options:e,...U(r)})}function HBe(t,e,r){return new t({type:"union",options:e,inclusive:!1,...U(r)})}function GBe(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...U(n)})}function ZBe(t,e,r){return new t({type:"intersection",left:e,right:r})}function VBe(t,e,r,n){let i=r instanceof ue,o=i?n:r,s=i?r:null;return new t({type:"tuple",items:e,rest:s,...U(o)})}function WBe(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...U(n)})}function KBe(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...U(n)})}function JBe(t,e,r){return new t({type:"set",valueType:e,...U(r)})}function YBe(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new t({type:"enum",entries:n,...U(r)})}function XBe(t,e,r){return new t({type:"enum",entries:e,...U(r)})}function QBe(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...U(r)})}function ak(t,e){return new t({type:"file",...U(e)})}function eHe(t,e){return new t({type:"transform",transform:e})}function tHe(t,e){return new t({type:"optional",innerType:e})}function rHe(t,e){return new t({type:"nullable",innerType:e})}function nHe(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():a0(r)}})}function iHe(t,e,r){return new t({type:"nonoptional",innerType:e,...U(r)})}function oHe(t,e){return new t({type:"success",innerType:e})}function sHe(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function aHe(t,e,r){return new t({type:"pipe",in:e,out:r})}function cHe(t,e){return new t({type:"readonly",innerType:e})}function lHe(t,e,r){return new t({type:"template_literal",parts:e,...U(r)})}function uHe(t,e){return new t({type:"lazy",getter:e})}function dHe(t,e){return new t({type:"promise",innerType:e})}function ck(t,e,r){let n=U(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function lk(t,e,r){return new t({type:"custom",check:"custom",fn:e,...U(r)})}function uk(t,e){let r=Lie(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(Wu(i,n.value,r._zod.def));else{let o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),n.issues.push(Wu(o))}},t(n.value,n)),e);return r}function Lie(t,e){let r=new Qe({check:"custom",...U(e)});return r._zod.check=t,r}function dk(t){let e=new Qe({check:"describe"});return e._zod.onattach=[r=>{let n=ir.get(r)??{};ir.add(r,{...n,description:t})}],e._zod.check=()=>{},e}function fk(t){let e=new Qe({check:"meta"});return e._zod.onattach=[r=>{let n=ir.get(r)??{};ir.add(r,{...n,...t})}],e._zod.check=()=>{},e}function pk(t,e){let r=U(e),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(p=>typeof p=="string"?p.toLowerCase():p),i=i.map(p=>typeof p=="string"?p.toLowerCase():p));let o=new Set(n),s=new Set(i),a=t.Codec??rd,c=t.Boolean??ed,l=t.String??Us,u=new l({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),f=new a({type:"pipe",in:u,out:d,transform:((p,m)=>{let h=p;return r.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:s.has(h)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:f,continue:!1}),{})}),reverseTransform:((p,m)=>p===!0?n[0]||"true":i[0]||"false"),error:r.error});return f}function Dc(t,e,r,n={}){let i=U(n),o={...U(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...i};return r instanceof RegExp&&(o.pattern=r),new t(o)}var jF,zie=y(()=>{S0();jh();OF();ee();jF={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Hs(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??ir,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Ve(t,e,r={path:[],schemaPath:[]}){var n;let i=t._zod.def,o=e.seen.get(t);if(o)return o.count++,r.schemaPath.includes(t)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,s);let a=t._zod.toJSONSchema?.();if(a)s.schema=a;else{let u={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,u);else{let f=s.schema,p=e.processors[i.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);p(t,e,f,u)}let d=t._zod.parent;d&&(s.ref||(s.ref=d),Ve(d,e,u),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(s.schema,c),e.io==="input"&&Ar(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function Gs(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let s of t.seen.entries()){let a=t.metadataRegistry.get(s[0])?.id;if(a){let c=n.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,s[0])}}let i=s=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(s[0])?.id,f=t.external.uri??(m=>m);if(d)return{ref:f(d)};let p=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=p,{defId:p,ref:`${f("__shared")}#/${a}/${p}`}}if(s[1]===r)return{ref:"#"};let l=`#/${a}/`,u=s[1].schema.id??`__schema${t.counter++}`;return{defId:u,ref:l+u}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:l}=i(s);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let d in u)delete u[d];u.$ref=c};if(t.cycles==="throw")for(let s of t.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(t.external){let l=t.external.registry.get(s[0])?.id;if(e!==s[0]&&l){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&t.reused==="ref"){o(s);continue}}}function Zs(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=t.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){n(d);let p=t.seen.get(d),m=p.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):Object.assign(l,m),Object.assign(l,u),a._zod.parent===d)for(let g in l)g==="$ref"||g==="allOf"||g in u||delete l[g];if(m.$ref&&p.def)for(let g in l)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(l[g])===JSON.stringify(p.def[g])&&delete l[g]}let f=a._zod.parent;if(f&&f!==d){n(f);let p=t.seen.get(f);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(let m in l)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(l[m])===JSON.stringify(p.def[m])&&delete l[m]}t.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())n(a[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(a)}Object.assign(i,r.def??r.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&i.id===o&&delete i.id;let s=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,s[c.defId]=c.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{let a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:bd(e,"input",t.processors),output:bd(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ar(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ar(n.element,r);if(n.type==="set")return Ar(n.valueType,r);if(n.type==="lazy")return Ar(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Ar(n.innerType,r);if(n.type==="intersection")return Ar(n.left,r)||Ar(n.right,r);if(n.type==="record"||n.type==="map")return Ar(n.keyType,r)||Ar(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Ar(n.in,r)||Ar(n.out,r);if(n.type==="object"){for(let i in n.shape)if(Ar(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(Ar(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(Ar(i,r))return!0;return!!(n.rest&&Ar(n.rest,r))}return!1}var ZF,bd,ng=y(()=>{jh();ZF=(t,e={})=>r=>{let n=Hs({...r,processors:e});return Ve(t,n),Gs(n,t),Zs(n,t)},bd=(t,e,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},s=Hs({...i??{},target:o,io:e,processors:r});return Ve(t,s),Gs(s,t),Zs(s,t)}});function Nc(t,e){if("_idmap"in t){let n=t,i=Hs({...e,processors:mk}),o={};for(let c of n._idmap.entries()){let[l,u]=c;Ve(u,i)}let s={},a={registry:n,uri:e?.uri,defs:o};i.external=a;for(let c of n._idmap.entries()){let[l,u]=c;Gs(i,u),s[l]=Zs(i,u)}if(Object.keys(o).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=Hs({...e,processors:mk});return Ve(t,r),Gs(r,t),Zs(r,t)}var fHe,VF,WF,KF,JF,YF,XF,QF,eL,tL,rL,nL,iL,oL,sL,aL,cL,lL,uL,dL,fL,pL,mL,hL,gL,yL,hk,_L,bL,vL,SL,wL,xL,$L,kL,EL,AL,TL,gk,OL,mk,vd=y(()=>{ng();ee();fHe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},VF=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof s=="number"&&(i.maxLength=s),a&&(i.format=fHe[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},WF=(t,e,r,n)=>{let i=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number";let d=typeof u=="number"&&u>=(o??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(s??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof o=="number"&&(i.minimum=o),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof s=="number"&&(i.maximum=s),typeof c=="number"&&(i.multipleOf=c)},KF=(t,e,r,n)=>{r.type="boolean"},JF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},YF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},XF=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},QF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},eL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},tL=(t,e,r,n)=>{r.not={}},rL=(t,e,r,n)=>{},nL=(t,e,r,n)=>{},iL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},oL=(t,e,r,n)=>{let i=t._zod.def,o=bh(i.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},sL=(t,e,r,n)=>{let i=t._zod.def,o=[];for(let s of i.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},aL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},cL=(t,e,r,n)=>{let i=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},lL=(t,e,r,n)=>{let i=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(i,o)},uL=(t,e,r,n)=>{r.type="boolean"},dL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},fL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},pL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},mL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},hL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},gL=(t,e,r,n)=>{let i=r,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=Ve(o.element,e,{...n,path:[...n.path,"items"]})},yL=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="object",i.properties={};let s=o.shape;for(let l in s)i.properties[l]=Ve(s[l],e,{...n,path:[...n.path,"properties",l]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(l=>{let u=o.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(i.required=Array.from(c)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=Ve(o.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},hk=(t,e,r,n)=>{let i=t._zod.def,o=i.inclusive===!1,s=i.options.map((a,c)=>Ve(a,e,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},_L=(t,e,r,n)=>{let i=t._zod.def,o=Ve(i.left,e,{...n,path:[...n.path,"allOf",0]}),s=Ve(i.right,e,{...n,path:[...n.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},bL=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((f,p)=>Ve(f,e,{...n,path:[...n.path,s,p]})),l=o.rest?Ve(o.rest,e,{...n,path:[...n.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=c,l&&(i.items=l)):e.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(i.minItems=u),typeof d=="number"&&(i.maxItems=d)},vL=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let u=Ve(o.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let d of c)i.patternProperties[d.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Ve(o.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=Ve(o.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(i.required=u)}},SL=(t,e,r,n)=>{let i=t._zod.def,o=Ve(i.innerType,e,n),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},wL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},xL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},$L=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},kL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},EL=(t,e,r,n)=>{let i=t._zod.def,o=i.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?i.out:i.in:i.out;Ve(s,e,n);let a=e.seen.get(t);a.ref=s},AL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,r.readOnly=!0},TL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},gk=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},OL=(t,e,r,n)=>{let i=t._zod.innerType;Ve(i,e,n);let o=e.seen.get(t);o.ref=i},mk={string:VF,number:WF,boolean:KF,bigint:JF,symbol:YF,null:XF,undefined:QF,void:eL,never:tL,any:rL,unknown:nL,date:iL,enum:oL,literal:sL,nan:aL,template_literal:cL,file:lL,success:uL,custom:dL,function:fL,transform:pL,map:mL,set:hL,array:gL,object:yL,union:hk,intersection:_L,tuple:bL,record:vL,nullable:SL,nonoptional:wL,default:xL,prefault:$L,catch:kL,pipe:EL,readonly:AL,promise:TL,optional:gk,lazy:OL}});var yk,Uie=y(()=>{vd();ng();yk=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Hs({processors:mk,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return Ve(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Gs(this.ctx,e);let n=Zs(this.ctx,e),{"~standard":i,...o}=n;return o}}});var qie={};var Bie=y(()=>{});var gi={};Pr(gi,{$ZodAny:()=>X0,$ZodArray:()=>n$,$ZodAsyncError:()=>mi,$ZodBase64:()=>q0,$ZodBase64URL:()=>B0,$ZodBigInt:()=>Ih,$ZodBigIntFormat:()=>W0,$ZodBoolean:()=>ed,$ZodCIDRv4:()=>z0,$ZodCIDRv6:()=>U0,$ZodCUID:()=>P0,$ZodCUID2:()=>C0,$ZodCatch:()=>S$,$ZodCheck:()=>Qe,$ZodCheckBigIntFormat:()=>rF,$ZodCheckEndsWith:()=>mF,$ZodCheckGreaterThan:()=>v0,$ZodCheckIncludes:()=>fF,$ZodCheckLengthEquals:()=>cF,$ZodCheckLessThan:()=>b0,$ZodCheckLowerCase:()=>uF,$ZodCheckMaxLength:()=>sF,$ZodCheckMaxSize:()=>nF,$ZodCheckMimeType:()=>gF,$ZodCheckMinLength:()=>aF,$ZodCheckMinSize:()=>iF,$ZodCheckMultipleOf:()=>eF,$ZodCheckNumberFormat:()=>tF,$ZodCheckOverwrite:()=>yF,$ZodCheckProperty:()=>hF,$ZodCheckRegex:()=>lF,$ZodCheckSizeEquals:()=>oF,$ZodCheckStartsWith:()=>pF,$ZodCheckStringFormat:()=>Qu,$ZodCheckUpperCase:()=>dF,$ZodCodec:()=>rd,$ZodCustom:()=>T$,$ZodCustomStringFormat:()=>Z0,$ZodDate:()=>r$,$ZodDefault:()=>y$,$ZodDiscriminatedUnion:()=>s$,$ZodE164:()=>H0,$ZodEmail:()=>T0,$ZodEmoji:()=>R0,$ZodEncodeError:()=>Ds,$ZodEnum:()=>d$,$ZodError:()=>$h,$ZodExactOptional:()=>h$,$ZodFile:()=>p$,$ZodFunction:()=>k$,$ZodGUID:()=>E0,$ZodIPv4:()=>M0,$ZodIPv6:()=>F0,$ZodISODate:()=>xF,$ZodISODateTime:()=>wF,$ZodISODuration:()=>kF,$ZodISOTime:()=>$F,$ZodIntersection:()=>a$,$ZodJWT:()=>G0,$ZodKSUID:()=>j0,$ZodLazy:()=>A$,$ZodLiteral:()=>f$,$ZodMAC:()=>L0,$ZodMap:()=>l$,$ZodNaN:()=>w$,$ZodNanoID:()=>I0,$ZodNever:()=>e$,$ZodNonOptional:()=>b$,$ZodNull:()=>Y0,$ZodNullable:()=>g$,$ZodNumber:()=>Rh,$ZodNumberFormat:()=>V0,$ZodObject:()=>i$,$ZodObjectJIT:()=>AF,$ZodOptional:()=>Ch,$ZodPipe:()=>Dh,$ZodPrefault:()=>_$,$ZodPreprocess:()=>TF,$ZodPromise:()=>E$,$ZodReadonly:()=>x$,$ZodRealError:()=>Gr,$ZodRecord:()=>c$,$ZodRegistry:()=>C$,$ZodSet:()=>u$,$ZodString:()=>Us,$ZodStringFormat:()=>Ke,$ZodSuccess:()=>v$,$ZodSymbol:()=>K0,$ZodTemplateLiteral:()=>$$,$ZodTransform:()=>m$,$ZodTuple:()=>Ph,$ZodType:()=>ue,$ZodULID:()=>D0,$ZodURL:()=>O0,$ZodUUID:()=>A0,$ZodUndefined:()=>J0,$ZodUnion:()=>td,$ZodUnknown:()=>Q0,$ZodVoid:()=>t$,$ZodXID:()=>N0,$ZodXor:()=>o$,$brand:()=>uM,$constructor:()=>k,$input:()=>DF,$output:()=>CF,Doc:()=>Oh,JSONSchema:()=>qie,JSONSchemaGenerator:()=>yk,NEVER:()=>lM,TimePrecision:()=>jF,_any:()=>J$,_array:()=>GF,_base64:()=>Qh,_base64url:()=>eg,_bigint:()=>H$,_boolean:()=>B$,_catch:()=>sHe,_check:()=>Lie,_cidrv4:()=>Yh,_cidrv6:()=>Xh,_coercedBigint:()=>BF,_coercedBoolean:()=>qF,_coercedDate:()=>HF,_coercedNumber:()=>UF,_coercedString:()=>NF,_cuid:()=>Hh,_cuid2:()=>Gh,_custom:()=>ck,_date:()=>ek,_decode:()=>l0,_decodeAsync:()=>d0,_default:()=>nHe,_discriminatedUnion:()=>GBe,_e164:()=>tg,_email:()=>Mh,_emoji:()=>qh,_encode:()=>c0,_encodeAsync:()=>u0,_endsWith:()=>fd,_enum:()=>YBe,_file:()=>ak,_float32:()=>L$,_float64:()=>z$,_gt:()=>eo,_gte:()=>Er,_guid:()=>od,_includes:()=>ud,_int:()=>F$,_int32:()=>U$,_int64:()=>G$,_intersection:()=>ZBe,_ipv4:()=>Kh,_ipv6:()=>Jh,_isoDate:()=>FF,_isoDateTime:()=>MF,_isoDuration:()=>zF,_isoTime:()=>LF,_jwt:()=>rg,_ksuid:()=>Wh,_lazy:()=>uHe,_length:()=>Cc,_literal:()=>QBe,_lowercase:()=>cd,_lt:()=>Qi,_lte:()=>wn,_mac:()=>j$,_map:()=>KBe,_max:()=>wn,_maxLength:()=>Pc,_maxSize:()=>Bs,_mime:()=>pd,_min:()=>Er,_minLength:()=>Uo,_minSize:()=>to,_multipleOf:()=>qs,_nan:()=>tk,_nanoid:()=>Bh,_nativeEnum:()=>XBe,_negative:()=>nk,_never:()=>X$,_nonnegative:()=>ok,_nonoptional:()=>iHe,_nonpositive:()=>ik,_normalize:()=>md,_null:()=>K$,_nullable:()=>rHe,_number:()=>M$,_optional:()=>tHe,_overwrite:()=>hi,_parse:()=>Ku,_parseAsync:()=>Ju,_pipe:()=>aHe,_positive:()=>rk,_promise:()=>dHe,_property:()=>sk,_readonly:()=>cHe,_record:()=>WBe,_refine:()=>lk,_regex:()=>ad,_safeDecode:()=>p0,_safeDecodeAsync:()=>h0,_safeEncode:()=>f0,_safeEncodeAsync:()=>m0,_safeParse:()=>Yu,_safeParseAsync:()=>Xu,_set:()=>JBe,_size:()=>Ic,_slugify:()=>_d,_startsWith:()=>dd,_string:()=>N$,_stringFormat:()=>Dc,_stringbool:()=>pk,_success:()=>oHe,_superRefine:()=>uk,_symbol:()=>V$,_templateLiteral:()=>lHe,_toLowerCase:()=>gd,_toUpperCase:()=>yd,_transform:()=>eHe,_trim:()=>hd,_tuple:()=>VBe,_uint32:()=>q$,_uint64:()=>Z$,_ulid:()=>Zh,_undefined:()=>W$,_union:()=>BBe,_unknown:()=>Y$,_uppercase:()=>ld,_url:()=>sd,_uuid:()=>Fh,_uuidv4:()=>Lh,_uuidv6:()=>zh,_uuidv7:()=>Uh,_void:()=>Q$,_xid:()=>Vh,_xor:()=>HBe,clone:()=>nr,config:()=>Tt,createStandardJSONSchemaMethod:()=>bd,createToJSONSchemaMethod:()=>ZF,decode:()=>pre,decodeAsync:()=>hre,describe:()=>dk,encode:()=>fre,encodeAsync:()=>mre,extractDefs:()=>Gs,finalize:()=>Zs,flattenError:()=>kh,formatError:()=>Eh,globalConfig:()=>kc,globalRegistry:()=>ir,initializeContext:()=>Hs,isValidBase64:()=>EF,isValidBase64URL:()=>zre,isValidJWT:()=>Ure,locales:()=>id,meta:()=>fk,parse:()=>Tc,parseAsync:()=>Oc,prettifyError:()=>wM,process:()=>Ve,regexes:()=>Zr,registry:()=>D$,safeDecode:()=>yre,safeDecodeAsync:()=>bre,safeEncode:()=>gre,safeEncodeAsync:()=>_re,safeParse:()=>Ls,safeParseAsync:()=>zs,toDotPath:()=>dre,toJSONSchema:()=>Nc,treeifyError:()=>SM,util:()=>M,version:()=>bF});var hr=y(()=>{Ec();$M();xM();OF();S0();vF();ee();_0();P$();jh();_F();zie();ng();vd();Uie();Bie()});var RL=y(()=>{hr()});function IL(t,e){let r={type:"object",shape:t??{},...U(e)};return new gHe(r)}var hHe,gHe,Hie=y(()=>{hr();ee();RL();hHe=k("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");ue.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>Tc(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Ls(t,r,n),t.parseAsync=async(r,n)=>Oc(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>zs(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>nr(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),gHe=k("ZodMiniObject",(t,e)=>{i$.init(t,e),hHe.init(t,e),ve(t,"shape",()=>e.shape)})});var Gie=y(()=>{});var Zie=y(()=>{});var Vie=y(()=>{});var Wie=y(()=>{hr();RL();Hie();Gie();vd();P$();Zie();Vie()});var PL=y(()=>{Wie()});function zn(t){return!!t._zod}function jc(t){let e=Object.values(t);if(e.length===0)return IL({});let r=e.every(zn),n=e.every(i=>!zn(i));if(r)return IL(t);if(n)return Yte(t);throw new Error("Mixed Zod versions detected in object shape.")}function Vs(t,e){return zn(t)?Ls(t,e):t.safeParse(e)}async function _k(t,e){return zn(t)?await zs(t,e):await t.safeParseAsync(e)}function Ws(t){if(!t)return;let e;if(zn(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Sd(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let n=Object.values(t);if(n.length>0&&n.every(i=>typeof i=="object"&&i!==null&&(i._def!==void 0||i._zod!==void 0||typeof i.parse=="function")))return jc(t)}}if(zn(t)){let r=t._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function bk(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function Jie(t){return t.description}function Yie(t){if(zn(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function vk(t){if(zn(t)){let o=t._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}var ig=y(()=>{yh();PL()});var Sk={};Pr(Sk,{endsWith:()=>fd,gt:()=>eo,gte:()=>Er,includes:()=>ud,length:()=>Cc,lowercase:()=>cd,lt:()=>Qi,lte:()=>wn,maxLength:()=>Pc,maxSize:()=>Bs,mime:()=>pd,minLength:()=>Uo,minSize:()=>to,multipleOf:()=>qs,negative:()=>nk,nonnegative:()=>ok,nonpositive:()=>ik,normalize:()=>md,overwrite:()=>hi,positive:()=>rk,property:()=>sk,regex:()=>ad,size:()=>Ic,slugify:()=>_d,startsWith:()=>dd,toLowerCase:()=>gd,toUpperCase:()=>yd,trim:()=>hd,uppercase:()=>ld});var wk=y(()=>{hr()});var Ks={};Pr(Ks,{ZodISODate:()=>$k,ZodISODateTime:()=>xk,ZodISODuration:()=>Ek,ZodISOTime:()=>kk,date:()=>DL,datetime:()=>CL,duration:()=>jL,time:()=>NL});function CL(t){return MF(xk,t)}function DL(t){return FF($k,t)}function NL(t){return LF(kk,t)}function jL(t){return zF(Ek,t)}var xk,$k,kk,Ek,og=y(()=>{hr();ag();xk=k("ZodISODateTime",(t,e)=>{wF.init(t,e),et.init(t,e)});$k=k("ZodISODate",(t,e)=>{xF.init(t,e),et.init(t,e)});kk=k("ZodISOTime",(t,e)=>{$F.init(t,e),et.init(t,e)});Ek=k("ZodISODuration",(t,e)=>{kF.init(t,e),et.init(t,e)})});var Xie,bHe,Vr,ML=y(()=>{hr();hr();ee();Xie=(t,e)=>{$h.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>Eh(t,r)},flatten:{value:r=>kh(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Zu,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Zu,2)}},isEmpty:{get(){return t.issues.length===0}}})},bHe=k("ZodError",Xie),Vr=k("ZodError",Xie,{Parent:Error})});var FL,LL,zL,UL,qL,BL,HL,GL,ZL,VL,WL,KL,JL=y(()=>{hr();ML();FL=Ku(Vr),LL=Ju(Vr),zL=Yu(Vr),UL=Xu(Vr),qL=c0(Vr),BL=l0(Vr),HL=u0(Vr),GL=d0(Vr),ZL=f0(Vr),VL=p0(Vr),WL=m0(Vr),KL=h0(Vr)});var sg={};Pr(sg,{ZodAny:()=>tz,ZodArray:()=>oz,ZodBase64:()=>qk,ZodBase64URL:()=>Bk,ZodBigInt:()=>Td,ZodBigIntFormat:()=>Zk,ZodBoolean:()=>Ad,ZodCIDRv4:()=>zk,ZodCIDRv6:()=>Uk,ZodCUID:()=>Ck,ZodCUID2:()=>Dk,ZodCatch:()=>kz,ZodCodec:()=>_g,ZodCustom:()=>bg,ZodCustomStringFormat:()=>kd,ZodDate:()=>pg,ZodDefault:()=>bz,ZodDiscriminatedUnion:()=>az,ZodE164:()=>Hk,ZodEmail:()=>Rk,ZodEmoji:()=>Ik,ZodEnum:()=>xd,ZodExactOptional:()=>gz,ZodFile:()=>mz,ZodFunction:()=>Nz,ZodGUID:()=>cg,ZodIPv4:()=>Fk,ZodIPv6:()=>Lk,ZodIntersection:()=>cz,ZodJWT:()=>Gk,ZodKSUID:()=>Mk,ZodLazy:()=>Pz,ZodLiteral:()=>pz,ZodMAC:()=>YL,ZodMap:()=>dz,ZodNaN:()=>Az,ZodNanoID:()=>Pk,ZodNever:()=>nz,ZodNonOptional:()=>Kk,ZodNull:()=>ez,ZodNullable:()=>_z,ZodNumber:()=>Ed,ZodNumberFormat:()=>Mc,ZodObject:()=>mg,ZodOptional:()=>Rd,ZodPipe:()=>yg,ZodPrefault:()=>Sz,ZodPreprocess:()=>Tz,ZodPromise:()=>Dz,ZodReadonly:()=>Oz,ZodRecord:()=>wd,ZodSet:()=>fz,ZodString:()=>$d,ZodStringFormat:()=>et,ZodSuccess:()=>$z,ZodSymbol:()=>XL,ZodTemplateLiteral:()=>Iz,ZodTransform:()=>hz,ZodTuple:()=>lz,ZodType:()=>_e,ZodULID:()=>Nk,ZodURL:()=>dg,ZodUUID:()=>ro,ZodUndefined:()=>QL,ZodUnion:()=>hg,ZodUnknown:()=>rz,ZodVoid:()=>iz,ZodXID:()=>jk,ZodXor:()=>sz,_ZodString:()=>Ok,_default:()=>vz,_function:()=>rse,any:()=>Moe,array:()=>ke,base64:()=>voe,base64url:()=>Soe,bigint:()=>Poe,boolean:()=>It,catch:()=>Ez,check:()=>nse,cidrv4:()=>_oe,cidrv6:()=>boe,codec:()=>Xoe,cuid:()=>uoe,cuid2:()=>doe,custom:()=>Jk,date:()=>Loe,describe:()=>ise,discriminatedUnion:()=>gg,e164:()=>woe,email:()=>eoe,emoji:()=>coe,enum:()=>sr,exactOptional:()=>yz,file:()=>Woe,float32:()=>Toe,float64:()=>Ooe,function:()=>rse,guid:()=>toe,hash:()=>Aoe,hex:()=>Eoe,hostname:()=>koe,httpUrl:()=>aoe,instanceof:()=>sse,int:()=>Ak,int32:()=>Roe,int64:()=>Coe,intersection:()=>Od,invertCodec:()=>Qoe,ipv4:()=>hoe,ipv6:()=>yoe,json:()=>cse,jwt:()=>xoe,keyof:()=>zoe,ksuid:()=>moe,lazy:()=>Cz,literal:()=>re,looseObject:()=>or,looseRecord:()=>Hoe,mac:()=>goe,map:()=>Goe,meta:()=>ose,nan:()=>Yoe,nanoid:()=>loe,nativeEnum:()=>Voe,never:()=>Vk,nonoptional:()=>xz,null:()=>fg,nullable:()=>lg,nullish:()=>Koe,number:()=>Me,object:()=>W,optional:()=>at,partialRecord:()=>Boe,pipe:()=>Tk,prefault:()=>wz,preprocess:()=>vg,promise:()=>tse,readonly:()=>Rz,record:()=>Je,refine:()=>jz,set:()=>Zoe,strictObject:()=>Uoe,string:()=>I,stringFormat:()=>$oe,stringbool:()=>ase,success:()=>Joe,superRefine:()=>Mz,symbol:()=>Noe,templateLiteral:()=>ese,transform:()=>Wk,tuple:()=>uz,uint32:()=>Ioe,uint64:()=>Doe,ulid:()=>foe,undefined:()=>joe,union:()=>rt,unknown:()=>tt,url:()=>soe,uuid:()=>roe,uuidv4:()=>noe,uuidv6:()=>ioe,uuidv7:()=>ooe,void:()=>Foe,xid:()=>poe,xor:()=>qoe});function ug(t,e,r){let n=Object.getPrototypeOf(t),i=Qie.get(n);if(i||(i=new Set,Qie.set(n,i)),!i.has(e)){i.add(e);for(let o in r){let s=r[o];Object.defineProperty(n,o,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}function I(t){return N$($d,t)}function eoe(t){return Mh(Rk,t)}function toe(t){return od(cg,t)}function roe(t){return Fh(ro,t)}function noe(t){return Lh(ro,t)}function ioe(t){return zh(ro,t)}function ooe(t){return Uh(ro,t)}function soe(t){return sd(dg,t)}function aoe(t){return sd(dg,{protocol:Zr.httpProtocol,hostname:Zr.domain,...M.normalizeParams(t)})}function coe(t){return qh(Ik,t)}function loe(t){return Bh(Pk,t)}function uoe(t){return Hh(Ck,t)}function doe(t){return Gh(Dk,t)}function foe(t){return Zh(Nk,t)}function poe(t){return Vh(jk,t)}function moe(t){return Wh(Mk,t)}function hoe(t){return Kh(Fk,t)}function goe(t){return j$(YL,t)}function yoe(t){return Jh(Lk,t)}function _oe(t){return Yh(zk,t)}function boe(t){return Xh(Uk,t)}function voe(t){return Qh(qk,t)}function Soe(t){return eg(Bk,t)}function woe(t){return tg(Hk,t)}function xoe(t){return rg(Gk,t)}function $oe(t,e,r={}){return Dc(kd,t,e,r)}function koe(t){return Dc(kd,"hostname",Zr.hostname,t)}function Eoe(t){return Dc(kd,"hex",Zr.hex,t)}function Aoe(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Zr[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Dc(kd,n,i,e)}function Me(t){return M$(Ed,t)}function Ak(t){return F$(Mc,t)}function Toe(t){return L$(Mc,t)}function Ooe(t){return z$(Mc,t)}function Roe(t){return U$(Mc,t)}function Ioe(t){return q$(Mc,t)}function It(t){return B$(Ad,t)}function Poe(t){return H$(Td,t)}function Coe(t){return G$(Zk,t)}function Doe(t){return Z$(Zk,t)}function Noe(t){return V$(XL,t)}function joe(t){return W$(QL,t)}function fg(t){return K$(ez,t)}function Moe(){return J$(tz)}function tt(){return Y$(rz)}function Vk(t){return X$(nz,t)}function Foe(t){return Q$(iz,t)}function Loe(t){return ek(pg,t)}function ke(t,e){return GF(oz,t,e)}function zoe(t){let e=t._zod.def.shape;return sr(Object.keys(e))}function W(t,e){let r={type:"object",shape:t??{},...M.normalizeParams(e)};return new mg(r)}function Uoe(t,e){return new mg({type:"object",shape:t,catchall:Vk(),...M.normalizeParams(e)})}function or(t,e){return new mg({type:"object",shape:t,catchall:tt(),...M.normalizeParams(e)})}function rt(t,e){return new hg({type:"union",options:t,...M.normalizeParams(e)})}function qoe(t,e){return new sz({type:"union",options:t,inclusive:!1,...M.normalizeParams(e)})}function gg(t,e,r){return new az({type:"union",options:e,discriminator:t,...M.normalizeParams(r)})}function Od(t,e){return new cz({type:"intersection",left:t,right:e})}function uz(t,e,r){let n=e instanceof ue,i=n?r:e,o=n?e:null;return new lz({type:"tuple",items:t,rest:o,...M.normalizeParams(i)})}function Je(t,e,r){return!e||!e._zod?new wd({type:"record",keyType:I(),valueType:t,...M.normalizeParams(e)}):new wd({type:"record",keyType:t,valueType:e,...M.normalizeParams(r)})}function Boe(t,e,r){let n=nr(t);return n._zod.values=void 0,new wd({type:"record",keyType:n,valueType:e,...M.normalizeParams(r)})}function Hoe(t,e,r){return new wd({type:"record",keyType:t,valueType:e,mode:"loose",...M.normalizeParams(r)})}function Goe(t,e,r){return new dz({type:"map",keyType:t,valueType:e,...M.normalizeParams(r)})}function Zoe(t,e){return new fz({type:"set",valueType:t,...M.normalizeParams(e)})}function sr(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new xd({type:"enum",entries:r,...M.normalizeParams(e)})}function Voe(t,e){return new xd({type:"enum",entries:t,...M.normalizeParams(e)})}function re(t,e){return new pz({type:"literal",values:Array.isArray(t)?t:[t],...M.normalizeParams(e)})}function Woe(t){return ak(mz,t)}function Wk(t){return new hz({type:"transform",transform:t})}function at(t){return new Rd({type:"optional",innerType:t})}function yz(t){return new gz({type:"optional",innerType:t})}function lg(t){return new _z({type:"nullable",innerType:t})}function Koe(t){return at(lg(t))}function vz(t,e){return new bz({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():M.shallowClone(e)}})}function wz(t,e){return new Sz({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():M.shallowClone(e)}})}function xz(t,e){return new Kk({type:"nonoptional",innerType:t,...M.normalizeParams(e)})}function Joe(t){return new $z({type:"success",innerType:t})}function Ez(t,e){return new kz({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function Yoe(t){return tk(Az,t)}function Tk(t,e){return new yg({type:"pipe",in:t,out:e})}function Xoe(t,e,r){return new _g({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function Qoe(t){let e=t._zod.def;return new _g({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function Rz(t){return new Oz({type:"readonly",innerType:t})}function ese(t,e){return new Iz({type:"template_literal",parts:t,...M.normalizeParams(e)})}function Cz(t){return new Pz({type:"lazy",getter:t})}function tse(t){return new Dz({type:"promise",innerType:t})}function rse(t){return new Nz({type:"function",input:Array.isArray(t?.input)?uz(t?.input):t?.input??ke(tt()),output:t?.output??tt()})}function nse(t){let e=new Qe({check:"custom"});return e._zod.check=t,e}function Jk(t,e){return ck(bg,t??(()=>!0),e)}function jz(t,e={}){return lk(bg,t,e)}function Mz(t,e){return uk(t,e)}function sse(t,e={}){let r=new bg({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...M.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}function cse(t){let e=Cz(()=>rt([I(t),Me(),It(),fg(),ke(e),Je(I(),e)]));return e}function vg(t,e){return new Tz({type:"pipe",in:Wk(t),out:e})}var Qie,_e,Ok,$d,et,Rk,cg,ro,dg,Ik,Pk,Ck,Dk,Nk,jk,Mk,Fk,YL,Lk,zk,Uk,qk,Bk,Hk,Gk,kd,Ed,Mc,Ad,Td,Zk,XL,QL,ez,tz,rz,nz,iz,pg,oz,mg,hg,sz,az,cz,lz,wd,dz,fz,xd,pz,mz,hz,Rd,gz,_z,bz,Sz,Kk,$z,kz,Az,yg,_g,Tz,Oz,Iz,Pz,Dz,Nz,bg,ise,ose,ase,ag=y(()=>{hr();hr();vd();ng();wk();og();JL();Qie=new WeakMap;_e=k("ZodType",(t,e)=>(ue.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:bd(t,"input"),output:bd(t,"output")}}),t.toJSONSchema=ZF(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>FL(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>zL(t,r,n),t.parseAsync=async(r,n)=>LL(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>UL(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>qL(t,r,n),t.decode=(r,n)=>BL(t,r,n),t.encodeAsync=async(r,n)=>HL(t,r,n),t.decodeAsync=async(r,n)=>GL(t,r,n),t.safeEncode=(r,n)=>ZL(t,r,n),t.safeDecode=(r,n)=>VL(t,r,n),t.safeEncodeAsync=async(r,n)=>WL(t,r,n),t.safeDecodeAsync=async(r,n)=>KL(t,r,n),ug(t,"ZodType",{check(...r){let n=this.def;return this.clone(M.mergeDefs(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return nr(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(jz(r,n))},superRefine(r,n){return this.check(Mz(r,n))},overwrite(r){return this.check(hi(r))},optional(){return at(this)},exactOptional(){return yz(this)},nullable(){return lg(this)},nullish(){return at(lg(this))},nonoptional(r){return xz(this,r)},array(){return ke(this)},or(r){return rt([this,r])},and(r){return Od(this,r)},transform(r){return Tk(this,Wk(r))},default(r){return vz(this,r)},prefault(r){return wz(this,r)},catch(r){return Ez(this,r)},pipe(r){return Tk(this,r)},readonly(){return Rz(this)},describe(r){let n=this.clone();return ir.add(n,{description:r}),n},meta(...r){if(r.length===0)return ir.get(this);let n=this.clone();return ir.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return ir.get(t)?.description},configurable:!0}),t)),Ok=k("_ZodString",(t,e)=>{Us.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>VF(t,n,i,o);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,ug(t,"_ZodString",{regex(...n){return this.check(ad(...n))},includes(...n){return this.check(ud(...n))},startsWith(...n){return this.check(dd(...n))},endsWith(...n){return this.check(fd(...n))},min(...n){return this.check(Uo(...n))},max(...n){return this.check(Pc(...n))},length(...n){return this.check(Cc(...n))},nonempty(...n){return this.check(Uo(1,...n))},lowercase(n){return this.check(cd(n))},uppercase(n){return this.check(ld(n))},trim(){return this.check(hd())},normalize(...n){return this.check(md(...n))},toLowerCase(){return this.check(gd())},toUpperCase(){return this.check(yd())},slugify(){return this.check(_d())}})}),$d=k("ZodString",(t,e)=>{Us.init(t,e),Ok.init(t,e),t.email=r=>t.check(Mh(Rk,r)),t.url=r=>t.check(sd(dg,r)),t.jwt=r=>t.check(rg(Gk,r)),t.emoji=r=>t.check(qh(Ik,r)),t.guid=r=>t.check(od(cg,r)),t.uuid=r=>t.check(Fh(ro,r)),t.uuidv4=r=>t.check(Lh(ro,r)),t.uuidv6=r=>t.check(zh(ro,r)),t.uuidv7=r=>t.check(Uh(ro,r)),t.nanoid=r=>t.check(Bh(Pk,r)),t.guid=r=>t.check(od(cg,r)),t.cuid=r=>t.check(Hh(Ck,r)),t.cuid2=r=>t.check(Gh(Dk,r)),t.ulid=r=>t.check(Zh(Nk,r)),t.base64=r=>t.check(Qh(qk,r)),t.base64url=r=>t.check(eg(Bk,r)),t.xid=r=>t.check(Vh(jk,r)),t.ksuid=r=>t.check(Wh(Mk,r)),t.ipv4=r=>t.check(Kh(Fk,r)),t.ipv6=r=>t.check(Jh(Lk,r)),t.cidrv4=r=>t.check(Yh(zk,r)),t.cidrv6=r=>t.check(Xh(Uk,r)),t.e164=r=>t.check(tg(Hk,r)),t.datetime=r=>t.check(CL(r)),t.date=r=>t.check(DL(r)),t.time=r=>t.check(NL(r)),t.duration=r=>t.check(jL(r))});et=k("ZodStringFormat",(t,e)=>{Ke.init(t,e),Ok.init(t,e)}),Rk=k("ZodEmail",(t,e)=>{T0.init(t,e),et.init(t,e)});cg=k("ZodGUID",(t,e)=>{E0.init(t,e),et.init(t,e)});ro=k("ZodUUID",(t,e)=>{A0.init(t,e),et.init(t,e)});dg=k("ZodURL",(t,e)=>{O0.init(t,e),et.init(t,e)});Ik=k("ZodEmoji",(t,e)=>{R0.init(t,e),et.init(t,e)});Pk=k("ZodNanoID",(t,e)=>{I0.init(t,e),et.init(t,e)});Ck=k("ZodCUID",(t,e)=>{P0.init(t,e),et.init(t,e)});Dk=k("ZodCUID2",(t,e)=>{C0.init(t,e),et.init(t,e)});Nk=k("ZodULID",(t,e)=>{D0.init(t,e),et.init(t,e)});jk=k("ZodXID",(t,e)=>{N0.init(t,e),et.init(t,e)});Mk=k("ZodKSUID",(t,e)=>{j0.init(t,e),et.init(t,e)});Fk=k("ZodIPv4",(t,e)=>{M0.init(t,e),et.init(t,e)});YL=k("ZodMAC",(t,e)=>{L0.init(t,e),et.init(t,e)});Lk=k("ZodIPv6",(t,e)=>{F0.init(t,e),et.init(t,e)});zk=k("ZodCIDRv4",(t,e)=>{z0.init(t,e),et.init(t,e)});Uk=k("ZodCIDRv6",(t,e)=>{U0.init(t,e),et.init(t,e)});qk=k("ZodBase64",(t,e)=>{q0.init(t,e),et.init(t,e)});Bk=k("ZodBase64URL",(t,e)=>{B0.init(t,e),et.init(t,e)});Hk=k("ZodE164",(t,e)=>{H0.init(t,e),et.init(t,e)});Gk=k("ZodJWT",(t,e)=>{G0.init(t,e),et.init(t,e)});kd=k("ZodCustomStringFormat",(t,e)=>{Z0.init(t,e),et.init(t,e)});Ed=k("ZodNumber",(t,e)=>{Rh.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>WF(t,n,i,o),ug(t,"ZodNumber",{gt(n,i){return this.check(eo(n,i))},gte(n,i){return this.check(Er(n,i))},min(n,i){return this.check(Er(n,i))},lt(n,i){return this.check(Qi(n,i))},lte(n,i){return this.check(wn(n,i))},max(n,i){return this.check(wn(n,i))},int(n){return this.check(Ak(n))},safe(n){return this.check(Ak(n))},positive(n){return this.check(eo(0,n))},nonnegative(n){return this.check(Er(0,n))},negative(n){return this.check(Qi(0,n))},nonpositive(n){return this.check(wn(0,n))},multipleOf(n,i){return this.check(qs(n,i))},step(n,i){return this.check(qs(n,i))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});Mc=k("ZodNumberFormat",(t,e)=>{V0.init(t,e),Ed.init(t,e)});Ad=k("ZodBoolean",(t,e)=>{ed.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KF(t,r,n,i)});Td=k("ZodBigInt",(t,e)=>{Ih.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>JF(t,n,i,o),t.gte=(n,i)=>t.check(Er(n,i)),t.min=(n,i)=>t.check(Er(n,i)),t.gt=(n,i)=>t.check(eo(n,i)),t.gte=(n,i)=>t.check(Er(n,i)),t.min=(n,i)=>t.check(Er(n,i)),t.lt=(n,i)=>t.check(Qi(n,i)),t.lte=(n,i)=>t.check(wn(n,i)),t.max=(n,i)=>t.check(wn(n,i)),t.positive=n=>t.check(eo(BigInt(0),n)),t.negative=n=>t.check(Qi(BigInt(0),n)),t.nonpositive=n=>t.check(wn(BigInt(0),n)),t.nonnegative=n=>t.check(Er(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(qs(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});Zk=k("ZodBigIntFormat",(t,e)=>{W0.init(t,e),Td.init(t,e)});XL=k("ZodSymbol",(t,e)=>{K0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>YF(t,r,n,i)});QL=k("ZodUndefined",(t,e)=>{J0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>QF(t,r,n,i)});ez=k("ZodNull",(t,e)=>{Y0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>XF(t,r,n,i)});tz=k("ZodAny",(t,e)=>{X0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>rL(t,r,n,i)});rz=k("ZodUnknown",(t,e)=>{Q0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nL(t,r,n,i)});nz=k("ZodNever",(t,e)=>{e$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tL(t,r,n,i)});iz=k("ZodVoid",(t,e)=>{t$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>eL(t,r,n,i)});pg=k("ZodDate",(t,e)=>{r$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>iL(t,n,i,o),t.min=(n,i)=>t.check(Er(n,i)),t.max=(n,i)=>t.check(wn(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});oz=k("ZodArray",(t,e)=>{n$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gL(t,r,n,i),t.element=e.element,ug(t,"ZodArray",{min(r,n){return this.check(Uo(r,n))},nonempty(r){return this.check(Uo(1,r))},max(r,n){return this.check(Pc(r,n))},length(r,n){return this.check(Cc(r,n))},unwrap(){return this.element}})});mg=k("ZodObject",(t,e)=>{AF.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yL(t,r,n,i),M.defineLazy(t,"shape",()=>e.shape),ug(t,"ZodObject",{keyof(){return sr(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:tt()})},loose(){return this.clone({...this._zod.def,catchall:tt()})},strict(){return this.clone({...this._zod.def,catchall:Vk()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return M.extend(this,r)},safeExtend(r){return M.safeExtend(this,r)},merge(r){return M.merge(this,r)},pick(r){return M.pick(this,r)},omit(r){return M.omit(this,r)},partial(...r){return M.partial(Rd,this,r[0])},required(...r){return M.required(Kk,this,r[0])}})});hg=k("ZodUnion",(t,e)=>{td.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hk(t,r,n,i),t.options=e.options});sz=k("ZodXor",(t,e)=>{hg.init(t,e),o$.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hk(t,r,n,i),t.options=e.options});az=k("ZodDiscriminatedUnion",(t,e)=>{hg.init(t,e),s$.init(t,e)});cz=k("ZodIntersection",(t,e)=>{a$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_L(t,r,n,i)});lz=k("ZodTuple",(t,e)=>{Ph.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bL(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});wd=k("ZodRecord",(t,e)=>{c$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vL(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});dz=k("ZodMap",(t,e)=>{l$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mL(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(to(...r)),t.nonempty=r=>t.check(to(1,r)),t.max=(...r)=>t.check(Bs(...r)),t.size=(...r)=>t.check(Ic(...r))});fz=k("ZodSet",(t,e)=>{u$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hL(t,r,n,i),t.min=(...r)=>t.check(to(...r)),t.nonempty=r=>t.check(to(1,r)),t.max=(...r)=>t.check(Bs(...r)),t.size=(...r)=>t.check(Ic(...r))});xd=k("ZodEnum",(t,e)=>{d$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>oL(t,n,i,o),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let o={};for(let s of n)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new xd({...e,checks:[],...M.normalizeParams(i),entries:o})},t.exclude=(n,i)=>{let o={...e.entries};for(let s of n)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new xd({...e,checks:[],...M.normalizeParams(i),entries:o})}});pz=k("ZodLiteral",(t,e)=>{f$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sL(t,r,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});mz=k("ZodFile",(t,e)=>{p$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lL(t,r,n,i),t.min=(r,n)=>t.check(to(r,n)),t.max=(r,n)=>t.check(Bs(r,n)),t.mime=(r,n)=>t.check(pd(Array.isArray(r)?r:[r],n))});hz=k("ZodTransform",(t,e)=>{m$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pL(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(M.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),r.issues.push(M.issue(s))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(o=>(r.value=o,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});Rd=k("ZodOptional",(t,e)=>{Ch.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});gz=k("ZodExactOptional",(t,e)=>{h$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});_z=k("ZodNullable",(t,e)=>{g$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>SL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});bz=k("ZodDefault",(t,e)=>{y$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});Sz=k("ZodPrefault",(t,e)=>{_$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$L(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});Kk=k("ZodNonOptional",(t,e)=>{b$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});$z=k("ZodSuccess",(t,e)=>{v$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});kz=k("ZodCatch",(t,e)=>{S$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});Az=k("ZodNaN",(t,e)=>{w$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>aL(t,r,n,i)});yg=k("ZodPipe",(t,e)=>{Dh.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>EL(t,r,n,i),t.in=e.in,t.out=e.out});_g=k("ZodCodec",(t,e)=>{yg.init(t,e),rd.init(t,e)});Tz=k("ZodPreprocess",(t,e)=>{yg.init(t,e),TF.init(t,e)}),Oz=k("ZodReadonly",(t,e)=>{x$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>AL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});Iz=k("ZodTemplateLiteral",(t,e)=>{$$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cL(t,r,n,i)});Pz=k("ZodLazy",(t,e)=>{A$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OL(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});Dz=k("ZodPromise",(t,e)=>{E$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>TL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});Nz=k("ZodFunction",(t,e)=>{k$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fL(t,r,n,i)});bg=k("ZodCustom",(t,e)=>{T$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dL(t,r,n,i)});ise=dk,ose=fk;ase=(...t)=>pk({Codec:_g,Boolean:Ad,String:$d},...t)});function wHe(t){Tt({customError:t})}function xHe(){return Tt().customError}var SHe,Fz,lse=y(()=>{hr();SHe={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};Fz||(Fz={})});function kHe(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function EHe(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${t}`);return e.defs[i]}throw new Error(`Reference not found: ${t}`)}function use(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return V.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let i=t.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return V.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let o=EHe(i,e),s=gr(o,e);return e.refs.set(i,s),e.processing.delete(i),s}if(t.enum!==void 0){let i=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&i.length===1&&i[0]===null)return V.null();if(i.length===0)return V.never();if(i.length===1)return V.literal(i[0]);if(i.every(s=>typeof s=="string"))return V.enum(i);let o=i.map(s=>V.literal(s));return o.length<2?o[0]:V.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return V.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(o=>{let s={...t,type:o};return use(s,e)});return i.length===0?V.never():i.length===1?i[0]:V.union(i)}if(!r)return V.any();let n;switch(r){case"string":{let i=V.string();if(t.format){let o=t.format;o==="email"?i=i.check(V.email()):o==="uri"||o==="uri-reference"?i=i.check(V.url()):o==="uuid"||o==="guid"?i=i.check(V.uuid()):o==="date-time"?i=i.check(V.iso.datetime()):o==="date"?i=i.check(V.iso.date()):o==="time"?i=i.check(V.iso.time()):o==="duration"?i=i.check(V.iso.duration()):o==="ipv4"?i=i.check(V.ipv4()):o==="ipv6"?i=i.check(V.ipv6()):o==="mac"?i=i.check(V.mac()):o==="cidr"?i=i.check(V.cidrv4()):o==="cidr-v6"?i=i.check(V.cidrv6()):o==="base64"?i=i.check(V.base64()):o==="base64url"?i=i.check(V.base64url()):o==="e164"?i=i.check(V.e164()):o==="jwt"?i=i.check(V.jwt()):o==="emoji"?i=i.check(V.emoji()):o==="nanoid"?i=i.check(V.nanoid()):o==="cuid"?i=i.check(V.cuid()):o==="cuid2"?i=i.check(V.cuid2()):o==="ulid"?i=i.check(V.ulid()):o==="xid"?i=i.check(V.xid()):o==="ksuid"&&(i=i.check(V.ksuid()))}typeof t.minLength=="number"&&(i=i.min(t.minLength)),typeof t.maxLength=="number"&&(i=i.max(t.maxLength)),t.pattern&&(i=i.regex(new RegExp(t.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?V.number().int():V.number();typeof t.minimum=="number"&&(i=i.min(t.minimum)),typeof t.maximum=="number"&&(i=i.max(t.maximum)),typeof t.exclusiveMinimum=="number"?i=i.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(i=i.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?i=i.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(i=i.lt(t.maximum)),typeof t.multipleOf=="number"&&(i=i.multipleOf(t.multipleOf)),n=i;break}case"boolean":{n=V.boolean();break}case"null":{n=V.null();break}case"object":{let i={},o=t.properties||{},s=new Set(t.required||[]);for(let[c,l]of Object.entries(o)){let u=gr(l,e);i[c]=s.has(c)?u:u.optional()}if(t.propertyNames){let c=gr(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?gr(t.additionalProperties,e):V.any();if(Object.keys(i).length===0){n=V.record(c,l);break}let u=V.object(i).passthrough(),d=V.looseRecord(c,l);n=V.intersection(u,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),u=[];for(let f of l){let p=gr(c[f],e),m=V.string().regex(new RegExp(f));u.push(V.looseRecord(m,p))}let d=[];if(Object.keys(i).length>0&&d.push(V.object(i).passthrough()),d.push(...u),d.length===0)n=V.object({}).passthrough();else if(d.length===1)n=d[0];else{let f=V.intersection(d[0],d[1]);for(let p=2;pgr(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?gr(o,e):void 0;a?n=V.tuple(s).rest(a):n=V.tuple(s),typeof t.minItems=="number"&&(n=n.check(V.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(V.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>gr(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?gr(t.additionalItems,e):void 0;a?n=V.tuple(s).rest(a):n=V.tuple(s),typeof t.minItems=="number"&&(n=n.check(V.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(V.maxLength(t.maxItems)))}else if(o!==void 0){let s=gr(o,e),a=V.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),n=a}else n=V.array(V.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function gr(t,e){if(typeof t=="boolean")return t?V.any():V.never();let r=use(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(l=>gr(l,e)),c=V.union(a);r=n?V.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(l=>gr(l,e)),c=V.xor(a);r=n?V.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:V.any();else{let a=n?r:gr(t.allOf[0],e),c=n?0:1;for(let l=c;l0&&e.registry.add(r,i),t.description&&(r=r.describe(t.description)),r}function dse(t,e){if(typeof t=="boolean")return t?V.any():V.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=kHe(r,e?.defaultTarget),i=r.$defs||r.definitions||{},o={version:n,defs:i,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??ir};return gr(r,o)}var V,$He,fse=y(()=>{jh();wk();og();ag();V={...sg,...Sk,iso:Ks},$He=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var Lz={};Pr(Lz,{bigint:()=>RHe,boolean:()=>OHe,date:()=>IHe,number:()=>THe,string:()=>AHe});function AHe(t){return NF($d,t)}function THe(t){return UF(Ed,t)}function OHe(t){return qF(Ad,t)}function RHe(t){return BF(Td,t)}function IHe(t){return HF(pg,t)}var pse=y(()=>{hr();ag()});var E={};Pr(E,{$brand:()=>uM,$input:()=>DF,$output:()=>CF,NEVER:()=>lM,TimePrecision:()=>jF,ZodAny:()=>tz,ZodArray:()=>oz,ZodBase64:()=>qk,ZodBase64URL:()=>Bk,ZodBigInt:()=>Td,ZodBigIntFormat:()=>Zk,ZodBoolean:()=>Ad,ZodCIDRv4:()=>zk,ZodCIDRv6:()=>Uk,ZodCUID:()=>Ck,ZodCUID2:()=>Dk,ZodCatch:()=>kz,ZodCodec:()=>_g,ZodCustom:()=>bg,ZodCustomStringFormat:()=>kd,ZodDate:()=>pg,ZodDefault:()=>bz,ZodDiscriminatedUnion:()=>az,ZodE164:()=>Hk,ZodEmail:()=>Rk,ZodEmoji:()=>Ik,ZodEnum:()=>xd,ZodError:()=>bHe,ZodExactOptional:()=>gz,ZodFile:()=>mz,ZodFirstPartyTypeKind:()=>Fz,ZodFunction:()=>Nz,ZodGUID:()=>cg,ZodIPv4:()=>Fk,ZodIPv6:()=>Lk,ZodISODate:()=>$k,ZodISODateTime:()=>xk,ZodISODuration:()=>Ek,ZodISOTime:()=>kk,ZodIntersection:()=>cz,ZodIssueCode:()=>SHe,ZodJWT:()=>Gk,ZodKSUID:()=>Mk,ZodLazy:()=>Pz,ZodLiteral:()=>pz,ZodMAC:()=>YL,ZodMap:()=>dz,ZodNaN:()=>Az,ZodNanoID:()=>Pk,ZodNever:()=>nz,ZodNonOptional:()=>Kk,ZodNull:()=>ez,ZodNullable:()=>_z,ZodNumber:()=>Ed,ZodNumberFormat:()=>Mc,ZodObject:()=>mg,ZodOptional:()=>Rd,ZodPipe:()=>yg,ZodPrefault:()=>Sz,ZodPreprocess:()=>Tz,ZodPromise:()=>Dz,ZodReadonly:()=>Oz,ZodRealError:()=>Vr,ZodRecord:()=>wd,ZodSet:()=>fz,ZodString:()=>$d,ZodStringFormat:()=>et,ZodSuccess:()=>$z,ZodSymbol:()=>XL,ZodTemplateLiteral:()=>Iz,ZodTransform:()=>hz,ZodTuple:()=>lz,ZodType:()=>_e,ZodULID:()=>Nk,ZodURL:()=>dg,ZodUUID:()=>ro,ZodUndefined:()=>QL,ZodUnion:()=>hg,ZodUnknown:()=>rz,ZodVoid:()=>iz,ZodXID:()=>jk,ZodXor:()=>sz,_ZodString:()=>Ok,_default:()=>vz,_function:()=>rse,any:()=>Moe,array:()=>ke,base64:()=>voe,base64url:()=>Soe,bigint:()=>Poe,boolean:()=>It,catch:()=>Ez,check:()=>nse,cidrv4:()=>_oe,cidrv6:()=>boe,clone:()=>nr,codec:()=>Xoe,coerce:()=>Lz,config:()=>Tt,core:()=>gi,cuid:()=>uoe,cuid2:()=>doe,custom:()=>Jk,date:()=>Loe,decode:()=>BL,decodeAsync:()=>GL,describe:()=>ise,discriminatedUnion:()=>gg,e164:()=>woe,email:()=>eoe,emoji:()=>coe,encode:()=>qL,encodeAsync:()=>HL,endsWith:()=>fd,enum:()=>sr,exactOptional:()=>yz,file:()=>Woe,flattenError:()=>kh,float32:()=>Toe,float64:()=>Ooe,formatError:()=>Eh,fromJSONSchema:()=>dse,function:()=>rse,getErrorMap:()=>xHe,globalRegistry:()=>ir,gt:()=>eo,gte:()=>Er,guid:()=>toe,hash:()=>Aoe,hex:()=>Eoe,hostname:()=>koe,httpUrl:()=>aoe,includes:()=>ud,instanceof:()=>sse,int:()=>Ak,int32:()=>Roe,int64:()=>Coe,intersection:()=>Od,invertCodec:()=>Qoe,ipv4:()=>hoe,ipv6:()=>yoe,iso:()=>Ks,json:()=>cse,jwt:()=>xoe,keyof:()=>zoe,ksuid:()=>moe,lazy:()=>Cz,length:()=>Cc,literal:()=>re,locales:()=>id,looseObject:()=>or,looseRecord:()=>Hoe,lowercase:()=>cd,lt:()=>Qi,lte:()=>wn,mac:()=>goe,map:()=>Goe,maxLength:()=>Pc,maxSize:()=>Bs,meta:()=>ose,mime:()=>pd,minLength:()=>Uo,minSize:()=>to,multipleOf:()=>qs,nan:()=>Yoe,nanoid:()=>loe,nativeEnum:()=>Voe,negative:()=>nk,never:()=>Vk,nonnegative:()=>ok,nonoptional:()=>xz,nonpositive:()=>ik,normalize:()=>md,null:()=>fg,nullable:()=>lg,nullish:()=>Koe,number:()=>Me,object:()=>W,optional:()=>at,overwrite:()=>hi,parse:()=>FL,parseAsync:()=>LL,partialRecord:()=>Boe,pipe:()=>Tk,positive:()=>rk,prefault:()=>wz,preprocess:()=>vg,prettifyError:()=>wM,promise:()=>tse,property:()=>sk,readonly:()=>Rz,record:()=>Je,refine:()=>jz,regex:()=>ad,regexes:()=>Zr,registry:()=>D$,safeDecode:()=>VL,safeDecodeAsync:()=>KL,safeEncode:()=>ZL,safeEncodeAsync:()=>WL,safeParse:()=>zL,safeParseAsync:()=>UL,set:()=>Zoe,setErrorMap:()=>wHe,size:()=>Ic,slugify:()=>_d,startsWith:()=>dd,strictObject:()=>Uoe,string:()=>I,stringFormat:()=>$oe,stringbool:()=>ase,success:()=>Joe,superRefine:()=>Mz,symbol:()=>Noe,templateLiteral:()=>ese,toJSONSchema:()=>Nc,toLowerCase:()=>gd,toUpperCase:()=>yd,transform:()=>Wk,treeifyError:()=>SM,trim:()=>hd,tuple:()=>uz,uint32:()=>Ioe,uint64:()=>Doe,ulid:()=>foe,undefined:()=>joe,union:()=>rt,unknown:()=>tt,uppercase:()=>ld,url:()=>soe,util:()=>M,uuid:()=>roe,uuidv4:()=>noe,uuidv6:()=>ioe,uuidv7:()=>ooe,void:()=>Foe,xid:()=>poe,xor:()=>qoe});var Yk=y(()=>{hr();ag();wk();ML();JL();lse();hr();RF();hr();vd();fse();P$();og();og();pse();Tt(O$())});var mse=y(()=>{Yk()});var hse=y(()=>{mse()});function Pse(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function Cse(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var Uz,gse,Js,Qk,Wt,yse,_se,BEt,CHe,DHe,qz,xn,Sg,bse,ar,Un,qn,cr,eE,vse,Bz,Sse,wse,Hz,wg,ae,Gz,xse,$se,HEt,tE,NHe,rE,jHe,xg,Id,kse,MHe,FHe,LHe,zHe,UHe,qHe,Zz,BHe,HHe,Vz,nE,GHe,ZHe,iE,VHe,$g,kg,WHe,Eg,Pd,KHe,Ag,oE,sE,aE,GEt,cE,lE,uE,Ese,Ase,Tse,Wz,Ose,Tg,Cd,Rse,JHe,dE,YHe,fE,XHe,Kz,QHe,pE,eGe,tGe,rGe,Jz,nGe,Yz,iGe,oGe,sGe,aGe,mE,cGe,lGe,hE,Xz,Qz,e2,uGe,dGe,fGe,t2,pGe,mGe,hGe,gGe,yGe,Ise,gE,_Ge,yE,ZEt,bGe,Dd,vGe,VEt,Og,SGe,r2,wGe,xGe,$Ge,kGe,EGe,AGe,TGe,Xk,OGe,RGe,IGe,Rg,n2,PGe,CGe,DGe,NGe,jGe,MGe,FGe,LGe,zGe,UGe,qGe,BGe,HGe,GGe,ZGe,VGe,WGe,KGe,Nd,JGe,YGe,XGe,_E,QGe,eZe,tZe,i2,rZe,WEt,KEt,JEt,YEt,XEt,QEt,ne,zz,Fc=y(()=>{hse();Uz="2025-11-25",gse=[Uz,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Js="io.modelcontextprotocol/related-task",Qk="2.0",Wt=Jk(t=>t!==null&&(typeof t=="object"||typeof t=="function")),yse=rt([I(),Me().int()]),_se=I(),BEt=or({ttl:Me().optional(),pollInterval:Me().optional()}),CHe=W({ttl:Me().optional()}),DHe=W({taskId:I()}),qz=or({progressToken:yse.optional(),[Js]:DHe.optional()}),xn=W({_meta:qz.optional()}),Sg=xn.extend({task:CHe.optional()}),bse=t=>Sg.safeParse(t).success,ar=W({method:I(),params:xn.loose().optional()}),Un=W({_meta:qz.optional()}),qn=W({method:I(),params:Un.loose().optional()}),cr=or({_meta:qz.optional()}),eE=rt([I(),Me().int()]),vse=W({jsonrpc:re(Qk),id:eE,...ar.shape}).strict(),Bz=t=>vse.safeParse(t).success,Sse=W({jsonrpc:re(Qk),...qn.shape}).strict(),wse=t=>Sse.safeParse(t).success,Hz=W({jsonrpc:re(Qk),id:eE,result:cr}).strict(),wg=t=>Hz.safeParse(t).success;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ae||(ae={}));Gz=W({jsonrpc:re(Qk),id:eE.optional(),error:W({code:Me().int(),message:I(),data:tt().optional()})}).strict(),xse=t=>Gz.safeParse(t).success,$se=rt([vse,Sse,Hz,Gz]),HEt=rt([Hz,Gz]),tE=cr.strict(),NHe=Un.extend({requestId:eE.optional(),reason:I().optional()}),rE=qn.extend({method:re("notifications/cancelled"),params:NHe}),jHe=W({src:I(),mimeType:I().optional(),sizes:ke(I()).optional(),theme:sr(["light","dark"]).optional()}),xg=W({icons:ke(jHe).optional()}),Id=W({name:I(),title:I().optional()}),kse=Id.extend({...Id.shape,...xg.shape,version:I(),websiteUrl:I().optional(),description:I().optional()}),MHe=Od(W({applyDefaults:It().optional()}),Je(I(),tt())),FHe=vg(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Od(W({form:MHe.optional(),url:Wt.optional()}),Je(I(),tt()).optional())),LHe=or({list:Wt.optional(),cancel:Wt.optional(),requests:or({sampling:or({createMessage:Wt.optional()}).optional(),elicitation:or({create:Wt.optional()}).optional()}).optional()}),zHe=or({list:Wt.optional(),cancel:Wt.optional(),requests:or({tools:or({call:Wt.optional()}).optional()}).optional()}),UHe=W({experimental:Je(I(),Wt).optional(),sampling:W({context:Wt.optional(),tools:Wt.optional()}).optional(),elicitation:FHe.optional(),roots:W({listChanged:It().optional()}).optional(),tasks:LHe.optional(),extensions:Je(I(),Wt).optional()}),qHe=xn.extend({protocolVersion:I(),capabilities:UHe,clientInfo:kse}),Zz=ar.extend({method:re("initialize"),params:qHe}),BHe=W({experimental:Je(I(),Wt).optional(),logging:Wt.optional(),completions:Wt.optional(),prompts:W({listChanged:It().optional()}).optional(),resources:W({subscribe:It().optional(),listChanged:It().optional()}).optional(),tools:W({listChanged:It().optional()}).optional(),tasks:zHe.optional(),extensions:Je(I(),Wt).optional()}),HHe=cr.extend({protocolVersion:I(),capabilities:BHe,serverInfo:kse,instructions:I().optional()}),Vz=qn.extend({method:re("notifications/initialized"),params:Un.optional()}),nE=ar.extend({method:re("ping"),params:xn.optional()}),GHe=W({progress:Me(),total:at(Me()),message:at(I())}),ZHe=W({...Un.shape,...GHe.shape,progressToken:yse}),iE=qn.extend({method:re("notifications/progress"),params:ZHe}),VHe=xn.extend({cursor:_se.optional()}),$g=ar.extend({params:VHe.optional()}),kg=cr.extend({nextCursor:_se.optional()}),WHe=sr(["working","input_required","completed","failed","cancelled"]),Eg=W({taskId:I(),status:WHe,ttl:rt([Me(),fg()]),createdAt:I(),lastUpdatedAt:I(),pollInterval:at(Me()),statusMessage:at(I())}),Pd=cr.extend({task:Eg}),KHe=Un.merge(Eg),Ag=qn.extend({method:re("notifications/tasks/status"),params:KHe}),oE=ar.extend({method:re("tasks/get"),params:xn.extend({taskId:I()})}),sE=cr.merge(Eg),aE=ar.extend({method:re("tasks/result"),params:xn.extend({taskId:I()})}),GEt=cr.loose(),cE=$g.extend({method:re("tasks/list")}),lE=kg.extend({tasks:ke(Eg)}),uE=ar.extend({method:re("tasks/cancel"),params:xn.extend({taskId:I()})}),Ese=cr.merge(Eg),Ase=W({uri:I(),mimeType:at(I()),_meta:Je(I(),tt()).optional()}),Tse=Ase.extend({text:I()}),Wz=I().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ose=Ase.extend({blob:Wz}),Tg=sr(["user","assistant"]),Cd=W({audience:ke(Tg).optional(),priority:Me().min(0).max(1).optional(),lastModified:Ks.datetime({offset:!0}).optional()}),Rse=W({...Id.shape,...xg.shape,uri:I(),description:at(I()),mimeType:at(I()),size:at(Me()),annotations:Cd.optional(),_meta:at(or({}))}),JHe=W({...Id.shape,...xg.shape,uriTemplate:I(),description:at(I()),mimeType:at(I()),annotations:Cd.optional(),_meta:at(or({}))}),dE=$g.extend({method:re("resources/list")}),YHe=kg.extend({resources:ke(Rse)}),fE=$g.extend({method:re("resources/templates/list")}),XHe=kg.extend({resourceTemplates:ke(JHe)}),Kz=xn.extend({uri:I()}),QHe=Kz,pE=ar.extend({method:re("resources/read"),params:QHe}),eGe=cr.extend({contents:ke(rt([Tse,Ose]))}),tGe=qn.extend({method:re("notifications/resources/list_changed"),params:Un.optional()}),rGe=Kz,Jz=ar.extend({method:re("resources/subscribe"),params:rGe}),nGe=Kz,Yz=ar.extend({method:re("resources/unsubscribe"),params:nGe}),iGe=Un.extend({uri:I()}),oGe=qn.extend({method:re("notifications/resources/updated"),params:iGe}),sGe=W({name:I(),description:at(I()),required:at(It())}),aGe=W({...Id.shape,...xg.shape,description:at(I()),arguments:at(ke(sGe)),_meta:at(or({}))}),mE=$g.extend({method:re("prompts/list")}),cGe=kg.extend({prompts:ke(aGe)}),lGe=xn.extend({name:I(),arguments:Je(I(),I()).optional()}),hE=ar.extend({method:re("prompts/get"),params:lGe}),Xz=W({type:re("text"),text:I(),annotations:Cd.optional(),_meta:Je(I(),tt()).optional()}),Qz=W({type:re("image"),data:Wz,mimeType:I(),annotations:Cd.optional(),_meta:Je(I(),tt()).optional()}),e2=W({type:re("audio"),data:Wz,mimeType:I(),annotations:Cd.optional(),_meta:Je(I(),tt()).optional()}),uGe=W({type:re("tool_use"),name:I(),id:I(),input:Je(I(),tt()),_meta:Je(I(),tt()).optional()}),dGe=W({type:re("resource"),resource:rt([Tse,Ose]),annotations:Cd.optional(),_meta:Je(I(),tt()).optional()}),fGe=Rse.extend({type:re("resource_link")}),t2=rt([Xz,Qz,e2,fGe,dGe]),pGe=W({role:Tg,content:t2}),mGe=cr.extend({description:I().optional(),messages:ke(pGe)}),hGe=qn.extend({method:re("notifications/prompts/list_changed"),params:Un.optional()}),gGe=W({title:I().optional(),readOnlyHint:It().optional(),destructiveHint:It().optional(),idempotentHint:It().optional(),openWorldHint:It().optional()}),yGe=W({taskSupport:sr(["required","optional","forbidden"]).optional()}),Ise=W({...Id.shape,...xg.shape,description:I().optional(),inputSchema:W({type:re("object"),properties:Je(I(),Wt).optional(),required:ke(I()).optional()}).catchall(tt()),outputSchema:W({type:re("object"),properties:Je(I(),Wt).optional(),required:ke(I()).optional()}).catchall(tt()).optional(),annotations:gGe.optional(),execution:yGe.optional(),_meta:Je(I(),tt()).optional()}),gE=$g.extend({method:re("tools/list")}),_Ge=kg.extend({tools:ke(Ise)}),yE=cr.extend({content:ke(t2).default([]),structuredContent:Je(I(),tt()).optional(),isError:It().optional()}),ZEt=yE.or(cr.extend({toolResult:tt()})),bGe=Sg.extend({name:I(),arguments:Je(I(),tt()).optional()}),Dd=ar.extend({method:re("tools/call"),params:bGe}),vGe=qn.extend({method:re("notifications/tools/list_changed"),params:Un.optional()}),VEt=W({autoRefresh:It().default(!0),debounceMs:Me().int().nonnegative().default(300)}),Og=sr(["debug","info","notice","warning","error","critical","alert","emergency"]),SGe=xn.extend({level:Og}),r2=ar.extend({method:re("logging/setLevel"),params:SGe}),wGe=Un.extend({level:Og,logger:I().optional(),data:tt()}),xGe=qn.extend({method:re("notifications/message"),params:wGe}),$Ge=W({name:I().optional()}),kGe=W({hints:ke($Ge).optional(),costPriority:Me().min(0).max(1).optional(),speedPriority:Me().min(0).max(1).optional(),intelligencePriority:Me().min(0).max(1).optional()}),EGe=W({mode:sr(["auto","required","none"]).optional()}),AGe=W({type:re("tool_result"),toolUseId:I().describe("The unique identifier for the corresponding tool call."),content:ke(t2).default([]),structuredContent:W({}).loose().optional(),isError:It().optional(),_meta:Je(I(),tt()).optional()}),TGe=gg("type",[Xz,Qz,e2]),Xk=gg("type",[Xz,Qz,e2,uGe,AGe]),OGe=W({role:Tg,content:rt([Xk,ke(Xk)]),_meta:Je(I(),tt()).optional()}),RGe=Sg.extend({messages:ke(OGe),modelPreferences:kGe.optional(),systemPrompt:I().optional(),includeContext:sr(["none","thisServer","allServers"]).optional(),temperature:Me().optional(),maxTokens:Me().int(),stopSequences:ke(I()).optional(),metadata:Wt.optional(),tools:ke(Ise).optional(),toolChoice:EGe.optional()}),IGe=ar.extend({method:re("sampling/createMessage"),params:RGe}),Rg=cr.extend({model:I(),stopReason:at(sr(["endTurn","stopSequence","maxTokens"]).or(I())),role:Tg,content:TGe}),n2=cr.extend({model:I(),stopReason:at(sr(["endTurn","stopSequence","maxTokens","toolUse"]).or(I())),role:Tg,content:rt([Xk,ke(Xk)])}),PGe=W({type:re("boolean"),title:I().optional(),description:I().optional(),default:It().optional()}),CGe=W({type:re("string"),title:I().optional(),description:I().optional(),minLength:Me().optional(),maxLength:Me().optional(),format:sr(["email","uri","date","date-time"]).optional(),default:I().optional()}),DGe=W({type:sr(["number","integer"]),title:I().optional(),description:I().optional(),minimum:Me().optional(),maximum:Me().optional(),default:Me().optional()}),NGe=W({type:re("string"),title:I().optional(),description:I().optional(),enum:ke(I()),default:I().optional()}),jGe=W({type:re("string"),title:I().optional(),description:I().optional(),oneOf:ke(W({const:I(),title:I()})),default:I().optional()}),MGe=W({type:re("string"),title:I().optional(),description:I().optional(),enum:ke(I()),enumNames:ke(I()).optional(),default:I().optional()}),FGe=rt([NGe,jGe]),LGe=W({type:re("array"),title:I().optional(),description:I().optional(),minItems:Me().optional(),maxItems:Me().optional(),items:W({type:re("string"),enum:ke(I())}),default:ke(I()).optional()}),zGe=W({type:re("array"),title:I().optional(),description:I().optional(),minItems:Me().optional(),maxItems:Me().optional(),items:W({anyOf:ke(W({const:I(),title:I()}))}),default:ke(I()).optional()}),UGe=rt([LGe,zGe]),qGe=rt([MGe,FGe,UGe]),BGe=rt([qGe,PGe,CGe,DGe]),HGe=Sg.extend({mode:re("form").optional(),message:I(),requestedSchema:W({type:re("object"),properties:Je(I(),BGe),required:ke(I()).optional()})}),GGe=Sg.extend({mode:re("url"),message:I(),elicitationId:I(),url:I().url()}),ZGe=rt([HGe,GGe]),VGe=ar.extend({method:re("elicitation/create"),params:ZGe}),WGe=Un.extend({elicitationId:I()}),KGe=qn.extend({method:re("notifications/elicitation/complete"),params:WGe}),Nd=cr.extend({action:sr(["accept","decline","cancel"]),content:vg(t=>t===null?void 0:t,Je(I(),rt([I(),Me(),It(),ke(I())])).optional())}),JGe=W({type:re("ref/resource"),uri:I()}),YGe=W({type:re("ref/prompt"),name:I()}),XGe=xn.extend({ref:rt([YGe,JGe]),argument:W({name:I(),value:I()}),context:W({arguments:Je(I(),I()).optional()}).optional()}),_E=ar.extend({method:re("completion/complete"),params:XGe});QGe=cr.extend({completion:or({values:ke(I()).max(100),total:at(Me().int()),hasMore:at(It())})}),eZe=W({uri:I().startsWith("file://"),name:I().optional(),_meta:Je(I(),tt()).optional()}),tZe=ar.extend({method:re("roots/list"),params:xn.optional()}),i2=cr.extend({roots:ke(eZe)}),rZe=qn.extend({method:re("notifications/roots/list_changed"),params:Un.optional()}),WEt=rt([nE,Zz,_E,r2,hE,mE,dE,fE,pE,Jz,Yz,Dd,gE,oE,aE,cE,uE]),KEt=rt([rE,iE,Vz,rZe,Ag]),JEt=rt([tE,Rg,n2,Nd,i2,sE,lE,Pd]),YEt=rt([nE,IGe,VGe,tZe,oE,aE,cE,uE]),XEt=rt([rE,iE,xGe,oGe,tGe,vGe,hGe,Ag,KGe]),QEt=rt([tE,HHe,QGe,mGe,cGe,YHe,XHe,eGe,yE,_Ge,sE,lE,Pd]),ne=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===ae.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new zz(i.elicitations,r)}return new t(e,r,n)}},zz=class extends ne{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(ae.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}});function Ys(t){return t==="completed"||t==="failed"||t==="cancelled"}var Dse=y(()=>{});var jse,Nse,Mse,bE=y(()=>{jse=Symbol("Let zodToJsonSchema decide on which parser to use"),Nse={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Mse=t=>typeof t=="string"?{...Nse,name:t}:{...Nse,...t}});var Fse,o2=y(()=>{bE();Fse=t=>{let e=Mse(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,i])=>[i._def,{def:i._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}}});function s2(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function Ie(t,e,r,n,i){t[e]=r,s2(t,e,n,i)}var Xs=y(()=>{});var vE,SE=y(()=>{vE=(t,e)=>{let r=0;for(;r{SE()});function Lse(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==z.ZodAny&&(r.items=le(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&Ie(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Ie(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Ie(r,"minItems",t.exactLength.value,t.exactLength.message,e),Ie(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}var a2=y(()=>{yh();Xs();Ft()});function zse(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?Ie(r,"minimum",n.value,n.message,e):Ie(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Ie(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Ie(r,"maximum",n.value,n.message,e):Ie(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Ie(r,"maximum",n.value,n.message,e));break;case"multipleOf":Ie(r,"multipleOf",n.value,n.message,e);break}return r}var c2=y(()=>{Xs()});function Use(){return{type:"boolean"}}var l2=y(()=>{});function wE(t,e){return le(t.type._def,e)}var xE=y(()=>{Ft()});var qse,u2=y(()=>{Ft();qse=(t,e)=>le(t.innerType._def,e)});function d2(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((i,o)=>d2(t,e,i))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return nZe(t,e)}}var nZe,f2=y(()=>{Xs();nZe=(t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":Ie(r,"minimum",n.value,n.message,e);break;case"max":Ie(r,"maximum",n.value,n.message,e);break}return r}});function Bse(t,e){return{...le(t.innerType._def,e),default:t.defaultValue()}}var p2=y(()=>{Ft()});function Hse(t,e){return e.effectStrategy==="input"?le(t.schema._def,e):yt(e)}var m2=y(()=>{Ft();Bn()});function Gse(t){return{type:"string",enum:Array.from(t.values)}}var h2=y(()=>{});function Zse(t,e){let r=[le(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),le(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(o=>!!o),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,i=[];return r.forEach(o=>{if(iZe(o))i.push(...o.allOf),o.unevaluatedProperties===void 0&&(n=void 0);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:a,...c}=o;s=c}else n=void 0;i.push(s)}}),i.length?{allOf:i,...n}:void 0}var iZe,g2=y(()=>{Ft();iZe=t=>"type"in t&&t.type==="string"?!1:"allOf"in t});function Vse(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}var y2=y(()=>{});function $E(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":Ie(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":Ie(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":_i(r,"email",n.message,e);break;case"format:idn-email":_i(r,"idn-email",n.message,e);break;case"pattern:zod":Tr(r,yi.email,n.message,e);break}break;case"url":_i(r,"uri",n.message,e);break;case"uuid":_i(r,"uuid",n.message,e);break;case"regex":Tr(r,n.regex,n.message,e);break;case"cuid":Tr(r,yi.cuid,n.message,e);break;case"cuid2":Tr(r,yi.cuid2,n.message,e);break;case"startsWith":Tr(r,RegExp(`^${b2(n.value,e)}`),n.message,e);break;case"endsWith":Tr(r,RegExp(`${b2(n.value,e)}$`),n.message,e);break;case"datetime":_i(r,"date-time",n.message,e);break;case"date":_i(r,"date",n.message,e);break;case"time":_i(r,"time",n.message,e);break;case"duration":_i(r,"duration",n.message,e);break;case"length":Ie(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),Ie(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Tr(r,RegExp(b2(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&_i(r,"ipv4",n.message,e),n.version!=="v4"&&_i(r,"ipv6",n.message,e);break}case"base64url":Tr(r,yi.base64url,n.message,e);break;case"jwt":Tr(r,yi.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Tr(r,yi.ipv4Cidr,n.message,e),n.version!=="v4"&&Tr(r,yi.ipv6Cidr,n.message,e);break}case"emoji":Tr(r,yi.emoji(),n.message,e);break;case"ulid":{Tr(r,yi.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{_i(r,"binary",n.message,e);break}case"contentEncoding:base64":{Ie(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Tr(r,yi.base64,n.message,e);break}}break}case"nanoid":Tr(r,yi.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function b2(t,e){return e.patternStrategy==="escape"?sZe(t):t}function sZe(t){let e="";for(let r=0;ri.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):Ie(t,"format",e,r,n)}function Tr(t,e,r,n){t.pattern||t.allOf?.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:Wse(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):Ie(t,"pattern",Wse(e,n),r,n)}function Wse(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,i="",o=!1,s=!1,a=!1;for(let c=0;c1&&t.reused==="ref"){o(s);continue}}}function Zs(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=t.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){n(d);let p=t.seen.get(d),m=p.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):Object.assign(l,m),Object.assign(l,u),a._zod.parent===d)for(let g in l)g==="$ref"||g==="allOf"||g in u||delete l[g];if(m.$ref&&p.def)for(let g in l)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(l[g])===JSON.stringify(p.def[g])&&delete l[g]}let f=a._zod.parent;if(f&&f!==d){n(f);let p=t.seen.get(f);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(let m in l)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(l[m])===JSON.stringify(p.def[m])&&delete l[m]}t.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())n(a[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(a)}Object.assign(i,r.def??r.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&i.id===o&&delete i.id;let s=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,s[c.defId]=c.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{let a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:bd(e,"input",t.processors),output:bd(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ar(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ar(n.element,r);if(n.type==="set")return Ar(n.valueType,r);if(n.type==="lazy")return Ar(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Ar(n.innerType,r);if(n.type==="intersection")return Ar(n.left,r)||Ar(n.right,r);if(n.type==="record"||n.type==="map")return Ar(n.keyType,r)||Ar(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Ar(n.in,r)||Ar(n.out,r);if(n.type==="object"){for(let i in n.shape)if(Ar(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(Ar(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(Ar(i,r))return!0;return!!(n.rest&&Ar(n.rest,r))}return!1}var ZF,bd,ng=y(()=>{jh();ZF=(t,e={})=>r=>{let n=Hs({...r,processors:e});return Ve(t,n),Gs(n,t),Zs(n,t)},bd=(t,e,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},s=Hs({...i??{},target:o,io:e,processors:r});return Ve(t,s),Gs(s,t),Zs(s,t)}});function Nc(t,e){if("_idmap"in t){let n=t,i=Hs({...e,processors:mk}),o={};for(let c of n._idmap.entries()){let[l,u]=c;Ve(u,i)}let s={},a={registry:n,uri:e?.uri,defs:o};i.external=a;for(let c of n._idmap.entries()){let[l,u]=c;Gs(i,u),s[l]=Zs(i,u)}if(Object.keys(o).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=Hs({...e,processors:mk});return Ve(t,r),Gs(r,t),Zs(r,t)}var fHe,VF,WF,KF,JF,YF,XF,QF,eL,tL,rL,nL,iL,oL,sL,aL,cL,lL,uL,dL,fL,pL,mL,hL,gL,yL,hk,_L,bL,vL,SL,wL,xL,$L,kL,EL,AL,TL,gk,OL,mk,vd=y(()=>{ng();ee();fHe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},VF=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof s=="number"&&(i.maxLength=s),a&&(i.format=fHe[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},WF=(t,e,r,n)=>{let i=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number";let d=typeof u=="number"&&u>=(o??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(s??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof o=="number"&&(i.minimum=o),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof s=="number"&&(i.maximum=s),typeof c=="number"&&(i.multipleOf=c)},KF=(t,e,r,n)=>{r.type="boolean"},JF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},YF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},XF=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},QF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},eL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},tL=(t,e,r,n)=>{r.not={}},rL=(t,e,r,n)=>{},nL=(t,e,r,n)=>{},iL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},oL=(t,e,r,n)=>{let i=t._zod.def,o=bh(i.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},sL=(t,e,r,n)=>{let i=t._zod.def,o=[];for(let s of i.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},aL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},cL=(t,e,r,n)=>{let i=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},lL=(t,e,r,n)=>{let i=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(i,o)},uL=(t,e,r,n)=>{r.type="boolean"},dL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},fL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},pL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},mL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},hL=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},gL=(t,e,r,n)=>{let i=r,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=Ve(o.element,e,{...n,path:[...n.path,"items"]})},yL=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="object",i.properties={};let s=o.shape;for(let l in s)i.properties[l]=Ve(s[l],e,{...n,path:[...n.path,"properties",l]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(l=>{let u=o.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(i.required=Array.from(c)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=Ve(o.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},hk=(t,e,r,n)=>{let i=t._zod.def,o=i.inclusive===!1,s=i.options.map((a,c)=>Ve(a,e,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},_L=(t,e,r,n)=>{let i=t._zod.def,o=Ve(i.left,e,{...n,path:[...n.path,"allOf",0]}),s=Ve(i.right,e,{...n,path:[...n.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},bL=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((f,p)=>Ve(f,e,{...n,path:[...n.path,s,p]})),l=o.rest?Ve(o.rest,e,{...n,path:[...n.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=c,l&&(i.items=l)):e.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(i.minItems=u),typeof d=="number"&&(i.maxItems=d)},vL=(t,e,r,n)=>{let i=r,o=t._zod.def;i.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let u=Ve(o.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let d of c)i.patternProperties[d.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Ve(o.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=Ve(o.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(i.required=u)}},SL=(t,e,r,n)=>{let i=t._zod.def,o=Ve(i.innerType,e,n),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},wL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},xL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},$L=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},kL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},EL=(t,e,r,n)=>{let i=t._zod.def,o=i.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?i.out:i.in:i.out;Ve(s,e,n);let a=e.seen.get(t);a.ref=s},AL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType,r.readOnly=!0},TL=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},gk=(t,e,r,n)=>{let i=t._zod.def;Ve(i.innerType,e,n);let o=e.seen.get(t);o.ref=i.innerType},OL=(t,e,r,n)=>{let i=t._zod.innerType;Ve(i,e,n);let o=e.seen.get(t);o.ref=i},mk={string:VF,number:WF,boolean:KF,bigint:JF,symbol:YF,null:XF,undefined:QF,void:eL,never:tL,any:rL,unknown:nL,date:iL,enum:oL,literal:sL,nan:aL,template_literal:cL,file:lL,success:uL,custom:dL,function:fL,transform:pL,map:mL,set:hL,array:gL,object:yL,union:hk,intersection:_L,tuple:bL,record:vL,nullable:SL,nonoptional:wL,default:xL,prefault:$L,catch:kL,pipe:EL,readonly:AL,promise:TL,optional:gk,lazy:OL}});var yk,Uie=y(()=>{vd();ng();yk=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Hs({processors:mk,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return Ve(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Gs(this.ctx,e);let n=Zs(this.ctx,e),{"~standard":i,...o}=n;return o}}});var qie={};var Bie=y(()=>{});var gi={};Pr(gi,{$ZodAny:()=>X0,$ZodArray:()=>n$,$ZodAsyncError:()=>mi,$ZodBase64:()=>q0,$ZodBase64URL:()=>B0,$ZodBigInt:()=>Ih,$ZodBigIntFormat:()=>W0,$ZodBoolean:()=>ed,$ZodCIDRv4:()=>z0,$ZodCIDRv6:()=>U0,$ZodCUID:()=>P0,$ZodCUID2:()=>C0,$ZodCatch:()=>S$,$ZodCheck:()=>Qe,$ZodCheckBigIntFormat:()=>rF,$ZodCheckEndsWith:()=>mF,$ZodCheckGreaterThan:()=>v0,$ZodCheckIncludes:()=>fF,$ZodCheckLengthEquals:()=>cF,$ZodCheckLessThan:()=>b0,$ZodCheckLowerCase:()=>uF,$ZodCheckMaxLength:()=>sF,$ZodCheckMaxSize:()=>nF,$ZodCheckMimeType:()=>gF,$ZodCheckMinLength:()=>aF,$ZodCheckMinSize:()=>iF,$ZodCheckMultipleOf:()=>eF,$ZodCheckNumberFormat:()=>tF,$ZodCheckOverwrite:()=>yF,$ZodCheckProperty:()=>hF,$ZodCheckRegex:()=>lF,$ZodCheckSizeEquals:()=>oF,$ZodCheckStartsWith:()=>pF,$ZodCheckStringFormat:()=>Qu,$ZodCheckUpperCase:()=>dF,$ZodCodec:()=>rd,$ZodCustom:()=>T$,$ZodCustomStringFormat:()=>Z0,$ZodDate:()=>r$,$ZodDefault:()=>y$,$ZodDiscriminatedUnion:()=>s$,$ZodE164:()=>H0,$ZodEmail:()=>T0,$ZodEmoji:()=>R0,$ZodEncodeError:()=>Ds,$ZodEnum:()=>d$,$ZodError:()=>$h,$ZodExactOptional:()=>h$,$ZodFile:()=>p$,$ZodFunction:()=>k$,$ZodGUID:()=>E0,$ZodIPv4:()=>M0,$ZodIPv6:()=>F0,$ZodISODate:()=>xF,$ZodISODateTime:()=>wF,$ZodISODuration:()=>kF,$ZodISOTime:()=>$F,$ZodIntersection:()=>a$,$ZodJWT:()=>G0,$ZodKSUID:()=>j0,$ZodLazy:()=>A$,$ZodLiteral:()=>f$,$ZodMAC:()=>L0,$ZodMap:()=>l$,$ZodNaN:()=>w$,$ZodNanoID:()=>I0,$ZodNever:()=>e$,$ZodNonOptional:()=>b$,$ZodNull:()=>Y0,$ZodNullable:()=>g$,$ZodNumber:()=>Rh,$ZodNumberFormat:()=>V0,$ZodObject:()=>i$,$ZodObjectJIT:()=>AF,$ZodOptional:()=>Ch,$ZodPipe:()=>Dh,$ZodPrefault:()=>_$,$ZodPreprocess:()=>TF,$ZodPromise:()=>E$,$ZodReadonly:()=>x$,$ZodRealError:()=>Gr,$ZodRecord:()=>c$,$ZodRegistry:()=>C$,$ZodSet:()=>u$,$ZodString:()=>Us,$ZodStringFormat:()=>Ke,$ZodSuccess:()=>v$,$ZodSymbol:()=>K0,$ZodTemplateLiteral:()=>$$,$ZodTransform:()=>m$,$ZodTuple:()=>Ph,$ZodType:()=>ue,$ZodULID:()=>D0,$ZodURL:()=>O0,$ZodUUID:()=>A0,$ZodUndefined:()=>J0,$ZodUnion:()=>td,$ZodUnknown:()=>Q0,$ZodVoid:()=>t$,$ZodXID:()=>N0,$ZodXor:()=>o$,$brand:()=>uM,$constructor:()=>k,$input:()=>DF,$output:()=>CF,Doc:()=>Oh,JSONSchema:()=>qie,JSONSchemaGenerator:()=>yk,NEVER:()=>lM,TimePrecision:()=>jF,_any:()=>J$,_array:()=>GF,_base64:()=>Qh,_base64url:()=>eg,_bigint:()=>H$,_boolean:()=>B$,_catch:()=>sHe,_check:()=>Lie,_cidrv4:()=>Yh,_cidrv6:()=>Xh,_coercedBigint:()=>BF,_coercedBoolean:()=>qF,_coercedDate:()=>HF,_coercedNumber:()=>UF,_coercedString:()=>NF,_cuid:()=>Hh,_cuid2:()=>Gh,_custom:()=>ck,_date:()=>ek,_decode:()=>l0,_decodeAsync:()=>d0,_default:()=>nHe,_discriminatedUnion:()=>GBe,_e164:()=>tg,_email:()=>Mh,_emoji:()=>qh,_encode:()=>c0,_encodeAsync:()=>u0,_endsWith:()=>fd,_enum:()=>YBe,_file:()=>ak,_float32:()=>L$,_float64:()=>z$,_gt:()=>eo,_gte:()=>Er,_guid:()=>od,_includes:()=>ud,_int:()=>F$,_int32:()=>U$,_int64:()=>G$,_intersection:()=>ZBe,_ipv4:()=>Kh,_ipv6:()=>Jh,_isoDate:()=>FF,_isoDateTime:()=>MF,_isoDuration:()=>zF,_isoTime:()=>LF,_jwt:()=>rg,_ksuid:()=>Wh,_lazy:()=>uHe,_length:()=>Cc,_literal:()=>QBe,_lowercase:()=>cd,_lt:()=>Qi,_lte:()=>wn,_mac:()=>j$,_map:()=>KBe,_max:()=>wn,_maxLength:()=>Pc,_maxSize:()=>Bs,_mime:()=>pd,_min:()=>Er,_minLength:()=>Uo,_minSize:()=>to,_multipleOf:()=>qs,_nan:()=>tk,_nanoid:()=>Bh,_nativeEnum:()=>XBe,_negative:()=>nk,_never:()=>X$,_nonnegative:()=>ok,_nonoptional:()=>iHe,_nonpositive:()=>ik,_normalize:()=>md,_null:()=>K$,_nullable:()=>rHe,_number:()=>M$,_optional:()=>tHe,_overwrite:()=>hi,_parse:()=>Ku,_parseAsync:()=>Ju,_pipe:()=>aHe,_positive:()=>rk,_promise:()=>dHe,_property:()=>sk,_readonly:()=>cHe,_record:()=>WBe,_refine:()=>lk,_regex:()=>ad,_safeDecode:()=>p0,_safeDecodeAsync:()=>h0,_safeEncode:()=>f0,_safeEncodeAsync:()=>m0,_safeParse:()=>Yu,_safeParseAsync:()=>Xu,_set:()=>JBe,_size:()=>Ic,_slugify:()=>_d,_startsWith:()=>dd,_string:()=>N$,_stringFormat:()=>Dc,_stringbool:()=>pk,_success:()=>oHe,_superRefine:()=>uk,_symbol:()=>V$,_templateLiteral:()=>lHe,_toLowerCase:()=>gd,_toUpperCase:()=>yd,_transform:()=>eHe,_trim:()=>hd,_tuple:()=>VBe,_uint32:()=>q$,_uint64:()=>Z$,_ulid:()=>Zh,_undefined:()=>W$,_union:()=>BBe,_unknown:()=>Y$,_uppercase:()=>ld,_url:()=>sd,_uuid:()=>Fh,_uuidv4:()=>Lh,_uuidv6:()=>zh,_uuidv7:()=>Uh,_void:()=>Q$,_xid:()=>Vh,_xor:()=>HBe,clone:()=>nr,config:()=>Tt,createStandardJSONSchemaMethod:()=>bd,createToJSONSchemaMethod:()=>ZF,decode:()=>pre,decodeAsync:()=>hre,describe:()=>dk,encode:()=>fre,encodeAsync:()=>mre,extractDefs:()=>Gs,finalize:()=>Zs,flattenError:()=>kh,formatError:()=>Eh,globalConfig:()=>kc,globalRegistry:()=>ir,initializeContext:()=>Hs,isValidBase64:()=>EF,isValidBase64URL:()=>zre,isValidJWT:()=>Ure,locales:()=>id,meta:()=>fk,parse:()=>Tc,parseAsync:()=>Oc,prettifyError:()=>wM,process:()=>Ve,regexes:()=>Zr,registry:()=>D$,safeDecode:()=>yre,safeDecodeAsync:()=>bre,safeEncode:()=>gre,safeEncodeAsync:()=>_re,safeParse:()=>Ls,safeParseAsync:()=>zs,toDotPath:()=>dre,toJSONSchema:()=>Nc,treeifyError:()=>SM,util:()=>M,version:()=>bF});var hr=y(()=>{Ec();$M();xM();OF();S0();vF();ee();_0();P$();jh();_F();zie();ng();vd();Uie();Bie()});var RL=y(()=>{hr()});function IL(t,e){let r={type:"object",shape:t??{},...U(e)};return new gHe(r)}var hHe,gHe,Hie=y(()=>{hr();ee();RL();hHe=k("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");ue.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>Tc(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Ls(t,r,n),t.parseAsync=async(r,n)=>Oc(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>zs(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>nr(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),gHe=k("ZodMiniObject",(t,e)=>{i$.init(t,e),hHe.init(t,e),ve(t,"shape",()=>e.shape)})});var Gie=y(()=>{});var Zie=y(()=>{});var Vie=y(()=>{});var Wie=y(()=>{hr();RL();Hie();Gie();vd();P$();Zie();Vie()});var PL=y(()=>{Wie()});function zn(t){return!!t._zod}function jc(t){let e=Object.values(t);if(e.length===0)return IL({});let r=e.every(zn),n=e.every(i=>!zn(i));if(r)return IL(t);if(n)return Yte(t);throw new Error("Mixed Zod versions detected in object shape.")}function Vs(t,e){return zn(t)?Ls(t,e):t.safeParse(e)}async function _k(t,e){return zn(t)?await zs(t,e):await t.safeParseAsync(e)}function Ws(t){if(!t)return;let e;if(zn(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Sd(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let n=Object.values(t);if(n.length>0&&n.every(i=>typeof i=="object"&&i!==null&&(i._def!==void 0||i._zod!==void 0||typeof i.parse=="function")))return jc(t)}}if(zn(t)){let r=t._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function bk(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function Jie(t){return t.description}function Yie(t){if(zn(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function vk(t){if(zn(t)){let o=t._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}var ig=y(()=>{yh();PL()});var Sk={};Pr(Sk,{endsWith:()=>fd,gt:()=>eo,gte:()=>Er,includes:()=>ud,length:()=>Cc,lowercase:()=>cd,lt:()=>Qi,lte:()=>wn,maxLength:()=>Pc,maxSize:()=>Bs,mime:()=>pd,minLength:()=>Uo,minSize:()=>to,multipleOf:()=>qs,negative:()=>nk,nonnegative:()=>ok,nonpositive:()=>ik,normalize:()=>md,overwrite:()=>hi,positive:()=>rk,property:()=>sk,regex:()=>ad,size:()=>Ic,slugify:()=>_d,startsWith:()=>dd,toLowerCase:()=>gd,toUpperCase:()=>yd,trim:()=>hd,uppercase:()=>ld});var wk=y(()=>{hr()});var Ks={};Pr(Ks,{ZodISODate:()=>$k,ZodISODateTime:()=>xk,ZodISODuration:()=>Ek,ZodISOTime:()=>kk,date:()=>DL,datetime:()=>CL,duration:()=>jL,time:()=>NL});function CL(t){return MF(xk,t)}function DL(t){return FF($k,t)}function NL(t){return LF(kk,t)}function jL(t){return zF(Ek,t)}var xk,$k,kk,Ek,og=y(()=>{hr();ag();xk=k("ZodISODateTime",(t,e)=>{wF.init(t,e),et.init(t,e)});$k=k("ZodISODate",(t,e)=>{xF.init(t,e),et.init(t,e)});kk=k("ZodISOTime",(t,e)=>{$F.init(t,e),et.init(t,e)});Ek=k("ZodISODuration",(t,e)=>{kF.init(t,e),et.init(t,e)})});var Xie,bHe,Vr,ML=y(()=>{hr();hr();ee();Xie=(t,e)=>{$h.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>Eh(t,r)},flatten:{value:r=>kh(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Zu,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Zu,2)}},isEmpty:{get(){return t.issues.length===0}}})},bHe=k("ZodError",Xie),Vr=k("ZodError",Xie,{Parent:Error})});var FL,LL,zL,UL,qL,BL,HL,GL,ZL,VL,WL,KL,JL=y(()=>{hr();ML();FL=Ku(Vr),LL=Ju(Vr),zL=Yu(Vr),UL=Xu(Vr),qL=c0(Vr),BL=l0(Vr),HL=u0(Vr),GL=d0(Vr),ZL=f0(Vr),VL=p0(Vr),WL=m0(Vr),KL=h0(Vr)});var sg={};Pr(sg,{ZodAny:()=>tz,ZodArray:()=>oz,ZodBase64:()=>qk,ZodBase64URL:()=>Bk,ZodBigInt:()=>Td,ZodBigIntFormat:()=>Zk,ZodBoolean:()=>Ad,ZodCIDRv4:()=>zk,ZodCIDRv6:()=>Uk,ZodCUID:()=>Ck,ZodCUID2:()=>Dk,ZodCatch:()=>kz,ZodCodec:()=>_g,ZodCustom:()=>bg,ZodCustomStringFormat:()=>kd,ZodDate:()=>pg,ZodDefault:()=>bz,ZodDiscriminatedUnion:()=>az,ZodE164:()=>Hk,ZodEmail:()=>Rk,ZodEmoji:()=>Ik,ZodEnum:()=>xd,ZodExactOptional:()=>gz,ZodFile:()=>mz,ZodFunction:()=>Nz,ZodGUID:()=>cg,ZodIPv4:()=>Fk,ZodIPv6:()=>Lk,ZodIntersection:()=>cz,ZodJWT:()=>Gk,ZodKSUID:()=>Mk,ZodLazy:()=>Pz,ZodLiteral:()=>pz,ZodMAC:()=>YL,ZodMap:()=>dz,ZodNaN:()=>Az,ZodNanoID:()=>Pk,ZodNever:()=>nz,ZodNonOptional:()=>Kk,ZodNull:()=>ez,ZodNullable:()=>_z,ZodNumber:()=>Ed,ZodNumberFormat:()=>Mc,ZodObject:()=>mg,ZodOptional:()=>Rd,ZodPipe:()=>yg,ZodPrefault:()=>Sz,ZodPreprocess:()=>Tz,ZodPromise:()=>Dz,ZodReadonly:()=>Oz,ZodRecord:()=>wd,ZodSet:()=>fz,ZodString:()=>$d,ZodStringFormat:()=>et,ZodSuccess:()=>$z,ZodSymbol:()=>XL,ZodTemplateLiteral:()=>Iz,ZodTransform:()=>hz,ZodTuple:()=>lz,ZodType:()=>_e,ZodULID:()=>Nk,ZodURL:()=>dg,ZodUUID:()=>ro,ZodUndefined:()=>QL,ZodUnion:()=>hg,ZodUnknown:()=>rz,ZodVoid:()=>iz,ZodXID:()=>jk,ZodXor:()=>sz,_ZodString:()=>Ok,_default:()=>vz,_function:()=>rse,any:()=>Moe,array:()=>ke,base64:()=>voe,base64url:()=>Soe,bigint:()=>Poe,boolean:()=>It,catch:()=>Ez,check:()=>nse,cidrv4:()=>_oe,cidrv6:()=>boe,codec:()=>Xoe,cuid:()=>uoe,cuid2:()=>doe,custom:()=>Jk,date:()=>Loe,describe:()=>ise,discriminatedUnion:()=>gg,e164:()=>woe,email:()=>eoe,emoji:()=>coe,enum:()=>sr,exactOptional:()=>yz,file:()=>Woe,float32:()=>Toe,float64:()=>Ooe,function:()=>rse,guid:()=>toe,hash:()=>Aoe,hex:()=>Eoe,hostname:()=>koe,httpUrl:()=>aoe,instanceof:()=>sse,int:()=>Ak,int32:()=>Roe,int64:()=>Coe,intersection:()=>Od,invertCodec:()=>Qoe,ipv4:()=>hoe,ipv6:()=>yoe,json:()=>cse,jwt:()=>xoe,keyof:()=>zoe,ksuid:()=>moe,lazy:()=>Cz,literal:()=>ne,looseObject:()=>or,looseRecord:()=>Hoe,mac:()=>goe,map:()=>Goe,meta:()=>ose,nan:()=>Yoe,nanoid:()=>loe,nativeEnum:()=>Voe,never:()=>Vk,nonoptional:()=>xz,null:()=>fg,nullable:()=>lg,nullish:()=>Koe,number:()=>Me,object:()=>W,optional:()=>at,partialRecord:()=>Boe,pipe:()=>Tk,prefault:()=>wz,preprocess:()=>vg,promise:()=>tse,readonly:()=>Rz,record:()=>Je,refine:()=>jz,set:()=>Zoe,strictObject:()=>Uoe,string:()=>I,stringFormat:()=>$oe,stringbool:()=>ase,success:()=>Joe,superRefine:()=>Mz,symbol:()=>Noe,templateLiteral:()=>ese,transform:()=>Wk,tuple:()=>uz,uint32:()=>Ioe,uint64:()=>Doe,ulid:()=>foe,undefined:()=>joe,union:()=>rt,unknown:()=>tt,url:()=>soe,uuid:()=>roe,uuidv4:()=>noe,uuidv6:()=>ioe,uuidv7:()=>ooe,void:()=>Foe,xid:()=>poe,xor:()=>qoe});function ug(t,e,r){let n=Object.getPrototypeOf(t),i=Qie.get(n);if(i||(i=new Set,Qie.set(n,i)),!i.has(e)){i.add(e);for(let o in r){let s=r[o];Object.defineProperty(n,o,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}function I(t){return N$($d,t)}function eoe(t){return Mh(Rk,t)}function toe(t){return od(cg,t)}function roe(t){return Fh(ro,t)}function noe(t){return Lh(ro,t)}function ioe(t){return zh(ro,t)}function ooe(t){return Uh(ro,t)}function soe(t){return sd(dg,t)}function aoe(t){return sd(dg,{protocol:Zr.httpProtocol,hostname:Zr.domain,...M.normalizeParams(t)})}function coe(t){return qh(Ik,t)}function loe(t){return Bh(Pk,t)}function uoe(t){return Hh(Ck,t)}function doe(t){return Gh(Dk,t)}function foe(t){return Zh(Nk,t)}function poe(t){return Vh(jk,t)}function moe(t){return Wh(Mk,t)}function hoe(t){return Kh(Fk,t)}function goe(t){return j$(YL,t)}function yoe(t){return Jh(Lk,t)}function _oe(t){return Yh(zk,t)}function boe(t){return Xh(Uk,t)}function voe(t){return Qh(qk,t)}function Soe(t){return eg(Bk,t)}function woe(t){return tg(Hk,t)}function xoe(t){return rg(Gk,t)}function $oe(t,e,r={}){return Dc(kd,t,e,r)}function koe(t){return Dc(kd,"hostname",Zr.hostname,t)}function Eoe(t){return Dc(kd,"hex",Zr.hex,t)}function Aoe(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Zr[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Dc(kd,n,i,e)}function Me(t){return M$(Ed,t)}function Ak(t){return F$(Mc,t)}function Toe(t){return L$(Mc,t)}function Ooe(t){return z$(Mc,t)}function Roe(t){return U$(Mc,t)}function Ioe(t){return q$(Mc,t)}function It(t){return B$(Ad,t)}function Poe(t){return H$(Td,t)}function Coe(t){return G$(Zk,t)}function Doe(t){return Z$(Zk,t)}function Noe(t){return V$(XL,t)}function joe(t){return W$(QL,t)}function fg(t){return K$(ez,t)}function Moe(){return J$(tz)}function tt(){return Y$(rz)}function Vk(t){return X$(nz,t)}function Foe(t){return Q$(iz,t)}function Loe(t){return ek(pg,t)}function ke(t,e){return GF(oz,t,e)}function zoe(t){let e=t._zod.def.shape;return sr(Object.keys(e))}function W(t,e){let r={type:"object",shape:t??{},...M.normalizeParams(e)};return new mg(r)}function Uoe(t,e){return new mg({type:"object",shape:t,catchall:Vk(),...M.normalizeParams(e)})}function or(t,e){return new mg({type:"object",shape:t,catchall:tt(),...M.normalizeParams(e)})}function rt(t,e){return new hg({type:"union",options:t,...M.normalizeParams(e)})}function qoe(t,e){return new sz({type:"union",options:t,inclusive:!1,...M.normalizeParams(e)})}function gg(t,e,r){return new az({type:"union",options:e,discriminator:t,...M.normalizeParams(r)})}function Od(t,e){return new cz({type:"intersection",left:t,right:e})}function uz(t,e,r){let n=e instanceof ue,i=n?r:e,o=n?e:null;return new lz({type:"tuple",items:t,rest:o,...M.normalizeParams(i)})}function Je(t,e,r){return!e||!e._zod?new wd({type:"record",keyType:I(),valueType:t,...M.normalizeParams(e)}):new wd({type:"record",keyType:t,valueType:e,...M.normalizeParams(r)})}function Boe(t,e,r){let n=nr(t);return n._zod.values=void 0,new wd({type:"record",keyType:n,valueType:e,...M.normalizeParams(r)})}function Hoe(t,e,r){return new wd({type:"record",keyType:t,valueType:e,mode:"loose",...M.normalizeParams(r)})}function Goe(t,e,r){return new dz({type:"map",keyType:t,valueType:e,...M.normalizeParams(r)})}function Zoe(t,e){return new fz({type:"set",valueType:t,...M.normalizeParams(e)})}function sr(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new xd({type:"enum",entries:r,...M.normalizeParams(e)})}function Voe(t,e){return new xd({type:"enum",entries:t,...M.normalizeParams(e)})}function ne(t,e){return new pz({type:"literal",values:Array.isArray(t)?t:[t],...M.normalizeParams(e)})}function Woe(t){return ak(mz,t)}function Wk(t){return new hz({type:"transform",transform:t})}function at(t){return new Rd({type:"optional",innerType:t})}function yz(t){return new gz({type:"optional",innerType:t})}function lg(t){return new _z({type:"nullable",innerType:t})}function Koe(t){return at(lg(t))}function vz(t,e){return new bz({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():M.shallowClone(e)}})}function wz(t,e){return new Sz({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():M.shallowClone(e)}})}function xz(t,e){return new Kk({type:"nonoptional",innerType:t,...M.normalizeParams(e)})}function Joe(t){return new $z({type:"success",innerType:t})}function Ez(t,e){return new kz({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function Yoe(t){return tk(Az,t)}function Tk(t,e){return new yg({type:"pipe",in:t,out:e})}function Xoe(t,e,r){return new _g({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function Qoe(t){let e=t._zod.def;return new _g({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function Rz(t){return new Oz({type:"readonly",innerType:t})}function ese(t,e){return new Iz({type:"template_literal",parts:t,...M.normalizeParams(e)})}function Cz(t){return new Pz({type:"lazy",getter:t})}function tse(t){return new Dz({type:"promise",innerType:t})}function rse(t){return new Nz({type:"function",input:Array.isArray(t?.input)?uz(t?.input):t?.input??ke(tt()),output:t?.output??tt()})}function nse(t){let e=new Qe({check:"custom"});return e._zod.check=t,e}function Jk(t,e){return ck(bg,t??(()=>!0),e)}function jz(t,e={}){return lk(bg,t,e)}function Mz(t,e){return uk(t,e)}function sse(t,e={}){let r=new bg({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...M.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}function cse(t){let e=Cz(()=>rt([I(t),Me(),It(),fg(),ke(e),Je(I(),e)]));return e}function vg(t,e){return new Tz({type:"pipe",in:Wk(t),out:e})}var Qie,_e,Ok,$d,et,Rk,cg,ro,dg,Ik,Pk,Ck,Dk,Nk,jk,Mk,Fk,YL,Lk,zk,Uk,qk,Bk,Hk,Gk,kd,Ed,Mc,Ad,Td,Zk,XL,QL,ez,tz,rz,nz,iz,pg,oz,mg,hg,sz,az,cz,lz,wd,dz,fz,xd,pz,mz,hz,Rd,gz,_z,bz,Sz,Kk,$z,kz,Az,yg,_g,Tz,Oz,Iz,Pz,Dz,Nz,bg,ise,ose,ase,ag=y(()=>{hr();hr();vd();ng();wk();og();JL();Qie=new WeakMap;_e=k("ZodType",(t,e)=>(ue.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:bd(t,"input"),output:bd(t,"output")}}),t.toJSONSchema=ZF(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>FL(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>zL(t,r,n),t.parseAsync=async(r,n)=>LL(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>UL(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>qL(t,r,n),t.decode=(r,n)=>BL(t,r,n),t.encodeAsync=async(r,n)=>HL(t,r,n),t.decodeAsync=async(r,n)=>GL(t,r,n),t.safeEncode=(r,n)=>ZL(t,r,n),t.safeDecode=(r,n)=>VL(t,r,n),t.safeEncodeAsync=async(r,n)=>WL(t,r,n),t.safeDecodeAsync=async(r,n)=>KL(t,r,n),ug(t,"ZodType",{check(...r){let n=this.def;return this.clone(M.mergeDefs(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return nr(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(jz(r,n))},superRefine(r,n){return this.check(Mz(r,n))},overwrite(r){return this.check(hi(r))},optional(){return at(this)},exactOptional(){return yz(this)},nullable(){return lg(this)},nullish(){return at(lg(this))},nonoptional(r){return xz(this,r)},array(){return ke(this)},or(r){return rt([this,r])},and(r){return Od(this,r)},transform(r){return Tk(this,Wk(r))},default(r){return vz(this,r)},prefault(r){return wz(this,r)},catch(r){return Ez(this,r)},pipe(r){return Tk(this,r)},readonly(){return Rz(this)},describe(r){let n=this.clone();return ir.add(n,{description:r}),n},meta(...r){if(r.length===0)return ir.get(this);let n=this.clone();return ir.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return ir.get(t)?.description},configurable:!0}),t)),Ok=k("_ZodString",(t,e)=>{Us.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>VF(t,n,i,o);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,ug(t,"_ZodString",{regex(...n){return this.check(ad(...n))},includes(...n){return this.check(ud(...n))},startsWith(...n){return this.check(dd(...n))},endsWith(...n){return this.check(fd(...n))},min(...n){return this.check(Uo(...n))},max(...n){return this.check(Pc(...n))},length(...n){return this.check(Cc(...n))},nonempty(...n){return this.check(Uo(1,...n))},lowercase(n){return this.check(cd(n))},uppercase(n){return this.check(ld(n))},trim(){return this.check(hd())},normalize(...n){return this.check(md(...n))},toLowerCase(){return this.check(gd())},toUpperCase(){return this.check(yd())},slugify(){return this.check(_d())}})}),$d=k("ZodString",(t,e)=>{Us.init(t,e),Ok.init(t,e),t.email=r=>t.check(Mh(Rk,r)),t.url=r=>t.check(sd(dg,r)),t.jwt=r=>t.check(rg(Gk,r)),t.emoji=r=>t.check(qh(Ik,r)),t.guid=r=>t.check(od(cg,r)),t.uuid=r=>t.check(Fh(ro,r)),t.uuidv4=r=>t.check(Lh(ro,r)),t.uuidv6=r=>t.check(zh(ro,r)),t.uuidv7=r=>t.check(Uh(ro,r)),t.nanoid=r=>t.check(Bh(Pk,r)),t.guid=r=>t.check(od(cg,r)),t.cuid=r=>t.check(Hh(Ck,r)),t.cuid2=r=>t.check(Gh(Dk,r)),t.ulid=r=>t.check(Zh(Nk,r)),t.base64=r=>t.check(Qh(qk,r)),t.base64url=r=>t.check(eg(Bk,r)),t.xid=r=>t.check(Vh(jk,r)),t.ksuid=r=>t.check(Wh(Mk,r)),t.ipv4=r=>t.check(Kh(Fk,r)),t.ipv6=r=>t.check(Jh(Lk,r)),t.cidrv4=r=>t.check(Yh(zk,r)),t.cidrv6=r=>t.check(Xh(Uk,r)),t.e164=r=>t.check(tg(Hk,r)),t.datetime=r=>t.check(CL(r)),t.date=r=>t.check(DL(r)),t.time=r=>t.check(NL(r)),t.duration=r=>t.check(jL(r))});et=k("ZodStringFormat",(t,e)=>{Ke.init(t,e),Ok.init(t,e)}),Rk=k("ZodEmail",(t,e)=>{T0.init(t,e),et.init(t,e)});cg=k("ZodGUID",(t,e)=>{E0.init(t,e),et.init(t,e)});ro=k("ZodUUID",(t,e)=>{A0.init(t,e),et.init(t,e)});dg=k("ZodURL",(t,e)=>{O0.init(t,e),et.init(t,e)});Ik=k("ZodEmoji",(t,e)=>{R0.init(t,e),et.init(t,e)});Pk=k("ZodNanoID",(t,e)=>{I0.init(t,e),et.init(t,e)});Ck=k("ZodCUID",(t,e)=>{P0.init(t,e),et.init(t,e)});Dk=k("ZodCUID2",(t,e)=>{C0.init(t,e),et.init(t,e)});Nk=k("ZodULID",(t,e)=>{D0.init(t,e),et.init(t,e)});jk=k("ZodXID",(t,e)=>{N0.init(t,e),et.init(t,e)});Mk=k("ZodKSUID",(t,e)=>{j0.init(t,e),et.init(t,e)});Fk=k("ZodIPv4",(t,e)=>{M0.init(t,e),et.init(t,e)});YL=k("ZodMAC",(t,e)=>{L0.init(t,e),et.init(t,e)});Lk=k("ZodIPv6",(t,e)=>{F0.init(t,e),et.init(t,e)});zk=k("ZodCIDRv4",(t,e)=>{z0.init(t,e),et.init(t,e)});Uk=k("ZodCIDRv6",(t,e)=>{U0.init(t,e),et.init(t,e)});qk=k("ZodBase64",(t,e)=>{q0.init(t,e),et.init(t,e)});Bk=k("ZodBase64URL",(t,e)=>{B0.init(t,e),et.init(t,e)});Hk=k("ZodE164",(t,e)=>{H0.init(t,e),et.init(t,e)});Gk=k("ZodJWT",(t,e)=>{G0.init(t,e),et.init(t,e)});kd=k("ZodCustomStringFormat",(t,e)=>{Z0.init(t,e),et.init(t,e)});Ed=k("ZodNumber",(t,e)=>{Rh.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>WF(t,n,i,o),ug(t,"ZodNumber",{gt(n,i){return this.check(eo(n,i))},gte(n,i){return this.check(Er(n,i))},min(n,i){return this.check(Er(n,i))},lt(n,i){return this.check(Qi(n,i))},lte(n,i){return this.check(wn(n,i))},max(n,i){return this.check(wn(n,i))},int(n){return this.check(Ak(n))},safe(n){return this.check(Ak(n))},positive(n){return this.check(eo(0,n))},nonnegative(n){return this.check(Er(0,n))},negative(n){return this.check(Qi(0,n))},nonpositive(n){return this.check(wn(0,n))},multipleOf(n,i){return this.check(qs(n,i))},step(n,i){return this.check(qs(n,i))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});Mc=k("ZodNumberFormat",(t,e)=>{V0.init(t,e),Ed.init(t,e)});Ad=k("ZodBoolean",(t,e)=>{ed.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KF(t,r,n,i)});Td=k("ZodBigInt",(t,e)=>{Ih.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>JF(t,n,i,o),t.gte=(n,i)=>t.check(Er(n,i)),t.min=(n,i)=>t.check(Er(n,i)),t.gt=(n,i)=>t.check(eo(n,i)),t.gte=(n,i)=>t.check(Er(n,i)),t.min=(n,i)=>t.check(Er(n,i)),t.lt=(n,i)=>t.check(Qi(n,i)),t.lte=(n,i)=>t.check(wn(n,i)),t.max=(n,i)=>t.check(wn(n,i)),t.positive=n=>t.check(eo(BigInt(0),n)),t.negative=n=>t.check(Qi(BigInt(0),n)),t.nonpositive=n=>t.check(wn(BigInt(0),n)),t.nonnegative=n=>t.check(Er(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(qs(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});Zk=k("ZodBigIntFormat",(t,e)=>{W0.init(t,e),Td.init(t,e)});XL=k("ZodSymbol",(t,e)=>{K0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>YF(t,r,n,i)});QL=k("ZodUndefined",(t,e)=>{J0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>QF(t,r,n,i)});ez=k("ZodNull",(t,e)=>{Y0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>XF(t,r,n,i)});tz=k("ZodAny",(t,e)=>{X0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>rL(t,r,n,i)});rz=k("ZodUnknown",(t,e)=>{Q0.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nL(t,r,n,i)});nz=k("ZodNever",(t,e)=>{e$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tL(t,r,n,i)});iz=k("ZodVoid",(t,e)=>{t$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>eL(t,r,n,i)});pg=k("ZodDate",(t,e)=>{r$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>iL(t,n,i,o),t.min=(n,i)=>t.check(Er(n,i)),t.max=(n,i)=>t.check(wn(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});oz=k("ZodArray",(t,e)=>{n$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gL(t,r,n,i),t.element=e.element,ug(t,"ZodArray",{min(r,n){return this.check(Uo(r,n))},nonempty(r){return this.check(Uo(1,r))},max(r,n){return this.check(Pc(r,n))},length(r,n){return this.check(Cc(r,n))},unwrap(){return this.element}})});mg=k("ZodObject",(t,e)=>{AF.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yL(t,r,n,i),M.defineLazy(t,"shape",()=>e.shape),ug(t,"ZodObject",{keyof(){return sr(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:tt()})},loose(){return this.clone({...this._zod.def,catchall:tt()})},strict(){return this.clone({...this._zod.def,catchall:Vk()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return M.extend(this,r)},safeExtend(r){return M.safeExtend(this,r)},merge(r){return M.merge(this,r)},pick(r){return M.pick(this,r)},omit(r){return M.omit(this,r)},partial(...r){return M.partial(Rd,this,r[0])},required(...r){return M.required(Kk,this,r[0])}})});hg=k("ZodUnion",(t,e)=>{td.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hk(t,r,n,i),t.options=e.options});sz=k("ZodXor",(t,e)=>{hg.init(t,e),o$.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hk(t,r,n,i),t.options=e.options});az=k("ZodDiscriminatedUnion",(t,e)=>{hg.init(t,e),s$.init(t,e)});cz=k("ZodIntersection",(t,e)=>{a$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_L(t,r,n,i)});lz=k("ZodTuple",(t,e)=>{Ph.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bL(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});wd=k("ZodRecord",(t,e)=>{c$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vL(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});dz=k("ZodMap",(t,e)=>{l$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mL(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(to(...r)),t.nonempty=r=>t.check(to(1,r)),t.max=(...r)=>t.check(Bs(...r)),t.size=(...r)=>t.check(Ic(...r))});fz=k("ZodSet",(t,e)=>{u$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hL(t,r,n,i),t.min=(...r)=>t.check(to(...r)),t.nonempty=r=>t.check(to(1,r)),t.max=(...r)=>t.check(Bs(...r)),t.size=(...r)=>t.check(Ic(...r))});xd=k("ZodEnum",(t,e)=>{d$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,i,o)=>oL(t,n,i,o),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let o={};for(let s of n)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new xd({...e,checks:[],...M.normalizeParams(i),entries:o})},t.exclude=(n,i)=>{let o={...e.entries};for(let s of n)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new xd({...e,checks:[],...M.normalizeParams(i),entries:o})}});pz=k("ZodLiteral",(t,e)=>{f$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sL(t,r,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});mz=k("ZodFile",(t,e)=>{p$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lL(t,r,n,i),t.min=(r,n)=>t.check(to(r,n)),t.max=(r,n)=>t.check(Bs(r,n)),t.mime=(r,n)=>t.check(pd(Array.isArray(r)?r:[r],n))});hz=k("ZodTransform",(t,e)=>{m$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pL(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(M.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),r.issues.push(M.issue(s))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(o=>(r.value=o,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});Rd=k("ZodOptional",(t,e)=>{Ch.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});gz=k("ZodExactOptional",(t,e)=>{h$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});_z=k("ZodNullable",(t,e)=>{g$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>SL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});bz=k("ZodDefault",(t,e)=>{y$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});Sz=k("ZodPrefault",(t,e)=>{_$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$L(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});Kk=k("ZodNonOptional",(t,e)=>{b$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});$z=k("ZodSuccess",(t,e)=>{v$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});kz=k("ZodCatch",(t,e)=>{S$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});Az=k("ZodNaN",(t,e)=>{w$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>aL(t,r,n,i)});yg=k("ZodPipe",(t,e)=>{Dh.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>EL(t,r,n,i),t.in=e.in,t.out=e.out});_g=k("ZodCodec",(t,e)=>{yg.init(t,e),rd.init(t,e)});Tz=k("ZodPreprocess",(t,e)=>{yg.init(t,e),TF.init(t,e)}),Oz=k("ZodReadonly",(t,e)=>{x$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>AL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});Iz=k("ZodTemplateLiteral",(t,e)=>{$$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cL(t,r,n,i)});Pz=k("ZodLazy",(t,e)=>{A$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OL(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});Dz=k("ZodPromise",(t,e)=>{E$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>TL(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});Nz=k("ZodFunction",(t,e)=>{k$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fL(t,r,n,i)});bg=k("ZodCustom",(t,e)=>{T$.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dL(t,r,n,i)});ise=dk,ose=fk;ase=(...t)=>pk({Codec:_g,Boolean:Ad,String:$d},...t)});function wHe(t){Tt({customError:t})}function xHe(){return Tt().customError}var SHe,Fz,lse=y(()=>{hr();SHe={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};Fz||(Fz={})});function kHe(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function EHe(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${t}`);return e.defs[i]}throw new Error(`Reference not found: ${t}`)}function use(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return V.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let i=t.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return V.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let o=EHe(i,e),s=gr(o,e);return e.refs.set(i,s),e.processing.delete(i),s}if(t.enum!==void 0){let i=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&i.length===1&&i[0]===null)return V.null();if(i.length===0)return V.never();if(i.length===1)return V.literal(i[0]);if(i.every(s=>typeof s=="string"))return V.enum(i);let o=i.map(s=>V.literal(s));return o.length<2?o[0]:V.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return V.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(o=>{let s={...t,type:o};return use(s,e)});return i.length===0?V.never():i.length===1?i[0]:V.union(i)}if(!r)return V.any();let n;switch(r){case"string":{let i=V.string();if(t.format){let o=t.format;o==="email"?i=i.check(V.email()):o==="uri"||o==="uri-reference"?i=i.check(V.url()):o==="uuid"||o==="guid"?i=i.check(V.uuid()):o==="date-time"?i=i.check(V.iso.datetime()):o==="date"?i=i.check(V.iso.date()):o==="time"?i=i.check(V.iso.time()):o==="duration"?i=i.check(V.iso.duration()):o==="ipv4"?i=i.check(V.ipv4()):o==="ipv6"?i=i.check(V.ipv6()):o==="mac"?i=i.check(V.mac()):o==="cidr"?i=i.check(V.cidrv4()):o==="cidr-v6"?i=i.check(V.cidrv6()):o==="base64"?i=i.check(V.base64()):o==="base64url"?i=i.check(V.base64url()):o==="e164"?i=i.check(V.e164()):o==="jwt"?i=i.check(V.jwt()):o==="emoji"?i=i.check(V.emoji()):o==="nanoid"?i=i.check(V.nanoid()):o==="cuid"?i=i.check(V.cuid()):o==="cuid2"?i=i.check(V.cuid2()):o==="ulid"?i=i.check(V.ulid()):o==="xid"?i=i.check(V.xid()):o==="ksuid"&&(i=i.check(V.ksuid()))}typeof t.minLength=="number"&&(i=i.min(t.minLength)),typeof t.maxLength=="number"&&(i=i.max(t.maxLength)),t.pattern&&(i=i.regex(new RegExp(t.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?V.number().int():V.number();typeof t.minimum=="number"&&(i=i.min(t.minimum)),typeof t.maximum=="number"&&(i=i.max(t.maximum)),typeof t.exclusiveMinimum=="number"?i=i.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(i=i.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?i=i.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(i=i.lt(t.maximum)),typeof t.multipleOf=="number"&&(i=i.multipleOf(t.multipleOf)),n=i;break}case"boolean":{n=V.boolean();break}case"null":{n=V.null();break}case"object":{let i={},o=t.properties||{},s=new Set(t.required||[]);for(let[c,l]of Object.entries(o)){let u=gr(l,e);i[c]=s.has(c)?u:u.optional()}if(t.propertyNames){let c=gr(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?gr(t.additionalProperties,e):V.any();if(Object.keys(i).length===0){n=V.record(c,l);break}let u=V.object(i).passthrough(),d=V.looseRecord(c,l);n=V.intersection(u,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),u=[];for(let f of l){let p=gr(c[f],e),m=V.string().regex(new RegExp(f));u.push(V.looseRecord(m,p))}let d=[];if(Object.keys(i).length>0&&d.push(V.object(i).passthrough()),d.push(...u),d.length===0)n=V.object({}).passthrough();else if(d.length===1)n=d[0];else{let f=V.intersection(d[0],d[1]);for(let p=2;pgr(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?gr(o,e):void 0;a?n=V.tuple(s).rest(a):n=V.tuple(s),typeof t.minItems=="number"&&(n=n.check(V.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(V.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>gr(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?gr(t.additionalItems,e):void 0;a?n=V.tuple(s).rest(a):n=V.tuple(s),typeof t.minItems=="number"&&(n=n.check(V.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(V.maxLength(t.maxItems)))}else if(o!==void 0){let s=gr(o,e),a=V.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),n=a}else n=V.array(V.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function gr(t,e){if(typeof t=="boolean")return t?V.any():V.never();let r=use(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(l=>gr(l,e)),c=V.union(a);r=n?V.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(l=>gr(l,e)),c=V.xor(a);r=n?V.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:V.any();else{let a=n?r:gr(t.allOf[0],e),c=n?0:1;for(let l=c;l0&&e.registry.add(r,i),t.description&&(r=r.describe(t.description)),r}function dse(t,e){if(typeof t=="boolean")return t?V.any():V.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=kHe(r,e?.defaultTarget),i=r.$defs||r.definitions||{},o={version:n,defs:i,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??ir};return gr(r,o)}var V,$He,fse=y(()=>{jh();wk();og();ag();V={...sg,...Sk,iso:Ks},$He=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var Lz={};Pr(Lz,{bigint:()=>RHe,boolean:()=>OHe,date:()=>IHe,number:()=>THe,string:()=>AHe});function AHe(t){return NF($d,t)}function THe(t){return UF(Ed,t)}function OHe(t){return qF(Ad,t)}function RHe(t){return BF(Td,t)}function IHe(t){return HF(pg,t)}var pse=y(()=>{hr();ag()});var E={};Pr(E,{$brand:()=>uM,$input:()=>DF,$output:()=>CF,NEVER:()=>lM,TimePrecision:()=>jF,ZodAny:()=>tz,ZodArray:()=>oz,ZodBase64:()=>qk,ZodBase64URL:()=>Bk,ZodBigInt:()=>Td,ZodBigIntFormat:()=>Zk,ZodBoolean:()=>Ad,ZodCIDRv4:()=>zk,ZodCIDRv6:()=>Uk,ZodCUID:()=>Ck,ZodCUID2:()=>Dk,ZodCatch:()=>kz,ZodCodec:()=>_g,ZodCustom:()=>bg,ZodCustomStringFormat:()=>kd,ZodDate:()=>pg,ZodDefault:()=>bz,ZodDiscriminatedUnion:()=>az,ZodE164:()=>Hk,ZodEmail:()=>Rk,ZodEmoji:()=>Ik,ZodEnum:()=>xd,ZodError:()=>bHe,ZodExactOptional:()=>gz,ZodFile:()=>mz,ZodFirstPartyTypeKind:()=>Fz,ZodFunction:()=>Nz,ZodGUID:()=>cg,ZodIPv4:()=>Fk,ZodIPv6:()=>Lk,ZodISODate:()=>$k,ZodISODateTime:()=>xk,ZodISODuration:()=>Ek,ZodISOTime:()=>kk,ZodIntersection:()=>cz,ZodIssueCode:()=>SHe,ZodJWT:()=>Gk,ZodKSUID:()=>Mk,ZodLazy:()=>Pz,ZodLiteral:()=>pz,ZodMAC:()=>YL,ZodMap:()=>dz,ZodNaN:()=>Az,ZodNanoID:()=>Pk,ZodNever:()=>nz,ZodNonOptional:()=>Kk,ZodNull:()=>ez,ZodNullable:()=>_z,ZodNumber:()=>Ed,ZodNumberFormat:()=>Mc,ZodObject:()=>mg,ZodOptional:()=>Rd,ZodPipe:()=>yg,ZodPrefault:()=>Sz,ZodPreprocess:()=>Tz,ZodPromise:()=>Dz,ZodReadonly:()=>Oz,ZodRealError:()=>Vr,ZodRecord:()=>wd,ZodSet:()=>fz,ZodString:()=>$d,ZodStringFormat:()=>et,ZodSuccess:()=>$z,ZodSymbol:()=>XL,ZodTemplateLiteral:()=>Iz,ZodTransform:()=>hz,ZodTuple:()=>lz,ZodType:()=>_e,ZodULID:()=>Nk,ZodURL:()=>dg,ZodUUID:()=>ro,ZodUndefined:()=>QL,ZodUnion:()=>hg,ZodUnknown:()=>rz,ZodVoid:()=>iz,ZodXID:()=>jk,ZodXor:()=>sz,_ZodString:()=>Ok,_default:()=>vz,_function:()=>rse,any:()=>Moe,array:()=>ke,base64:()=>voe,base64url:()=>Soe,bigint:()=>Poe,boolean:()=>It,catch:()=>Ez,check:()=>nse,cidrv4:()=>_oe,cidrv6:()=>boe,clone:()=>nr,codec:()=>Xoe,coerce:()=>Lz,config:()=>Tt,core:()=>gi,cuid:()=>uoe,cuid2:()=>doe,custom:()=>Jk,date:()=>Loe,decode:()=>BL,decodeAsync:()=>GL,describe:()=>ise,discriminatedUnion:()=>gg,e164:()=>woe,email:()=>eoe,emoji:()=>coe,encode:()=>qL,encodeAsync:()=>HL,endsWith:()=>fd,enum:()=>sr,exactOptional:()=>yz,file:()=>Woe,flattenError:()=>kh,float32:()=>Toe,float64:()=>Ooe,formatError:()=>Eh,fromJSONSchema:()=>dse,function:()=>rse,getErrorMap:()=>xHe,globalRegistry:()=>ir,gt:()=>eo,gte:()=>Er,guid:()=>toe,hash:()=>Aoe,hex:()=>Eoe,hostname:()=>koe,httpUrl:()=>aoe,includes:()=>ud,instanceof:()=>sse,int:()=>Ak,int32:()=>Roe,int64:()=>Coe,intersection:()=>Od,invertCodec:()=>Qoe,ipv4:()=>hoe,ipv6:()=>yoe,iso:()=>Ks,json:()=>cse,jwt:()=>xoe,keyof:()=>zoe,ksuid:()=>moe,lazy:()=>Cz,length:()=>Cc,literal:()=>ne,locales:()=>id,looseObject:()=>or,looseRecord:()=>Hoe,lowercase:()=>cd,lt:()=>Qi,lte:()=>wn,mac:()=>goe,map:()=>Goe,maxLength:()=>Pc,maxSize:()=>Bs,meta:()=>ose,mime:()=>pd,minLength:()=>Uo,minSize:()=>to,multipleOf:()=>qs,nan:()=>Yoe,nanoid:()=>loe,nativeEnum:()=>Voe,negative:()=>nk,never:()=>Vk,nonnegative:()=>ok,nonoptional:()=>xz,nonpositive:()=>ik,normalize:()=>md,null:()=>fg,nullable:()=>lg,nullish:()=>Koe,number:()=>Me,object:()=>W,optional:()=>at,overwrite:()=>hi,parse:()=>FL,parseAsync:()=>LL,partialRecord:()=>Boe,pipe:()=>Tk,positive:()=>rk,prefault:()=>wz,preprocess:()=>vg,prettifyError:()=>wM,promise:()=>tse,property:()=>sk,readonly:()=>Rz,record:()=>Je,refine:()=>jz,regex:()=>ad,regexes:()=>Zr,registry:()=>D$,safeDecode:()=>VL,safeDecodeAsync:()=>KL,safeEncode:()=>ZL,safeEncodeAsync:()=>WL,safeParse:()=>zL,safeParseAsync:()=>UL,set:()=>Zoe,setErrorMap:()=>wHe,size:()=>Ic,slugify:()=>_d,startsWith:()=>dd,strictObject:()=>Uoe,string:()=>I,stringFormat:()=>$oe,stringbool:()=>ase,success:()=>Joe,superRefine:()=>Mz,symbol:()=>Noe,templateLiteral:()=>ese,toJSONSchema:()=>Nc,toLowerCase:()=>gd,toUpperCase:()=>yd,transform:()=>Wk,treeifyError:()=>SM,trim:()=>hd,tuple:()=>uz,uint32:()=>Ioe,uint64:()=>Doe,ulid:()=>foe,undefined:()=>joe,union:()=>rt,unknown:()=>tt,uppercase:()=>ld,url:()=>soe,util:()=>M,uuid:()=>roe,uuidv4:()=>noe,uuidv6:()=>ioe,uuidv7:()=>ooe,void:()=>Foe,xid:()=>poe,xor:()=>qoe});var Yk=y(()=>{hr();ag();wk();ML();JL();lse();hr();RF();hr();vd();fse();P$();og();og();pse();Tt(O$())});var mse=y(()=>{Yk()});var hse=y(()=>{mse()});function Pse(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function Cse(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var Uz,gse,Js,Qk,Wt,yse,_se,BEt,CHe,DHe,qz,xn,Sg,bse,ar,Un,qn,cr,eE,vse,Bz,Sse,wse,Hz,wg,ae,Gz,xse,$se,HEt,tE,NHe,rE,jHe,xg,Id,kse,MHe,FHe,LHe,zHe,UHe,qHe,Zz,BHe,HHe,Vz,nE,GHe,ZHe,iE,VHe,$g,kg,WHe,Eg,Pd,KHe,Ag,oE,sE,aE,GEt,cE,lE,uE,Ese,Ase,Tse,Wz,Ose,Tg,Cd,Rse,JHe,dE,YHe,fE,XHe,Kz,QHe,pE,eGe,tGe,rGe,Jz,nGe,Yz,iGe,oGe,sGe,aGe,mE,cGe,lGe,hE,Xz,Qz,e2,uGe,dGe,fGe,t2,pGe,mGe,hGe,gGe,yGe,Ise,gE,_Ge,yE,ZEt,bGe,Dd,vGe,VEt,Og,SGe,r2,wGe,xGe,$Ge,kGe,EGe,AGe,TGe,Xk,OGe,RGe,IGe,Rg,n2,PGe,CGe,DGe,NGe,jGe,MGe,FGe,LGe,zGe,UGe,qGe,BGe,HGe,GGe,ZGe,VGe,WGe,KGe,Nd,JGe,YGe,XGe,_E,QGe,eZe,tZe,i2,rZe,WEt,KEt,JEt,YEt,XEt,QEt,ie,zz,Fc=y(()=>{hse();Uz="2025-11-25",gse=[Uz,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Js="io.modelcontextprotocol/related-task",Qk="2.0",Wt=Jk(t=>t!==null&&(typeof t=="object"||typeof t=="function")),yse=rt([I(),Me().int()]),_se=I(),BEt=or({ttl:Me().optional(),pollInterval:Me().optional()}),CHe=W({ttl:Me().optional()}),DHe=W({taskId:I()}),qz=or({progressToken:yse.optional(),[Js]:DHe.optional()}),xn=W({_meta:qz.optional()}),Sg=xn.extend({task:CHe.optional()}),bse=t=>Sg.safeParse(t).success,ar=W({method:I(),params:xn.loose().optional()}),Un=W({_meta:qz.optional()}),qn=W({method:I(),params:Un.loose().optional()}),cr=or({_meta:qz.optional()}),eE=rt([I(),Me().int()]),vse=W({jsonrpc:ne(Qk),id:eE,...ar.shape}).strict(),Bz=t=>vse.safeParse(t).success,Sse=W({jsonrpc:ne(Qk),...qn.shape}).strict(),wse=t=>Sse.safeParse(t).success,Hz=W({jsonrpc:ne(Qk),id:eE,result:cr}).strict(),wg=t=>Hz.safeParse(t).success;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ae||(ae={}));Gz=W({jsonrpc:ne(Qk),id:eE.optional(),error:W({code:Me().int(),message:I(),data:tt().optional()})}).strict(),xse=t=>Gz.safeParse(t).success,$se=rt([vse,Sse,Hz,Gz]),HEt=rt([Hz,Gz]),tE=cr.strict(),NHe=Un.extend({requestId:eE.optional(),reason:I().optional()}),rE=qn.extend({method:ne("notifications/cancelled"),params:NHe}),jHe=W({src:I(),mimeType:I().optional(),sizes:ke(I()).optional(),theme:sr(["light","dark"]).optional()}),xg=W({icons:ke(jHe).optional()}),Id=W({name:I(),title:I().optional()}),kse=Id.extend({...Id.shape,...xg.shape,version:I(),websiteUrl:I().optional(),description:I().optional()}),MHe=Od(W({applyDefaults:It().optional()}),Je(I(),tt())),FHe=vg(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Od(W({form:MHe.optional(),url:Wt.optional()}),Je(I(),tt()).optional())),LHe=or({list:Wt.optional(),cancel:Wt.optional(),requests:or({sampling:or({createMessage:Wt.optional()}).optional(),elicitation:or({create:Wt.optional()}).optional()}).optional()}),zHe=or({list:Wt.optional(),cancel:Wt.optional(),requests:or({tools:or({call:Wt.optional()}).optional()}).optional()}),UHe=W({experimental:Je(I(),Wt).optional(),sampling:W({context:Wt.optional(),tools:Wt.optional()}).optional(),elicitation:FHe.optional(),roots:W({listChanged:It().optional()}).optional(),tasks:LHe.optional(),extensions:Je(I(),Wt).optional()}),qHe=xn.extend({protocolVersion:I(),capabilities:UHe,clientInfo:kse}),Zz=ar.extend({method:ne("initialize"),params:qHe}),BHe=W({experimental:Je(I(),Wt).optional(),logging:Wt.optional(),completions:Wt.optional(),prompts:W({listChanged:It().optional()}).optional(),resources:W({subscribe:It().optional(),listChanged:It().optional()}).optional(),tools:W({listChanged:It().optional()}).optional(),tasks:zHe.optional(),extensions:Je(I(),Wt).optional()}),HHe=cr.extend({protocolVersion:I(),capabilities:BHe,serverInfo:kse,instructions:I().optional()}),Vz=qn.extend({method:ne("notifications/initialized"),params:Un.optional()}),nE=ar.extend({method:ne("ping"),params:xn.optional()}),GHe=W({progress:Me(),total:at(Me()),message:at(I())}),ZHe=W({...Un.shape,...GHe.shape,progressToken:yse}),iE=qn.extend({method:ne("notifications/progress"),params:ZHe}),VHe=xn.extend({cursor:_se.optional()}),$g=ar.extend({params:VHe.optional()}),kg=cr.extend({nextCursor:_se.optional()}),WHe=sr(["working","input_required","completed","failed","cancelled"]),Eg=W({taskId:I(),status:WHe,ttl:rt([Me(),fg()]),createdAt:I(),lastUpdatedAt:I(),pollInterval:at(Me()),statusMessage:at(I())}),Pd=cr.extend({task:Eg}),KHe=Un.merge(Eg),Ag=qn.extend({method:ne("notifications/tasks/status"),params:KHe}),oE=ar.extend({method:ne("tasks/get"),params:xn.extend({taskId:I()})}),sE=cr.merge(Eg),aE=ar.extend({method:ne("tasks/result"),params:xn.extend({taskId:I()})}),GEt=cr.loose(),cE=$g.extend({method:ne("tasks/list")}),lE=kg.extend({tasks:ke(Eg)}),uE=ar.extend({method:ne("tasks/cancel"),params:xn.extend({taskId:I()})}),Ese=cr.merge(Eg),Ase=W({uri:I(),mimeType:at(I()),_meta:Je(I(),tt()).optional()}),Tse=Ase.extend({text:I()}),Wz=I().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ose=Ase.extend({blob:Wz}),Tg=sr(["user","assistant"]),Cd=W({audience:ke(Tg).optional(),priority:Me().min(0).max(1).optional(),lastModified:Ks.datetime({offset:!0}).optional()}),Rse=W({...Id.shape,...xg.shape,uri:I(),description:at(I()),mimeType:at(I()),size:at(Me()),annotations:Cd.optional(),_meta:at(or({}))}),JHe=W({...Id.shape,...xg.shape,uriTemplate:I(),description:at(I()),mimeType:at(I()),annotations:Cd.optional(),_meta:at(or({}))}),dE=$g.extend({method:ne("resources/list")}),YHe=kg.extend({resources:ke(Rse)}),fE=$g.extend({method:ne("resources/templates/list")}),XHe=kg.extend({resourceTemplates:ke(JHe)}),Kz=xn.extend({uri:I()}),QHe=Kz,pE=ar.extend({method:ne("resources/read"),params:QHe}),eGe=cr.extend({contents:ke(rt([Tse,Ose]))}),tGe=qn.extend({method:ne("notifications/resources/list_changed"),params:Un.optional()}),rGe=Kz,Jz=ar.extend({method:ne("resources/subscribe"),params:rGe}),nGe=Kz,Yz=ar.extend({method:ne("resources/unsubscribe"),params:nGe}),iGe=Un.extend({uri:I()}),oGe=qn.extend({method:ne("notifications/resources/updated"),params:iGe}),sGe=W({name:I(),description:at(I()),required:at(It())}),aGe=W({...Id.shape,...xg.shape,description:at(I()),arguments:at(ke(sGe)),_meta:at(or({}))}),mE=$g.extend({method:ne("prompts/list")}),cGe=kg.extend({prompts:ke(aGe)}),lGe=xn.extend({name:I(),arguments:Je(I(),I()).optional()}),hE=ar.extend({method:ne("prompts/get"),params:lGe}),Xz=W({type:ne("text"),text:I(),annotations:Cd.optional(),_meta:Je(I(),tt()).optional()}),Qz=W({type:ne("image"),data:Wz,mimeType:I(),annotations:Cd.optional(),_meta:Je(I(),tt()).optional()}),e2=W({type:ne("audio"),data:Wz,mimeType:I(),annotations:Cd.optional(),_meta:Je(I(),tt()).optional()}),uGe=W({type:ne("tool_use"),name:I(),id:I(),input:Je(I(),tt()),_meta:Je(I(),tt()).optional()}),dGe=W({type:ne("resource"),resource:rt([Tse,Ose]),annotations:Cd.optional(),_meta:Je(I(),tt()).optional()}),fGe=Rse.extend({type:ne("resource_link")}),t2=rt([Xz,Qz,e2,fGe,dGe]),pGe=W({role:Tg,content:t2}),mGe=cr.extend({description:I().optional(),messages:ke(pGe)}),hGe=qn.extend({method:ne("notifications/prompts/list_changed"),params:Un.optional()}),gGe=W({title:I().optional(),readOnlyHint:It().optional(),destructiveHint:It().optional(),idempotentHint:It().optional(),openWorldHint:It().optional()}),yGe=W({taskSupport:sr(["required","optional","forbidden"]).optional()}),Ise=W({...Id.shape,...xg.shape,description:I().optional(),inputSchema:W({type:ne("object"),properties:Je(I(),Wt).optional(),required:ke(I()).optional()}).catchall(tt()),outputSchema:W({type:ne("object"),properties:Je(I(),Wt).optional(),required:ke(I()).optional()}).catchall(tt()).optional(),annotations:gGe.optional(),execution:yGe.optional(),_meta:Je(I(),tt()).optional()}),gE=$g.extend({method:ne("tools/list")}),_Ge=kg.extend({tools:ke(Ise)}),yE=cr.extend({content:ke(t2).default([]),structuredContent:Je(I(),tt()).optional(),isError:It().optional()}),ZEt=yE.or(cr.extend({toolResult:tt()})),bGe=Sg.extend({name:I(),arguments:Je(I(),tt()).optional()}),Dd=ar.extend({method:ne("tools/call"),params:bGe}),vGe=qn.extend({method:ne("notifications/tools/list_changed"),params:Un.optional()}),VEt=W({autoRefresh:It().default(!0),debounceMs:Me().int().nonnegative().default(300)}),Og=sr(["debug","info","notice","warning","error","critical","alert","emergency"]),SGe=xn.extend({level:Og}),r2=ar.extend({method:ne("logging/setLevel"),params:SGe}),wGe=Un.extend({level:Og,logger:I().optional(),data:tt()}),xGe=qn.extend({method:ne("notifications/message"),params:wGe}),$Ge=W({name:I().optional()}),kGe=W({hints:ke($Ge).optional(),costPriority:Me().min(0).max(1).optional(),speedPriority:Me().min(0).max(1).optional(),intelligencePriority:Me().min(0).max(1).optional()}),EGe=W({mode:sr(["auto","required","none"]).optional()}),AGe=W({type:ne("tool_result"),toolUseId:I().describe("The unique identifier for the corresponding tool call."),content:ke(t2).default([]),structuredContent:W({}).loose().optional(),isError:It().optional(),_meta:Je(I(),tt()).optional()}),TGe=gg("type",[Xz,Qz,e2]),Xk=gg("type",[Xz,Qz,e2,uGe,AGe]),OGe=W({role:Tg,content:rt([Xk,ke(Xk)]),_meta:Je(I(),tt()).optional()}),RGe=Sg.extend({messages:ke(OGe),modelPreferences:kGe.optional(),systemPrompt:I().optional(),includeContext:sr(["none","thisServer","allServers"]).optional(),temperature:Me().optional(),maxTokens:Me().int(),stopSequences:ke(I()).optional(),metadata:Wt.optional(),tools:ke(Ise).optional(),toolChoice:EGe.optional()}),IGe=ar.extend({method:ne("sampling/createMessage"),params:RGe}),Rg=cr.extend({model:I(),stopReason:at(sr(["endTurn","stopSequence","maxTokens"]).or(I())),role:Tg,content:TGe}),n2=cr.extend({model:I(),stopReason:at(sr(["endTurn","stopSequence","maxTokens","toolUse"]).or(I())),role:Tg,content:rt([Xk,ke(Xk)])}),PGe=W({type:ne("boolean"),title:I().optional(),description:I().optional(),default:It().optional()}),CGe=W({type:ne("string"),title:I().optional(),description:I().optional(),minLength:Me().optional(),maxLength:Me().optional(),format:sr(["email","uri","date","date-time"]).optional(),default:I().optional()}),DGe=W({type:sr(["number","integer"]),title:I().optional(),description:I().optional(),minimum:Me().optional(),maximum:Me().optional(),default:Me().optional()}),NGe=W({type:ne("string"),title:I().optional(),description:I().optional(),enum:ke(I()),default:I().optional()}),jGe=W({type:ne("string"),title:I().optional(),description:I().optional(),oneOf:ke(W({const:I(),title:I()})),default:I().optional()}),MGe=W({type:ne("string"),title:I().optional(),description:I().optional(),enum:ke(I()),enumNames:ke(I()).optional(),default:I().optional()}),FGe=rt([NGe,jGe]),LGe=W({type:ne("array"),title:I().optional(),description:I().optional(),minItems:Me().optional(),maxItems:Me().optional(),items:W({type:ne("string"),enum:ke(I())}),default:ke(I()).optional()}),zGe=W({type:ne("array"),title:I().optional(),description:I().optional(),minItems:Me().optional(),maxItems:Me().optional(),items:W({anyOf:ke(W({const:I(),title:I()}))}),default:ke(I()).optional()}),UGe=rt([LGe,zGe]),qGe=rt([MGe,FGe,UGe]),BGe=rt([qGe,PGe,CGe,DGe]),HGe=Sg.extend({mode:ne("form").optional(),message:I(),requestedSchema:W({type:ne("object"),properties:Je(I(),BGe),required:ke(I()).optional()})}),GGe=Sg.extend({mode:ne("url"),message:I(),elicitationId:I(),url:I().url()}),ZGe=rt([HGe,GGe]),VGe=ar.extend({method:ne("elicitation/create"),params:ZGe}),WGe=Un.extend({elicitationId:I()}),KGe=qn.extend({method:ne("notifications/elicitation/complete"),params:WGe}),Nd=cr.extend({action:sr(["accept","decline","cancel"]),content:vg(t=>t===null?void 0:t,Je(I(),rt([I(),Me(),It(),ke(I())])).optional())}),JGe=W({type:ne("ref/resource"),uri:I()}),YGe=W({type:ne("ref/prompt"),name:I()}),XGe=xn.extend({ref:rt([YGe,JGe]),argument:W({name:I(),value:I()}),context:W({arguments:Je(I(),I()).optional()}).optional()}),_E=ar.extend({method:ne("completion/complete"),params:XGe});QGe=cr.extend({completion:or({values:ke(I()).max(100),total:at(Me().int()),hasMore:at(It())})}),eZe=W({uri:I().startsWith("file://"),name:I().optional(),_meta:Je(I(),tt()).optional()}),tZe=ar.extend({method:ne("roots/list"),params:xn.optional()}),i2=cr.extend({roots:ke(eZe)}),rZe=qn.extend({method:ne("notifications/roots/list_changed"),params:Un.optional()}),WEt=rt([nE,Zz,_E,r2,hE,mE,dE,fE,pE,Jz,Yz,Dd,gE,oE,aE,cE,uE]),KEt=rt([rE,iE,Vz,rZe,Ag]),JEt=rt([tE,Rg,n2,Nd,i2,sE,lE,Pd]),YEt=rt([nE,IGe,VGe,tZe,oE,aE,cE,uE]),XEt=rt([rE,iE,xGe,oGe,tGe,vGe,hGe,Ag,KGe]),QEt=rt([tE,HHe,QGe,mGe,cGe,YHe,XHe,eGe,yE,_Ge,sE,lE,Pd]),ie=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===ae.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new zz(i.elicitations,r)}return new t(e,r,n)}},zz=class extends ie{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(ae.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}}});function Ys(t){return t==="completed"||t==="failed"||t==="cancelled"}var Dse=y(()=>{});var jse,Nse,Mse,bE=y(()=>{jse=Symbol("Let zodToJsonSchema decide on which parser to use"),Nse={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Mse=t=>typeof t=="string"?{...Nse,name:t}:{...Nse,...t}});var Fse,o2=y(()=>{bE();Fse=t=>{let e=Mse(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,i])=>[i._def,{def:i._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}}});function s2(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function Ie(t,e,r,n,i){t[e]=r,s2(t,e,n,i)}var Xs=y(()=>{});var vE,SE=y(()=>{vE=(t,e)=>{let r=0;for(;r{SE()});function Lse(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==z.ZodAny&&(r.items=le(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&Ie(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Ie(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Ie(r,"minItems",t.exactLength.value,t.exactLength.message,e),Ie(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}var a2=y(()=>{yh();Xs();Ft()});function zse(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?Ie(r,"minimum",n.value,n.message,e):Ie(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Ie(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Ie(r,"maximum",n.value,n.message,e):Ie(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Ie(r,"maximum",n.value,n.message,e));break;case"multipleOf":Ie(r,"multipleOf",n.value,n.message,e);break}return r}var c2=y(()=>{Xs()});function Use(){return{type:"boolean"}}var l2=y(()=>{});function wE(t,e){return le(t.type._def,e)}var xE=y(()=>{Ft()});var qse,u2=y(()=>{Ft();qse=(t,e)=>le(t.innerType._def,e)});function d2(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((i,o)=>d2(t,e,i))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return nZe(t,e)}}var nZe,f2=y(()=>{Xs();nZe=(t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":Ie(r,"minimum",n.value,n.message,e);break;case"max":Ie(r,"maximum",n.value,n.message,e);break}return r}});function Bse(t,e){return{...le(t.innerType._def,e),default:t.defaultValue()}}var p2=y(()=>{Ft()});function Hse(t,e){return e.effectStrategy==="input"?le(t.schema._def,e):yt(e)}var m2=y(()=>{Ft();Bn()});function Gse(t){return{type:"string",enum:Array.from(t.values)}}var h2=y(()=>{});function Zse(t,e){let r=[le(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),le(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(o=>!!o),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,i=[];return r.forEach(o=>{if(iZe(o))i.push(...o.allOf),o.unevaluatedProperties===void 0&&(n=void 0);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:a,...c}=o;s=c}else n=void 0;i.push(s)}}),i.length?{allOf:i,...n}:void 0}var iZe,g2=y(()=>{Ft();iZe=t=>"type"in t&&t.type==="string"?!1:"allOf"in t});function Vse(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}var y2=y(()=>{});function $E(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":Ie(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":Ie(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":_i(r,"email",n.message,e);break;case"format:idn-email":_i(r,"idn-email",n.message,e);break;case"pattern:zod":Tr(r,yi.email,n.message,e);break}break;case"url":_i(r,"uri",n.message,e);break;case"uuid":_i(r,"uuid",n.message,e);break;case"regex":Tr(r,n.regex,n.message,e);break;case"cuid":Tr(r,yi.cuid,n.message,e);break;case"cuid2":Tr(r,yi.cuid2,n.message,e);break;case"startsWith":Tr(r,RegExp(`^${b2(n.value,e)}`),n.message,e);break;case"endsWith":Tr(r,RegExp(`${b2(n.value,e)}$`),n.message,e);break;case"datetime":_i(r,"date-time",n.message,e);break;case"date":_i(r,"date",n.message,e);break;case"time":_i(r,"time",n.message,e);break;case"duration":_i(r,"duration",n.message,e);break;case"length":Ie(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),Ie(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Tr(r,RegExp(b2(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&_i(r,"ipv4",n.message,e),n.version!=="v4"&&_i(r,"ipv6",n.message,e);break}case"base64url":Tr(r,yi.base64url,n.message,e);break;case"jwt":Tr(r,yi.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Tr(r,yi.ipv4Cidr,n.message,e),n.version!=="v4"&&Tr(r,yi.ipv6Cidr,n.message,e);break}case"emoji":Tr(r,yi.emoji(),n.message,e);break;case"ulid":{Tr(r,yi.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{_i(r,"binary",n.message,e);break}case"contentEncoding:base64":{Ie(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Tr(r,yi.base64,n.message,e);break}}break}case"nanoid":Tr(r,yi.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function b2(t,e){return e.patternStrategy==="escape"?sZe(t):t}function sZe(t){let e="";for(let r=0;ri.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):Ie(t,"format",e,r,n)}function Tr(t,e,r,n){t.pattern||t.allOf?.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:Wse(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):Ie(t,"pattern",Wse(e,n),r,n)}function Wse(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,i="",o=!1,s=!1,a=!1;for(let c=0;c{Xs();yi={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(_2===void 0&&(_2=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),_2),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};oZe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function EE(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===z.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((n,i)=>({...n,[i]:le(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",i]})??yt(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:le(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===z.ZodString&&t.keyType._def.checks?.length){let{type:n,...i}=$E(t.keyType._def,e);return{...r,propertyNames:i}}else{if(t.keyType?._def.typeName===z.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===z.ZodBranded&&t.keyType._def.type._def.typeName===z.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...i}=wE(t.keyType._def,e);return{...r,propertyNames:i}}}return r}var AE=y(()=>{yh();Ft();kE();xE();Bn()});function Kse(t,e){if(e.mapStrategy==="record")return EE(t,e);let r=le(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||yt(e),n=le(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||yt(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}var v2=y(()=>{Ft();AE();Bn()});function Jse(t){let e=t.values,n=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),i=Array.from(new Set(n.map(o=>typeof o)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:n}}var S2=y(()=>{});function Yse(t){return t.target==="openAi"?void 0:{not:yt({...t,currentPath:[...t.currentPath,"not"]})}}var w2=y(()=>{Bn()});function Xse(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var x2=y(()=>{});function eae(t,e){if(e.target==="openApi3")return Qse(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Ig&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((i,o)=>{let s=Ig[o._def.typeName];return s&&!i.includes(s)?[...i,s]:i},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((i,o)=>{let s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(o._def.value===null)return[...i,"null"];default:return i}},[]);if(n.length===r.length){let i=n.filter((o,s,a)=>a.indexOf(o)===s);return{type:i.length>1?i:i[0],enum:r.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,i)=>[...n,...i._def.values.filter(o=>!n.includes(o))],[])};return Qse(t,e)}var Ig,Qse,TE=y(()=>{Ft();Ig={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};Qse=(t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,i)=>le(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${i}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0}});function tae(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Ig[t.innerType._def.typeName],nullable:!0}:{type:[Ig[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=le(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=le(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}var $2=y(()=>{Ft();TE()});function rae(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",s2(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?Ie(r,"minimum",n.value,n.message,e):Ie(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Ie(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Ie(r,"maximum",n.value,n.message,e):Ie(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Ie(r,"maximum",n.value,n.message,e));break;case"multipleOf":Ie(r,"multipleOf",n.value,n.message,e);break}return r}var k2=y(()=>{Xs()});function nae(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},i=[],o=t.shape();for(let a in o){let c=o[a];if(c===void 0||c._def===void 0)continue;let l=cZe(c);l&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=!1);let u=le(c._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});u!==void 0&&(n.properties[a]=u,l||i.push(a))}i.length&&(n.required=i);let s=aZe(t,e);return s!==void 0&&(n.additionalProperties=s),n}function aZe(t,e){if(t.catchall._def.typeName!=="ZodNever")return le(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function cZe(t){try{return t.isOptional()}catch{return!0}}var E2=y(()=>{Ft()});var iae,A2=y(()=>{Ft();Bn();iae=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return le(t.innerType._def,e);let r=le(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:yt(e)},r]}:yt(e)}});var oae,T2=y(()=>{Ft();oae=(t,e)=>{if(e.pipeStrategy==="input")return le(t.in._def,e);if(e.pipeStrategy==="output")return le(t.out._def,e);let r=le(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=le(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(i=>i!==void 0)}}});function sae(t,e){return le(t.type._def,e)}var O2=y(()=>{Ft()});function aae(t,e){let n={type:"array",uniqueItems:!0,items:le(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&Ie(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Ie(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}var R2=y(()=>{Xs();Ft()});function cae(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>le(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:le(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>le(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}var I2=y(()=>{Ft()});function lae(t){return{not:yt(t)}}var P2=y(()=>{Bn()});function uae(t){return yt(t)}var C2=y(()=>{Bn()});var dae,D2=y(()=>{Ft();dae=(t,e)=>le(t.innerType._def,e)});var fae,N2=y(()=>{yh();Bn();a2();c2();l2();xE();u2();f2();p2();m2();h2();g2();y2();v2();S2();w2();x2();$2();k2();E2();A2();T2();O2();AE();R2();kE();I2();P2();TE();C2();D2();fae=(t,e,r)=>{switch(e){case z.ZodString:return $E(t,r);case z.ZodNumber:return rae(t,r);case z.ZodObject:return nae(t,r);case z.ZodBigInt:return zse(t,r);case z.ZodBoolean:return Use();case z.ZodDate:return d2(t,r);case z.ZodUndefined:return lae(r);case z.ZodNull:return Xse(r);case z.ZodArray:return Lse(t,r);case z.ZodUnion:case z.ZodDiscriminatedUnion:return eae(t,r);case z.ZodIntersection:return Zse(t,r);case z.ZodTuple:return cae(t,r);case z.ZodRecord:return EE(t,r);case z.ZodLiteral:return Vse(t,r);case z.ZodEnum:return Gse(t);case z.ZodNativeEnum:return Jse(t);case z.ZodNullable:return tae(t,r);case z.ZodOptional:return iae(t,r);case z.ZodMap:return Kse(t,r);case z.ZodSet:return aae(t,r);case z.ZodLazy:return()=>t.getter()._def;case z.ZodPromise:return sae(t,r);case z.ZodNaN:case z.ZodNever:return Yse(r);case z.ZodEffects:return Hse(t,r);case z.ZodAny:return yt(r);case z.ZodUnknown:return uae(r);case z.ZodDefault:return Bse(t,r);case z.ZodBranded:return wE(t,r);case z.ZodReadonly:return dae(t,r);case z.ZodCatch:return qse(t,r);case z.ZodPipeline:return oae(t,r);case z.ZodFunction:case z.ZodVoid:case z.ZodSymbol:return;default:return(n=>{})(e)}}});function le(t,e,r=!1){let n=e.seen.get(t);if(e.override){let a=e.override?.(t,e,n,r);if(a!==jse)return a}if(n&&!r){let a=lZe(n,e);if(a!==void 0)return a}let i={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,i);let o=fae(t,t.typeName,e),s=typeof o=="function"?le(o(),e):o;if(s&&uZe(t,e,s),e.postProcess){let a=e.postProcess(s,t,e);return i.jsonSchema=s,a}return i.jsonSchema=s,s}var lZe,uZe,Ft=y(()=>{bE();N2();SE();Bn();lZe=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:vE(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),yt(e)):e.$refStrategy==="seen"?yt(e):void 0}},uZe=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r)});var pae=y(()=>{});var j2,M2=y(()=>{Ft();o2();Bn();j2=(t,e)=>{let r=Fse(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[l,u])=>({...c,[l]:le(u._def,{...r,currentPath:[...r.basePath,r.definitionPath,l]},!0)??yt(r)}),{}):void 0,i=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=le(t._def,i===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1)??yt(r),s=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;s!==void 0&&(o.title=s),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let a=i===void 0?n?{...o,[r.definitionPath]:n}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...n,[i]:o}};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a}});var mae=y(()=>{bE();o2();Xs();SE();Ft();pae();Bn();a2();c2();l2();xE();u2();f2();p2();m2();h2();g2();y2();v2();S2();w2();x2();$2();k2();E2();A2();T2();O2();D2();AE();R2();kE();I2();P2();TE();C2();N2();M2();M2()});function dZe(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function F2(t,e){return zn(t)?Nc(t,{target:dZe(e?.target),io:e?.pipeStrategy??"input"}):j2(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function L2(t){let r=Ws(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=vk(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function z2(t,e){let r=Vs(t,e);if(!r.success)throw r.error;return r.data}var U2=y(()=>{PL();ig();mae()});function hae(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function gae(t,e){let r={...t};for(let n in e){let i=n,o=e[i];if(o===void 0)continue;let s=r[i];hae(s)&&hae(o)?r[i]={...s,...o}:r[i]=o}return r}var fZe,OE,yae=y(()=>{ig();Fc();Dse();U2();fZe=6e4,OE=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(rE,r=>{this._oncancel(r)}),this.setNotificationHandler(iE,r=>{this._onprogress(r)}),this.setRequestHandler(nE,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(oE,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ne(ae.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(aE,async(r,n)=>{let i=async()=>{let o=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(o,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,l=c.id,u=this._requestResolvers.get(l);if(u)if(this._requestResolvers.delete(l),a.type==="response")u(c);else{let d=c,f=new ne(d.error.code,d.error.message,d.error.data);u(f)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(o,n.sessionId);if(!s)throw new ne(ae.InvalidParams,`Task not found: ${o}`);if(!Ys(s.status))return await this._waitForTaskUpdate(o,n.signal),await i();if(Ys(s.status)){let a=await this._taskStore.getTaskResult(o,n.sessionId);return this._clearTaskQueue(o),{...a,_meta:{...a._meta,[Js]:{taskId:o}}}}return await i()};return await i()}),this.setRequestHandler(cE,async(r,n)=>{try{let{tasks:i,nextCursor:o}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:o,_meta:{}}}catch(i){throw new ne(ae.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(uE,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ne(ae.InvalidParams,`Task not found: ${r.params.taskId}`);if(Ys(i.status))throw new ne(ae.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new ne(ae.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...o}}catch(i){throw i instanceof ne?i:new ne(ae.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,i,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:o,onTimeout:i})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),ne.fromError(ae.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=o=>{n?.(o),this._onerror(o)};let i=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{i?.(o,s),wg(o)||xse(o)?this._onresponse(o):Bz(o)?this._onrequest(o,s):wse(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=ne.fromError(ae.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,o=e.params?._meta?.[Js]?.taskId;if(n===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:ae.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:u,timestamp:Date.now()},i?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):i?.send(u).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let a=bse(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,l={signal:s.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{if(s.signal.aborted)return;let d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(u,d)},sendRequest:async(u,d,f)=>{if(s.signal.aborted)throw new ne(ae.ConnectionClosed,"Request was cancelled");let p={...f,relatedRequestId:e.id};o&&!p.relatedTask&&(p.relatedTask={taskId:o});let m=p.relatedTask?.taskId??o;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(u,d,p)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,l)).then(async u=>{if(s.signal.aborted)return;let d={result:u,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)},async u=>{if(s.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:ae.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===s&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,i=Number(r),o=this._progressHandlers.get(i);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(i),a=this._timeoutInfo.get(i);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),s(c);return}o(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),wg(e))n(e);else{let s=new ne(e.error.code,e.error.message,e.error.data);n(s)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let o=!1;if(wg(e)&&e.result&&typeof e.result=="object"){let s=e.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(o=!0,this._taskProgressTokens.set(a.taskId,r))}}if(o||this._progressHandlers.delete(r),wg(e))i(e);else{let s=ne.fromError(e.error.code,e.error.message,e.error.data);i(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(e,r,n)}}catch(s){yield{type:"error",error:s instanceof ne?s:new ne(ae.InternalError,String(s))}}return}let o;try{let s=await this.request(e,Pd,n);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new ne(ae.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:o},n);if(yield{type:"taskStatus",task:a},Ys(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)}:a.status==="failed"?yield{type:"error",error:new ne(ae.InternalError,`Task ${o} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new ne(ae.InternalError,`Task ${o} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,c)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof ne?s:new ne(ae.InternalError,String(s))}}}request(e,r,n){let{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s,task:a,relatedTask:c}=n??{};return new Promise((l,u)=>{let d=_=>{u(_)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(_){d(_);return}n?.signal?.throwIfAborted();let f=this._requestMessageId++,p={...e,jsonrpc:"2.0",id:f};n?.onprogress&&(this._progressHandlers.set(f,n.onprogress),p.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),a&&(p.params={...p.params,task:a}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[Js]:c}});let m=_=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(_)}},{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(x=>this._onerror(new Error(`Failed to send cancellation: ${x}`)));let S=_ instanceof ne?_:new ne(ae.RequestTimeout,String(_));u(S)};this._responseHandlers.set(f,_=>{if(!n?.signal?.aborted){if(_ instanceof Error)return u(_);try{let S=Vs(r,_.result);S.success?l(S.data):u(S.error)}catch(S){u(S)}}}),n?.signal?.addEventListener("abort",()=>{m(n?.signal?.reason)});let h=n?.timeout??fZe,g=()=>m(ne.fromError(ae.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(f,h,n?.maxTotalTimeout,g,n?.resetTimeoutOnProgress??!1);let b=c?.taskId;if(b){let _=S=>{let x=this._responseHandlers.get(f);x?x(S):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,_),this._enqueueTaskMessage(b,{type:"request",message:p,timestamp:Date.now()}).catch(S=>{this._cleanupTimeout(f),u(S)})}else this._transport.send(p,{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(_=>{this._cleanupTimeout(f),u(_)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},sE,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},lE,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},Ese,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Js]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Js]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Js]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(e,r){let n=L2(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,o)=>{let s=z2(e,i);return Promise.resolve(r(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=L2(e);this._notificationHandlers.set(n,i=>{let o=z2(e,i);return Promise.resolve(r(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,i)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let i of n)if(i.type==="request"&&Bz(i.message)){let o=i.message.id,s=this._requestResolvers.get(o);s?(s(new ne(ae.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(e);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,o)=>{if(r.aborted){o(new ne(ae.InvalidRequest,"Request cancelled"));return}let s=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(s),o(new ne(ae.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!e)throw new Error("No request provided");return await n.createTask(i,e.id,{method:e.method,params:e.params},r)},getTask:async i=>{let o=await n.getTask(i,r);if(!o)throw new ne(ae.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(i,o,s)=>{await n.storeTaskResult(i,o,s,r);let a=await n.getTask(i,r);if(a){let c=Ag.parse({method:"notifications/tasks/status",params:a});await this.notification(c),Ys(a.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,o,s)=>{let a=await n.getTask(i,r);if(!a)throw new ne(ae.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(Ys(a.status))throw new ne(ae.InvalidParams,`Cannot update task "${i}" from terminal status "${a.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,o,s,r);let c=await n.getTask(i,r);if(c){let l=Ag.parse({method:"notifications/tasks/status",params:c});await this.notification(l),Ys(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}}});var Dg=v(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.regexpCode=Fe.getEsmExportName=Fe.getProperty=Fe.safeStringify=Fe.stringify=Fe.strConcat=Fe.addCodeArg=Fe.str=Fe._=Fe.nil=Fe._Code=Fe.Name=Fe.IDENTIFIER=Fe._CodeOrName=void 0;var Pg=class{};Fe._CodeOrName=Pg;Fe.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Lc=class extends Pg{constructor(e){if(super(),!Fe.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Fe.Name=Lc;var Hn=class extends Pg{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Lc&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Fe._Code=Hn;Fe.nil=new Hn("");function _ae(t,...e){let r=[t[0]],n=0;for(;n{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.ValueScope=Kr.ValueScopeName=Kr.Scope=Kr.varKinds=Kr.UsedValueState=void 0;var Wr=Dg(),H2=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},RE;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(RE||(Kr.UsedValueState=RE={}));Kr.varKinds={const:new Wr.Name("const"),let:new Wr.Name("let"),var:new Wr.Name("var")};var IE=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Wr.Name?e:this.name(e)}name(e){return new Wr.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Kr.Scope=IE;var PE=class extends Wr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Wr._)`.${new Wr.Name(r)}[${n}]`}};Kr.ValueScopeName=PE;var SZe=(0,Wr._)`\n`,G2=class extends IE{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?SZe:Wr.nil}}get(){return this._scope}name(e){return new PE(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:o}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let u=a.get(s);if(u)return u}else a=this._values[o]=new Map;a.set(s,i);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:o,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Wr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let o=Wr.nil;for(let s in e){let a=e[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,RE.Started);let u=r(l);if(u){let d=this.opts.es5?Kr.varKinds.var:Kr.varKinds.const;o=(0,Wr._)`${o}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))o=(0,Wr._)`${o}${u}${this.opts._n}`;else throw new H2(l);c.set(l,RE.Completed)})}return o}};Kr.ValueScope=G2});var we=v(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.or=Ee.and=Ee.not=Ee.CodeGen=Ee.operators=Ee.varKinds=Ee.ValueScopeName=Ee.ValueScope=Ee.Scope=Ee.Name=Ee.regexpCode=Ee.stringify=Ee.getProperty=Ee.nil=Ee.strConcat=Ee.str=Ee._=void 0;var Pe=Dg(),bi=Z2(),Qs=Dg();Object.defineProperty(Ee,"_",{enumerable:!0,get:function(){return Qs._}});Object.defineProperty(Ee,"str",{enumerable:!0,get:function(){return Qs.str}});Object.defineProperty(Ee,"strConcat",{enumerable:!0,get:function(){return Qs.strConcat}});Object.defineProperty(Ee,"nil",{enumerable:!0,get:function(){return Qs.nil}});Object.defineProperty(Ee,"getProperty",{enumerable:!0,get:function(){return Qs.getProperty}});Object.defineProperty(Ee,"stringify",{enumerable:!0,get:function(){return Qs.stringify}});Object.defineProperty(Ee,"regexpCode",{enumerable:!0,get:function(){return Qs.regexpCode}});Object.defineProperty(Ee,"Name",{enumerable:!0,get:function(){return Qs.Name}});var jE=Z2();Object.defineProperty(Ee,"Scope",{enumerable:!0,get:function(){return jE.Scope}});Object.defineProperty(Ee,"ValueScope",{enumerable:!0,get:function(){return jE.ValueScope}});Object.defineProperty(Ee,"ValueScopeName",{enumerable:!0,get:function(){return jE.ValueScopeName}});Object.defineProperty(Ee,"varKinds",{enumerable:!0,get:function(){return jE.varKinds}});Ee.operators={GT:new Pe._Code(">"),GTE:new Pe._Code(">="),LT:new Pe._Code("<"),LTE:new Pe._Code("<="),EQ:new Pe._Code("==="),NEQ:new Pe._Code("!=="),NOT:new Pe._Code("!"),OR:new Pe._Code("||"),AND:new Pe._Code("&&"),ADD:new Pe._Code("+")};var qo=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},V2=class extends qo{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?bi.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Md(this.rhs,e,r)),this}get names(){return this.rhs instanceof Pe._CodeOrName?this.rhs.names:{}}},CE=class extends qo{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Pe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Md(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Pe.Name?{}:{...this.lhs.names};return NE(e,this.rhs)}},W2=class extends CE{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},K2=class extends qo{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},J2=class extends qo{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Y2=class extends qo{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},X2=class extends qo{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Md(this.code,e,r),this}get names(){return this.code instanceof Pe._CodeOrName?this.code.names:{}}},Ng=class extends qo{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(e,r)||(wZe(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>qc(e,r.names),{})}},Bo=class extends Ng{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Q2=class extends Ng{},jd=class extends Bo{};jd.kind="else";var zc=class t extends Bo{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new jd(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(vae(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Md(this.condition,e,r),this}get names(){let e=super.names;return NE(e,this.condition),this.else&&qc(e,this.else.names),e}};zc.kind="if";var Uc=class extends Bo{};Uc.kind="for";var eU=class extends Uc{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Md(this.iteration,e,r),this}get names(){return qc(super.names,this.iteration.names)}},tU=class extends Uc{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?bi.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=NE(super.names,this.from);return NE(e,this.to)}},DE=class extends Uc{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Md(this.iterable,e,r),this}get names(){return qc(super.names,this.iterable.names)}},jg=class extends Bo{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};jg.kind="func";var Mg=class extends Ng{render(e){return"return "+super.render(e)}};Mg.kind="return";var rU=class extends Bo{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&qc(e,this.catch.names),this.finally&&qc(e,this.finally.names),e}},Fg=class extends Bo{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Fg.kind="catch";var Lg=class extends Bo{render(e){return"finally"+super.render(e)}};Lg.kind="finally";var nU=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?` +]`;continue}i+=n[c],n[c]==="\\"?o=!0:s&&n[c]==="]"?s=!1:!s&&n[c]==="["&&(s=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return i}var _2,yi,oZe,kE=y(()=>{Xs();yi={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(_2===void 0&&(_2=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),_2),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};oZe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function EE(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===z.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((n,i)=>({...n,[i]:le(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",i]})??yt(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:le(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===z.ZodString&&t.keyType._def.checks?.length){let{type:n,...i}=$E(t.keyType._def,e);return{...r,propertyNames:i}}else{if(t.keyType?._def.typeName===z.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===z.ZodBranded&&t.keyType._def.type._def.typeName===z.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...i}=wE(t.keyType._def,e);return{...r,propertyNames:i}}}return r}var AE=y(()=>{yh();Ft();kE();xE();Bn()});function Kse(t,e){if(e.mapStrategy==="record")return EE(t,e);let r=le(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||yt(e),n=le(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||yt(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}var v2=y(()=>{Ft();AE();Bn()});function Jse(t){let e=t.values,n=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),i=Array.from(new Set(n.map(o=>typeof o)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:n}}var S2=y(()=>{});function Yse(t){return t.target==="openAi"?void 0:{not:yt({...t,currentPath:[...t.currentPath,"not"]})}}var w2=y(()=>{Bn()});function Xse(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var x2=y(()=>{});function eae(t,e){if(e.target==="openApi3")return Qse(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Ig&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((i,o)=>{let s=Ig[o._def.typeName];return s&&!i.includes(s)?[...i,s]:i},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((i,o)=>{let s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(o._def.value===null)return[...i,"null"];default:return i}},[]);if(n.length===r.length){let i=n.filter((o,s,a)=>a.indexOf(o)===s);return{type:i.length>1?i:i[0],enum:r.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,i)=>[...n,...i._def.values.filter(o=>!n.includes(o))],[])};return Qse(t,e)}var Ig,Qse,TE=y(()=>{Ft();Ig={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};Qse=(t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,i)=>le(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${i}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0}});function tae(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Ig[t.innerType._def.typeName],nullable:!0}:{type:[Ig[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=le(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=le(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}var $2=y(()=>{Ft();TE()});function rae(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",s2(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?Ie(r,"minimum",n.value,n.message,e):Ie(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Ie(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Ie(r,"maximum",n.value,n.message,e):Ie(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Ie(r,"maximum",n.value,n.message,e));break;case"multipleOf":Ie(r,"multipleOf",n.value,n.message,e);break}return r}var k2=y(()=>{Xs()});function nae(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},i=[],o=t.shape();for(let a in o){let c=o[a];if(c===void 0||c._def===void 0)continue;let l=cZe(c);l&&r&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=!1);let u=le(c._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});u!==void 0&&(n.properties[a]=u,l||i.push(a))}i.length&&(n.required=i);let s=aZe(t,e);return s!==void 0&&(n.additionalProperties=s),n}function aZe(t,e){if(t.catchall._def.typeName!=="ZodNever")return le(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function cZe(t){try{return t.isOptional()}catch{return!0}}var E2=y(()=>{Ft()});var iae,A2=y(()=>{Ft();Bn();iae=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return le(t.innerType._def,e);let r=le(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:yt(e)},r]}:yt(e)}});var oae,T2=y(()=>{Ft();oae=(t,e)=>{if(e.pipeStrategy==="input")return le(t.in._def,e);if(e.pipeStrategy==="output")return le(t.out._def,e);let r=le(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=le(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(i=>i!==void 0)}}});function sae(t,e){return le(t.type._def,e)}var O2=y(()=>{Ft()});function aae(t,e){let n={type:"array",uniqueItems:!0,items:le(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&Ie(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Ie(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}var R2=y(()=>{Xs();Ft()});function cae(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>le(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:le(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>le(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}var I2=y(()=>{Ft()});function lae(t){return{not:yt(t)}}var P2=y(()=>{Bn()});function uae(t){return yt(t)}var C2=y(()=>{Bn()});var dae,D2=y(()=>{Ft();dae=(t,e)=>le(t.innerType._def,e)});var fae,N2=y(()=>{yh();Bn();a2();c2();l2();xE();u2();f2();p2();m2();h2();g2();y2();v2();S2();w2();x2();$2();k2();E2();A2();T2();O2();AE();R2();kE();I2();P2();TE();C2();D2();fae=(t,e,r)=>{switch(e){case z.ZodString:return $E(t,r);case z.ZodNumber:return rae(t,r);case z.ZodObject:return nae(t,r);case z.ZodBigInt:return zse(t,r);case z.ZodBoolean:return Use();case z.ZodDate:return d2(t,r);case z.ZodUndefined:return lae(r);case z.ZodNull:return Xse(r);case z.ZodArray:return Lse(t,r);case z.ZodUnion:case z.ZodDiscriminatedUnion:return eae(t,r);case z.ZodIntersection:return Zse(t,r);case z.ZodTuple:return cae(t,r);case z.ZodRecord:return EE(t,r);case z.ZodLiteral:return Vse(t,r);case z.ZodEnum:return Gse(t);case z.ZodNativeEnum:return Jse(t);case z.ZodNullable:return tae(t,r);case z.ZodOptional:return iae(t,r);case z.ZodMap:return Kse(t,r);case z.ZodSet:return aae(t,r);case z.ZodLazy:return()=>t.getter()._def;case z.ZodPromise:return sae(t,r);case z.ZodNaN:case z.ZodNever:return Yse(r);case z.ZodEffects:return Hse(t,r);case z.ZodAny:return yt(r);case z.ZodUnknown:return uae(r);case z.ZodDefault:return Bse(t,r);case z.ZodBranded:return wE(t,r);case z.ZodReadonly:return dae(t,r);case z.ZodCatch:return qse(t,r);case z.ZodPipeline:return oae(t,r);case z.ZodFunction:case z.ZodVoid:case z.ZodSymbol:return;default:return(n=>{})(e)}}});function le(t,e,r=!1){let n=e.seen.get(t);if(e.override){let a=e.override?.(t,e,n,r);if(a!==jse)return a}if(n&&!r){let a=lZe(n,e);if(a!==void 0)return a}let i={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,i);let o=fae(t,t.typeName,e),s=typeof o=="function"?le(o(),e):o;if(s&&uZe(t,e,s),e.postProcess){let a=e.postProcess(s,t,e);return i.jsonSchema=s,a}return i.jsonSchema=s,s}var lZe,uZe,Ft=y(()=>{bE();N2();SE();Bn();lZe=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:vE(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),yt(e)):e.$refStrategy==="seen"?yt(e):void 0}},uZe=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r)});var pae=y(()=>{});var j2,M2=y(()=>{Ft();o2();Bn();j2=(t,e)=>{let r=Fse(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[l,u])=>({...c,[l]:le(u._def,{...r,currentPath:[...r.basePath,r.definitionPath,l]},!0)??yt(r)}),{}):void 0,i=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=le(t._def,i===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1)??yt(r),s=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;s!==void 0&&(o.title=s),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let a=i===void 0?n?{...o,[r.definitionPath]:n}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...n,[i]:o}};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in a||"oneOf"in a||"allOf"in a||"type"in a&&Array.isArray(a.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),a}});var mae=y(()=>{bE();o2();Xs();SE();Ft();pae();Bn();a2();c2();l2();xE();u2();f2();p2();m2();h2();g2();y2();v2();S2();w2();x2();$2();k2();E2();A2();T2();O2();D2();AE();R2();kE();I2();P2();TE();C2();N2();M2();M2()});function dZe(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function F2(t,e){return zn(t)?Nc(t,{target:dZe(e?.target),io:e?.pipeStrategy??"input"}):j2(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function L2(t){let r=Ws(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=vk(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function z2(t,e){let r=Vs(t,e);if(!r.success)throw r.error;return r.data}var U2=y(()=>{PL();ig();mae()});function hae(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function gae(t,e){let r={...t};for(let n in e){let i=n,o=e[i];if(o===void 0)continue;let s=r[i];hae(s)&&hae(o)?r[i]={...s,...o}:r[i]=o}return r}var fZe,OE,yae=y(()=>{ig();Fc();Dse();U2();fZe=6e4,OE=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(rE,r=>{this._oncancel(r)}),this.setNotificationHandler(iE,r=>{this._onprogress(r)}),this.setRequestHandler(nE,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(oE,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ie(ae.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(aE,async(r,n)=>{let i=async()=>{let o=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(o,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,l=c.id,u=this._requestResolvers.get(l);if(u)if(this._requestResolvers.delete(l),a.type==="response")u(c);else{let d=c,f=new ie(d.error.code,d.error.message,d.error.data);u(f)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let s=await this._taskStore.getTask(o,n.sessionId);if(!s)throw new ie(ae.InvalidParams,`Task not found: ${o}`);if(!Ys(s.status))return await this._waitForTaskUpdate(o,n.signal),await i();if(Ys(s.status)){let a=await this._taskStore.getTaskResult(o,n.sessionId);return this._clearTaskQueue(o),{...a,_meta:{...a._meta,[Js]:{taskId:o}}}}return await i()};return await i()}),this.setRequestHandler(cE,async(r,n)=>{try{let{tasks:i,nextCursor:o}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:o,_meta:{}}}catch(i){throw new ie(ae.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(uE,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ie(ae.InvalidParams,`Task not found: ${r.params.taskId}`);if(Ys(i.status))throw new ie(ae.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new ie(ae.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...o}}catch(i){throw i instanceof ie?i:new ie(ae.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,i,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:o,onTimeout:i})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),ie.fromError(ae.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=o=>{n?.(o),this._onerror(o)};let i=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{i?.(o,s),wg(o)||xse(o)?this._onresponse(o):Bz(o)?this._onrequest(o,s):wse(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=ie.fromError(ae.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,o=e.params?._meta?.[Js]?.taskId;if(n===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:ae.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:u,timestamp:Date.now()},i?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):i?.send(u).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let a=bse(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,l={signal:s.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{if(s.signal.aborted)return;let d={relatedRequestId:e.id};o&&(d.relatedTask={taskId:o}),await this.notification(u,d)},sendRequest:async(u,d,f)=>{if(s.signal.aborted)throw new ie(ae.ConnectionClosed,"Request was cancelled");let p={...f,relatedRequestId:e.id};o&&!p.relatedTask&&(p.relatedTask={taskId:o});let m=p.relatedTask?.taskId??o;return m&&c&&await c.updateTaskStatus(m,"input_required"),await this.request(u,d,p)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,l)).then(async u=>{if(s.signal.aborted)return;let d={result:u,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)},async u=>{if(s.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:ae.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===s&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,i=Number(r),o=this._progressHandlers.get(i);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(i),a=this._timeoutInfo.get(i);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),s(c);return}o(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),wg(e))n(e);else{let s=new ie(e.error.code,e.error.message,e.error.data);n(s)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let o=!1;if(wg(e)&&e.result&&typeof e.result=="object"){let s=e.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(o=!0,this._taskProgressTokens.set(a.taskId,r))}}if(o||this._progressHandlers.delete(r),wg(e))i(e);else{let s=ie.fromError(e.error.code,e.error.message,e.error.data);i(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(e,r,n)}}catch(s){yield{type:"error",error:s instanceof ie?s:new ie(ae.InternalError,String(s))}}return}let o;try{let s=await this.request(e,Pd,n);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new ie(ae.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:o},n);if(yield{type:"taskStatus",task:a},Ys(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)}:a.status==="failed"?yield{type:"error",error:new ie(ae.InternalError,`Task ${o} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new ie(ae.InternalError,`Task ${o} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,c)),n?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof ie?s:new ie(ae.InternalError,String(s))}}}request(e,r,n){let{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s,task:a,relatedTask:c}=n??{};return new Promise((l,u)=>{let d=_=>{u(_)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(_){d(_);return}n?.signal?.throwIfAborted();let f=this._requestMessageId++,p={...e,jsonrpc:"2.0",id:f};n?.onprogress&&(this._progressHandlers.set(f,n.onprogress),p.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),a&&(p.params={...p.params,task:a}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[Js]:c}});let m=_=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(_)}},{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(x=>this._onerror(new Error(`Failed to send cancellation: ${x}`)));let S=_ instanceof ie?_:new ie(ae.RequestTimeout,String(_));u(S)};this._responseHandlers.set(f,_=>{if(!n?.signal?.aborted){if(_ instanceof Error)return u(_);try{let S=Vs(r,_.result);S.success?l(S.data):u(S.error)}catch(S){u(S)}}}),n?.signal?.addEventListener("abort",()=>{m(n?.signal?.reason)});let h=n?.timeout??fZe,g=()=>m(ie.fromError(ae.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(f,h,n?.maxTotalTimeout,g,n?.resetTimeoutOnProgress??!1);let b=c?.taskId;if(b){let _=S=>{let x=this._responseHandlers.get(f);x?x(S):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,_),this._enqueueTaskMessage(b,{type:"request",message:p,timestamp:Date.now()}).catch(S=>{this._cleanupTimeout(f),u(S)})}else this._transport.send(p,{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(_=>{this._cleanupTimeout(f),u(_)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},sE,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},lE,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},Ese,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Js]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Js]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Js]:r.relatedTask}}}),await this._transport.send(s,r)}setRequestHandler(e,r){let n=L2(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,o)=>{let s=z2(e,i);return Promise.resolve(r(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=L2(e);this._notificationHandlers.set(n,i=>{let o=z2(e,i);return Promise.resolve(r(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,i)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let i of n)if(i.type==="request"&&Bz(i.message)){let o=i.message.id,s=this._requestResolvers.get(o);s?(s(new ie(ae.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(e);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,o)=>{if(r.aborted){o(new ie(ae.InvalidRequest,"Request cancelled"));return}let s=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(s),o(new ie(ae.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!e)throw new Error("No request provided");return await n.createTask(i,e.id,{method:e.method,params:e.params},r)},getTask:async i=>{let o=await n.getTask(i,r);if(!o)throw new ie(ae.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(i,o,s)=>{await n.storeTaskResult(i,o,s,r);let a=await n.getTask(i,r);if(a){let c=Ag.parse({method:"notifications/tasks/status",params:a});await this.notification(c),Ys(a.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,o,s)=>{let a=await n.getTask(i,r);if(!a)throw new ie(ae.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(Ys(a.status))throw new ie(ae.InvalidParams,`Cannot update task "${i}" from terminal status "${a.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,o,s,r);let c=await n.getTask(i,r);if(c){let l=Ag.parse({method:"notifications/tasks/status",params:c});await this.notification(l),Ys(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}}});var Dg=v(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.regexpCode=Fe.getEsmExportName=Fe.getProperty=Fe.safeStringify=Fe.stringify=Fe.strConcat=Fe.addCodeArg=Fe.str=Fe._=Fe.nil=Fe._Code=Fe.Name=Fe.IDENTIFIER=Fe._CodeOrName=void 0;var Pg=class{};Fe._CodeOrName=Pg;Fe.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Lc=class extends Pg{constructor(e){if(super(),!Fe.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Fe.Name=Lc;var Hn=class extends Pg{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Lc&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Fe._Code=Hn;Fe.nil=new Hn("");function _ae(t,...e){let r=[t[0]],n=0;for(;n{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.ValueScope=Kr.ValueScopeName=Kr.Scope=Kr.varKinds=Kr.UsedValueState=void 0;var Wr=Dg(),H2=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},RE;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(RE||(Kr.UsedValueState=RE={}));Kr.varKinds={const:new Wr.Name("const"),let:new Wr.Name("let"),var:new Wr.Name("var")};var IE=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Wr.Name?e:this.name(e)}name(e){return new Wr.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Kr.Scope=IE;var PE=class extends Wr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Wr._)`.${new Wr.Name(r)}[${n}]`}};Kr.ValueScopeName=PE;var SZe=(0,Wr._)`\n`,G2=class extends IE{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?SZe:Wr.nil}}get(){return this._scope}name(e){return new PE(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:o}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let u=a.get(s);if(u)return u}else a=this._values[o]=new Map;a.set(s,i);let c=this._scope[o]||(this._scope[o]=[]),l=c.length;return c[l]=r.ref,i.setValue(r,{property:o,itemIndex:l}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Wr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let o=Wr.nil;for(let s in e){let a=e[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,RE.Started);let u=r(l);if(u){let d=this.opts.es5?Kr.varKinds.var:Kr.varKinds.const;o=(0,Wr._)`${o}${d} ${l} = ${u};${this.opts._n}`}else if(u=i?.(l))o=(0,Wr._)`${o}${u}${this.opts._n}`;else throw new H2(l);c.set(l,RE.Completed)})}return o}};Kr.ValueScope=G2});var we=v(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.or=Ee.and=Ee.not=Ee.CodeGen=Ee.operators=Ee.varKinds=Ee.ValueScopeName=Ee.ValueScope=Ee.Scope=Ee.Name=Ee.regexpCode=Ee.stringify=Ee.getProperty=Ee.nil=Ee.strConcat=Ee.str=Ee._=void 0;var Pe=Dg(),bi=Z2(),Qs=Dg();Object.defineProperty(Ee,"_",{enumerable:!0,get:function(){return Qs._}});Object.defineProperty(Ee,"str",{enumerable:!0,get:function(){return Qs.str}});Object.defineProperty(Ee,"strConcat",{enumerable:!0,get:function(){return Qs.strConcat}});Object.defineProperty(Ee,"nil",{enumerable:!0,get:function(){return Qs.nil}});Object.defineProperty(Ee,"getProperty",{enumerable:!0,get:function(){return Qs.getProperty}});Object.defineProperty(Ee,"stringify",{enumerable:!0,get:function(){return Qs.stringify}});Object.defineProperty(Ee,"regexpCode",{enumerable:!0,get:function(){return Qs.regexpCode}});Object.defineProperty(Ee,"Name",{enumerable:!0,get:function(){return Qs.Name}});var jE=Z2();Object.defineProperty(Ee,"Scope",{enumerable:!0,get:function(){return jE.Scope}});Object.defineProperty(Ee,"ValueScope",{enumerable:!0,get:function(){return jE.ValueScope}});Object.defineProperty(Ee,"ValueScopeName",{enumerable:!0,get:function(){return jE.ValueScopeName}});Object.defineProperty(Ee,"varKinds",{enumerable:!0,get:function(){return jE.varKinds}});Ee.operators={GT:new Pe._Code(">"),GTE:new Pe._Code(">="),LT:new Pe._Code("<"),LTE:new Pe._Code("<="),EQ:new Pe._Code("==="),NEQ:new Pe._Code("!=="),NOT:new Pe._Code("!"),OR:new Pe._Code("||"),AND:new Pe._Code("&&"),ADD:new Pe._Code("+")};var qo=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},V2=class extends qo{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?bi.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Md(this.rhs,e,r)),this}get names(){return this.rhs instanceof Pe._CodeOrName?this.rhs.names:{}}},CE=class extends qo{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Pe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Md(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Pe.Name?{}:{...this.lhs.names};return NE(e,this.rhs)}},W2=class extends CE{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},K2=class extends qo{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},J2=class extends qo{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Y2=class extends qo{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},X2=class extends qo{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Md(this.code,e,r),this}get names(){return this.code instanceof Pe._CodeOrName?this.code.names:{}}},Ng=class extends qo{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(e,r)||(wZe(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>qc(e,r.names),{})}},Bo=class extends Ng{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Q2=class extends Ng{},jd=class extends Bo{};jd.kind="else";var zc=class t extends Bo{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new jd(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(vae(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Md(this.condition,e,r),this}get names(){let e=super.names;return NE(e,this.condition),this.else&&qc(e,this.else.names),e}};zc.kind="if";var Uc=class extends Bo{};Uc.kind="for";var eU=class extends Uc{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Md(this.iteration,e,r),this}get names(){return qc(super.names,this.iteration.names)}},tU=class extends Uc{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?bi.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=NE(super.names,this.from);return NE(e,this.to)}},DE=class extends Uc{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Md(this.iterable,e,r),this}get names(){return qc(super.names,this.iterable.names)}},jg=class extends Bo{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};jg.kind="func";var Mg=class extends Ng{render(e){return"return "+super.render(e)}};Mg.kind="return";var rU=class extends Bo{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&qc(e,this.catch.names),this.finally&&qc(e,this.finally.names),e}},Fg=class extends Bo{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Fg.kind="catch";var Lg=class extends Bo{render(e){return"finally"+super.render(e)}};Lg.kind="finally";var nU=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?` `:""},this._extScope=e,this._scope=new bi.Scope({parent:e}),this._nodes=[new Q2]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let o=this._scope.toName(r);return n!==void 0&&i&&(this._constants[o.str]=n),this._leafNode(new V2(e,o,n)),o}const(e,r,n){return this._def(bi.varKinds.const,e,r,n)}let(e,r,n){return this._def(bi.varKinds.let,e,r,n)}var(e,r,n){return this._def(bi.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new CE(e,r,n))}add(e,r){return this._leafNode(new W2(e,Ee.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Pe.nil&&this._leafNode(new X2(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Pe.addCodeArg)(r,i));return r.push("}"),new Pe._Code(r)}if(e,r,n){if(this._blockNode(new zc(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new zc(e))}else(){return this._elseNode(new jd)}endIf(){return this._endBlockNode(zc,jd)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new eU(e),r)}forRange(e,r,n,i,o=this.opts.es5?bi.varKinds.var:bi.varKinds.let){let s=this._scope.toName(e);return this._for(new tU(o,s,r,n),()=>i(s))}forOf(e,r,n,i=bi.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=r instanceof Pe.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Pe._)`${s}.length`,a=>{this.var(o,(0,Pe._)`${s}[${a}]`),n(o)})}return this._for(new DE("of",i,o,r),()=>n(o))}forIn(e,r,n,i=this.opts.es5?bi.varKinds.var:bi.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Pe._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new DE("in",i,o,r),()=>n(o))}endFor(){return this._endBlockNode(Uc)}label(e){return this._leafNode(new K2(e))}break(e){return this._leafNode(new J2(e))}return(e){let r=new Mg;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Mg)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new rU;if(this._blockNode(i),this.code(e),r){let o=this.name("e");this._currNode=i.catch=new Fg(o),r(o)}return n&&(this._currNode=i.finally=new Lg,this.code(n)),this._endBlockNode(Fg,Lg)}throw(e){return this._leafNode(new Y2(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Pe.nil,n,i){return this._blockNode(new jg(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(jg)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof zc))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};Ee.CodeGen=nU;function qc(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function NE(t,e){return e instanceof Pe._CodeOrName?qc(t,e.names):t}function Md(t,e,r){if(t instanceof Pe.Name)return n(t);if(!i(t))return t;return new Pe._Code(t._items.reduce((o,s)=>(s instanceof Pe.Name&&(s=n(s)),s instanceof Pe._Code?o.push(...s._items):o.push(s),o),[]));function n(o){let s=r[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function i(o){return o instanceof Pe._Code&&o._items.some(s=>s instanceof Pe.Name&&e[s.str]===1&&r[s.str]!==void 0)}}function wZe(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function vae(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Pe._)`!${iU(t)}`}Ee.not=vae;var xZe=Sae(Ee.operators.AND);function $Ze(...t){return t.reduce(xZe)}Ee.and=$Ze;var kZe=Sae(Ee.operators.OR);function EZe(...t){return t.reduce(kZe)}Ee.or=EZe;function Sae(t){return(e,r)=>e===Pe.nil?r:r===Pe.nil?e:(0,Pe._)`${iU(e)} ${t} ${iU(r)}`}function iU(t){return t instanceof Pe.Name?t:(0,Pe._)`(${t})`}});var Ne=v(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.checkStrictMode=Te.getErrorPath=Te.Type=Te.useFunc=Te.setEvaluated=Te.evaluatedPropsToName=Te.mergeEvaluated=Te.eachItem=Te.unescapeJsonPointer=Te.escapeJsonPointer=Te.escapeFragment=Te.unescapeFragment=Te.schemaRefOrVal=Te.schemaHasRulesButRef=Te.schemaHasRules=Te.checkUnknownRules=Te.alwaysValidSchema=Te.toHash=void 0;var ct=we(),AZe=Dg();function TZe(t){let e={};for(let r of t)e[r]=!0;return e}Te.toHash=TZe;function OZe(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:($ae(t,e),!kae(e,t.self.RULES.all))}Te.alwaysValidSchema=OZe;function $ae(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let o in e)i[o]||Tae(t,`unknown keyword: "${o}"`)}Te.checkUnknownRules=$ae;function kae(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Te.schemaHasRules=kae;function RZe(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Te.schemaHasRulesButRef=RZe;function IZe({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ct._)`${r}`}return(0,ct._)`${t}${e}${(0,ct.getProperty)(n)}`}Te.schemaRefOrVal=IZe;function PZe(t){return Eae(decodeURIComponent(t))}Te.unescapeFragment=PZe;function CZe(t){return encodeURIComponent(sU(t))}Te.escapeFragment=CZe;function sU(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Te.escapeJsonPointer=sU;function Eae(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Te.unescapeJsonPointer=Eae;function DZe(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Te.eachItem=DZe;function wae({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,o,s,a)=>{let c=s===void 0?o:s instanceof ct.Name?(o instanceof ct.Name?t(i,o,s):e(i,o,s),s):o instanceof ct.Name?(e(i,s,o),o):r(o,s);return a===ct.Name&&!(c instanceof ct.Name)?n(i,c):c}}Te.mergeEvaluated={props:wae({mergeNames:(t,e,r)=>t.if((0,ct._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ct._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ct._)`${r} || {}`).code((0,ct._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ct._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ct._)`${r} || {}`),aU(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Aae}),items:wae({mergeNames:(t,e,r)=>t.if((0,ct._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ct._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ct._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ct._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Aae(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ct._)`{}`);return e!==void 0&&aU(t,r,e),r}Te.evaluatedPropsToName=Aae;function aU(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ct._)`${e}${(0,ct.getProperty)(n)}`,!0))}Te.setEvaluated=aU;var xae={};function NZe(t,e){return t.scopeValue("func",{ref:e,code:xae[e.code]||(xae[e.code]=new AZe._Code(e.code))})}Te.useFunc=NZe;var oU;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(oU||(Te.Type=oU={}));function jZe(t,e,r){if(t instanceof ct.Name){let n=e===oU.Num;return r?n?(0,ct._)`"[" + ${t} + "]"`:(0,ct._)`"['" + ${t} + "']"`:n?(0,ct._)`"/" + ${t}`:(0,ct._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ct.getProperty)(t).toString():"/"+sU(t)}Te.getErrorPath=jZe;function Tae(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Te.checkStrictMode=Tae});var Ho=v(cU=>{"use strict";Object.defineProperty(cU,"__esModule",{value:!0});var yr=we(),MZe={data:new yr.Name("data"),valCxt:new yr.Name("valCxt"),instancePath:new yr.Name("instancePath"),parentData:new yr.Name("parentData"),parentDataProperty:new yr.Name("parentDataProperty"),rootData:new yr.Name("rootData"),dynamicAnchors:new yr.Name("dynamicAnchors"),vErrors:new yr.Name("vErrors"),errors:new yr.Name("errors"),this:new yr.Name("this"),self:new yr.Name("self"),scope:new yr.Name("scope"),json:new yr.Name("json"),jsonPos:new yr.Name("jsonPos"),jsonLen:new yr.Name("jsonLen"),jsonPart:new yr.Name("jsonPart")};cU.default=MZe});var zg=v(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.extendErrors=_r.resetErrorsCount=_r.reportExtraError=_r.reportError=_r.keyword$DataError=_r.keywordError=void 0;var je=we(),ME=Ne(),Or=Ho();_r.keywordError={message:({keyword:t})=>(0,je.str)`must pass "${t}" keyword validation`};_r.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,je.str)`"${t}" keyword must be ${e} ($data)`:(0,je.str)`"${t}" keyword is invalid ($data)`};function FZe(t,e=_r.keywordError,r,n){let{it:i}=t,{gen:o,compositeRule:s,allErrors:a}=i,c=Iae(t,e,r);n??(s||a)?Oae(o,c):Rae(i,(0,je._)`[${c}]`)}_r.reportError=FZe;function LZe(t,e=_r.keywordError,r){let{it:n}=t,{gen:i,compositeRule:o,allErrors:s}=n,a=Iae(t,e,r);Oae(i,a),o||s||Rae(n,Or.default.vErrors)}_r.reportExtraError=LZe;function zZe(t,e){t.assign(Or.default.errors,e),t.if((0,je._)`${Or.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,je._)`${Or.default.vErrors}.length`,e),()=>t.assign(Or.default.vErrors,null)))}_r.resetErrorsCount=zZe;function UZe({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:o}){if(i===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",i,Or.default.errors,a=>{t.const(s,(0,je._)`${Or.default.vErrors}[${a}]`),t.if((0,je._)`${s}.instancePath === undefined`,()=>t.assign((0,je._)`${s}.instancePath`,(0,je.strConcat)(Or.default.instancePath,o.errorPath))),t.assign((0,je._)`${s}.schemaPath`,(0,je.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,je._)`${s}.schema`,r),t.assign((0,je._)`${s}.data`,n))})}_r.extendErrors=UZe;function Oae(t,e){let r=t.const("err",e);t.if((0,je._)`${Or.default.vErrors} === null`,()=>t.assign(Or.default.vErrors,(0,je._)`[${r}]`),(0,je._)`${Or.default.vErrors}.push(${r})`),t.code((0,je._)`${Or.default.errors}++`)}function Rae(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,je._)`new ${t.ValidationError}(${e})`):(r.assign((0,je._)`${n}.errors`,e),r.return(!1))}var Bc={keyword:new je.Name("keyword"),schemaPath:new je.Name("schemaPath"),params:new je.Name("params"),propertyName:new je.Name("propertyName"),message:new je.Name("message"),schema:new je.Name("schema"),parentSchema:new je.Name("parentSchema")};function Iae(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,je._)`{}`:qZe(t,e,r)}function qZe(t,e,r={}){let{gen:n,it:i}=t,o=[BZe(i,r),HZe(t,r)];return GZe(t,e,o),n.object(...o)}function BZe({errorPath:t},{instancePath:e}){let r=e?(0,je.str)`${t}${(0,ME.getErrorPath)(e,ME.Type.Str)}`:t;return[Or.default.instancePath,(0,je.strConcat)(Or.default.instancePath,r)]}function HZe({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,je.str)`${e}/${t}`;return r&&(i=(0,je.str)`${i}${(0,ME.getErrorPath)(r,ME.Type.Str)}`),[Bc.schemaPath,i]}function GZe(t,{params:e,message:r},n){let{keyword:i,data:o,schemaValue:s,it:a}=t,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;n.push([Bc.keyword,i],[Bc.params,typeof e=="function"?e(t):e||(0,je._)`{}`]),c.messages&&n.push([Bc.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Bc.schema,s],[Bc.parentSchema,(0,je._)`${u}${d}`],[Or.default.data,o]),l&&n.push([Bc.propertyName,l])}});var Cae=v(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.boolOrEmptySchema=Fd.topBoolOrEmptySchema=void 0;var ZZe=zg(),VZe=we(),WZe=Ho(),KZe={message:"boolean schema is false"};function JZe(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Pae(t,!1):typeof r=="object"&&r.$async===!0?e.return(WZe.default.data):(e.assign((0,VZe._)`${n}.errors`,null),e.return(!0))}Fd.topBoolOrEmptySchema=JZe;function YZe(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Pae(t)):r.var(e,!0)}Fd.boolOrEmptySchema=YZe;function Pae(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,ZZe.reportError)(i,KZe,void 0,e)}});var lU=v(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.getRules=Ld.isJSONType=void 0;var XZe=["string","number","integer","boolean","null","object","array"],QZe=new Set(XZe);function e9e(t){return typeof t=="string"&&QZe.has(t)}Ld.isJSONType=e9e;function t9e(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Ld.getRules=t9e});var uU=v(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.shouldUseRule=ea.shouldUseGroup=ea.schemaHasRulesForType=void 0;function r9e({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Dae(t,n)}ea.schemaHasRulesForType=r9e;function Dae(t,e){return e.rules.some(r=>Nae(t,r))}ea.shouldUseGroup=Dae;function Nae(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}ea.shouldUseRule=Nae});var Ug=v(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.reportTypeError=br.checkDataTypes=br.checkDataType=br.coerceAndCheckDataType=br.getJSONTypes=br.getSchemaTypes=br.DataType=void 0;var n9e=lU(),i9e=uU(),o9e=zg(),Se=we(),jae=Ne(),zd;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(zd||(br.DataType=zd={}));function s9e(t){let e=Mae(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}br.getSchemaTypes=s9e;function Mae(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(n9e.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}br.getJSONTypes=Mae;function a9e(t,e){let{gen:r,data:n,opts:i}=t,o=c9e(e,i.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,i9e.schemaHasRulesForType)(t,e[0]));if(s){let a=fU(e,n,i.strictNumbers,zd.Wrong);r.if(a,()=>{o.length?l9e(t,e,o):pU(t)})}return s}br.coerceAndCheckDataType=a9e;var Fae=new Set(["string","number","integer","boolean","null"]);function c9e(t,e){return e?t.filter(r=>Fae.has(r)||e==="array"&&r==="array"):[]}function l9e(t,e,r){let{gen:n,data:i,opts:o}=t,s=n.let("dataType",(0,Se._)`typeof ${i}`),a=n.let("coerced",(0,Se._)`undefined`);o.coerceTypes==="array"&&n.if((0,Se._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Se._)`${i}[0]`).assign(s,(0,Se._)`typeof ${i}`).if(fU(e,i,o.strictNumbers),()=>n.assign(a,i))),n.if((0,Se._)`${a} !== undefined`);for(let l of r)(Fae.has(l)||l==="array"&&o.coerceTypes==="array")&&c(l);n.else(),pU(t),n.endIf(),n.if((0,Se._)`${a} !== undefined`,()=>{n.assign(i,a),u9e(t,a)});function c(l){switch(l){case"string":n.elseIf((0,Se._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,Se._)`"" + ${i}`).elseIf((0,Se._)`${i} === null`).assign(a,(0,Se._)`""`);return;case"number":n.elseIf((0,Se._)`${s} == "boolean" || ${i} === null || (${s} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,Se._)`+${i}`);return;case"integer":n.elseIf((0,Se._)`${s} === "boolean" || ${i} === null || (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,Se._)`+${i}`);return;case"boolean":n.elseIf((0,Se._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,Se._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":n.elseIf((0,Se._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(a,null);return;case"array":n.elseIf((0,Se._)`${s} === "string" || ${s} === "number" - || ${s} === "boolean" || ${i} === null`).assign(a,(0,Se._)`[${i}]`)}}}function u9e({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Se._)`${e} !== undefined`,()=>t.assign((0,Se._)`${e}[${r}]`,n))}function dU(t,e,r,n=zd.Correct){let i=n===zd.Correct?Se.operators.EQ:Se.operators.NEQ,o;switch(t){case"null":return(0,Se._)`${e} ${i} null`;case"array":o=(0,Se._)`Array.isArray(${e})`;break;case"object":o=(0,Se._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,Se._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,Se._)`typeof ${e} ${i} ${t}`}return n===zd.Correct?o:(0,Se.not)(o);function s(a=Se.nil){return(0,Se.and)((0,Se._)`typeof ${e} == "number"`,a,r?(0,Se._)`isFinite(${e})`:Se.nil)}}br.checkDataType=dU;function fU(t,e,r,n){if(t.length===1)return dU(t[0],e,r,n);let i,o=(0,jae.toHash)(t);if(o.array&&o.object){let s=(0,Se._)`typeof ${e} != "object"`;i=o.null?s:(0,Se._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else i=Se.nil;o.number&&delete o.integer;for(let s in o)i=(0,Se.and)(i,dU(s,e,r,n));return i}br.checkDataTypes=fU;var d9e={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Se._)`{type: ${t}}`:(0,Se._)`{type: ${e}}`};function pU(t){let e=f9e(t);(0,o9e.reportError)(e,d9e)}br.reportTypeError=pU;function f9e(t){let{gen:e,data:r,schema:n}=t,i=(0,jae.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var zae=v(FE=>{"use strict";Object.defineProperty(FE,"__esModule",{value:!0});FE.assignDefaults=void 0;var Ud=we(),p9e=Ne();function m9e(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)Lae(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,o)=>Lae(t,o,i.default))}FE.assignDefaults=m9e;function Lae(t,e,r){let{gen:n,compositeRule:i,data:o,opts:s}=t;if(r===void 0)return;let a=(0,Ud._)`${o}${(0,Ud.getProperty)(e)}`;if(i){(0,p9e.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Ud._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Ud._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Ud._)`${a} = ${(0,Ud.stringify)(r)}`)}});var Gn=v(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.validateUnion=nt.validateArray=nt.usePattern=nt.callValidateCode=nt.schemaProperties=nt.allSchemaProperties=nt.noPropertyInData=nt.propertyInData=nt.isOwnProperty=nt.hasPropFunc=nt.reportMissingProp=nt.checkMissingProp=nt.checkReportMissingProp=void 0;var ft=we(),mU=Ne(),ta=Ho(),h9e=Ne();function g9e(t,e){let{gen:r,data:n,it:i}=t;r.if(gU(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ft._)`${e}`},!0),t.error()})}nt.checkReportMissingProp=g9e;function y9e({gen:t,data:e,it:{opts:r}},n,i){return(0,ft.or)(...n.map(o=>(0,ft.and)(gU(t,e,o,r.ownProperties),(0,ft._)`${i} = ${o}`)))}nt.checkMissingProp=y9e;function _9e(t,e){t.setParams({missingProperty:e},!0),t.error()}nt.reportMissingProp=_9e;function Uae(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ft._)`Object.prototype.hasOwnProperty`})}nt.hasPropFunc=Uae;function hU(t,e,r){return(0,ft._)`${Uae(t)}.call(${e}, ${r})`}nt.isOwnProperty=hU;function b9e(t,e,r,n){let i=(0,ft._)`${e}${(0,ft.getProperty)(r)} !== undefined`;return n?(0,ft._)`${i} && ${hU(t,e,r)}`:i}nt.propertyInData=b9e;function gU(t,e,r,n){let i=(0,ft._)`${e}${(0,ft.getProperty)(r)} === undefined`;return n?(0,ft.or)(i,(0,ft.not)(hU(t,e,r))):i}nt.noPropertyInData=gU;function qae(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}nt.allSchemaProperties=qae;function v9e(t,e){return qae(e).filter(r=>!(0,mU.alwaysValidSchema)(t,e[r]))}nt.schemaProperties=v9e;function S9e({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:s},a,c,l){let u=l?(0,ft._)`${t}, ${e}, ${n}${i}`:e,d=[[ta.default.instancePath,(0,ft.strConcat)(ta.default.instancePath,o)],[ta.default.parentData,s.parentData],[ta.default.parentDataProperty,s.parentDataProperty],[ta.default.rootData,ta.default.rootData]];s.opts.dynamicRef&&d.push([ta.default.dynamicAnchors,ta.default.dynamicAnchors]);let f=(0,ft._)`${u}, ${r.object(...d)}`;return c!==ft.nil?(0,ft._)`${a}.call(${c}, ${f})`:(0,ft._)`${a}(${f})`}nt.callValidateCode=S9e;var w9e=(0,ft._)`new RegExp`;function x9e({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,o=i(r,n);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,ft._)`${i.code==="new RegExp"?w9e:(0,h9e.useFunc)(t,i)}(${r}, ${n})`})}nt.usePattern=x9e;function $9e(t){let{gen:e,data:r,keyword:n,it:i}=t,o=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){let c=e.const("len",(0,ft._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:mU.Type.Num},o),e.if((0,ft.not)(o),a)})}}nt.validateArray=$9e;function k9e(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,mU.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let s=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(s,(0,ft._)`${s} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,ft.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}nt.validateUnion=k9e});var Gae=v(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.validateKeywordUsage=no.validSchemaType=no.funcKeywordCode=no.macroKeywordCode=void 0;var Rr=we(),Hc=Ho(),E9e=Gn(),A9e=zg();function T9e(t,e){let{gen:r,keyword:n,schema:i,parentSchema:o,it:s}=t,a=e.macro.call(s.self,i,o,s),c=Hae(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:Rr.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}no.macroKeywordCode=T9e;function O9e(t,e){var r;let{gen:n,keyword:i,schema:o,parentSchema:s,$data:a,it:c}=t;I9e(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,s,c):e.validate,u=Hae(n,i,l),d=n.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)h(),e.modifying&&Bae(t),g(()=>t.error());else{let b=e.async?p():m();e.modifying&&Bae(t),g(()=>R9e(t,b))}}function p(){let b=n.let("ruleErrs",null);return n.try(()=>h((0,Rr._)`await `),_=>n.assign(d,!1).if((0,Rr._)`${_} instanceof ${c.ValidationError}`,()=>n.assign(b,(0,Rr._)`${_}.errors`),()=>n.throw(_))),b}function m(){let b=(0,Rr._)`${u}.errors`;return n.assign(b,null),h(Rr.nil),b}function h(b=e.async?(0,Rr._)`await `:Rr.nil){let _=c.opts.passContext?Hc.default.this:Hc.default.self,S=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Rr._)`${b}${(0,E9e.callValidateCode)(t,u,_,S)}`,e.modifying)}function g(b){var _;n.if((0,Rr.not)((_=e.valid)!==null&&_!==void 0?_:d),b)}}no.funcKeywordCode=O9e;function Bae(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Rr._)`${n.parentData}[${n.parentDataProperty}]`))}function R9e(t,e){let{gen:r}=t;r.if((0,Rr._)`Array.isArray(${e})`,()=>{r.assign(Hc.default.vErrors,(0,Rr._)`${Hc.default.vErrors} === null ? ${e} : ${Hc.default.vErrors}.concat(${e})`).assign(Hc.default.errors,(0,Rr._)`${Hc.default.vErrors}.length`),(0,A9e.extendErrors)(t)},()=>t.error())}function I9e({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Hae(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Rr.stringify)(r)})}function P9e(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}no.validSchemaType=P9e;function C9e({schema:t,opts:e,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");let s=i.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}no.validateKeywordUsage=C9e});var Vae=v(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.extendSubschemaMode=ra.extendSubschemaData=ra.getSubschema=void 0;var io=we(),Zae=Ne();function D9e(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,io._)`${t.schemaPath}${(0,io.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,io._)`${t.schemaPath}${(0,io.getProperty)(e)}${(0,io.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Zae.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}ra.getSubschema=D9e;function N9e(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:s}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,io._)`${e.data}${(0,io.getProperty)(r)}`,!0);c(f),t.errorPath=(0,io.str)`${l}${(0,Zae.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,io._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof io.Name?i:a.let("data",i,!0);c(l),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}ra.extendSubschemaData=N9e;function j9e(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}ra.extendSubschemaMode=j9e});var yU=v((hRt,Wae)=>{"use strict";Wae.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var s=o[i];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var Jae=v((gRt,Kae)=>{"use strict";var na=Kae.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};LE(e,n,i,t,"",t)};na.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};na.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};na.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};na.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function LE(t,e,r,n,i,o,s,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,o,s,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in na.arrayKeywords)for(var f=0;f{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.getSchemaRefs=Jr.resolveUrl=Jr.normalizeId=Jr._getFullPath=Jr.getFullPath=Jr.inlineRef=void 0;var F9e=Ne(),L9e=yU(),z9e=Jae(),U9e=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function q9e(t,e=!0){return typeof t=="boolean"?!0:e===!0?!_U(t):e?Yae(t)<=e:!1}Jr.inlineRef=q9e;var B9e=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function _U(t){for(let e in t){if(B9e.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(_U)||typeof r=="object"&&_U(r))return!0}return!1}function Yae(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!U9e.has(r)&&(typeof t[r]=="object"&&(0,F9e.eachItem)(t[r],n=>e+=Yae(n)),e===1/0))return 1/0}return e}function Xae(t,e="",r){r!==!1&&(e=qd(e));let n=t.parse(e);return Qae(t,n)}Jr.getFullPath=Xae;function Qae(t,e){return t.serialize(e).split("#")[0]+"#"}Jr._getFullPath=Qae;var H9e=/#\/?$/;function qd(t){return t?t.replace(H9e,""):""}Jr.normalizeId=qd;function G9e(t,e,r){return r=qd(r),t.resolve(e,r)}Jr.resolveUrl=G9e;var Z9e=/^[a-z_][-a-z0-9._]*$/i;function V9e(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=qd(t[r]||e),o={"":i},s=Xae(n,i,!1),a={},c=new Set;return z9e(t,{allKeys:!0},(d,f,p,m)=>{if(m===void 0)return;let h=s+f,g=o[m];typeof d[r]=="string"&&(g=b.call(this,d[r])),_.call(this,d.$anchor),_.call(this,d.$dynamicAnchor),o[f]=g;function b(S){let x=this.opts.uriResolver.resolve;if(S=qd(g?x(g,S):S),c.has(S))throw u(S);c.add(S);let w=this.refs[S];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?l(d,w.schema,S):S!==qd(h)&&(S[0]==="#"?(l(d,a[S],S),a[S]=d):this.refs[S]=h),S}function _(S){if(typeof S=="string"){if(!Z9e.test(S))throw new Error(`invalid anchor "${S}"`);b.call(this,`#${S}`)}}}),a;function l(d,f,p){if(f!==void 0&&!L9e(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Jr.getSchemaRefs=V9e});var Gg=v(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.getData=ia.KeywordCxt=ia.validateFunctionCode=void 0;var ice=Cae(),ece=Ug(),vU=uU(),zE=Ug(),W9e=zae(),Hg=Gae(),bU=Vae(),oe=we(),pe=Ho(),K9e=qg(),Go=Ne(),Bg=zg();function J9e(t){if(ace(t)&&(cce(t),sce(t))){Q9e(t);return}oce(t,()=>(0,ice.topBoolOrEmptySchema)(t))}ia.validateFunctionCode=J9e;function oce({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},o){i.code.es5?t.func(e,(0,oe._)`${pe.default.data}, ${pe.default.valCxt}`,n.$async,()=>{t.code((0,oe._)`"use strict"; ${tce(r,i)}`),X9e(t,i),t.code(o)}):t.func(e,(0,oe._)`${pe.default.data}, ${Y9e(i)}`,n.$async,()=>t.code(tce(r,i)).code(o))}function Y9e(t){return(0,oe._)`{${pe.default.instancePath}="", ${pe.default.parentData}, ${pe.default.parentDataProperty}, ${pe.default.rootData}=${pe.default.data}${t.dynamicRef?(0,oe._)`, ${pe.default.dynamicAnchors}={}`:oe.nil}}={}`}function X9e(t,e){t.if(pe.default.valCxt,()=>{t.var(pe.default.instancePath,(0,oe._)`${pe.default.valCxt}.${pe.default.instancePath}`),t.var(pe.default.parentData,(0,oe._)`${pe.default.valCxt}.${pe.default.parentData}`),t.var(pe.default.parentDataProperty,(0,oe._)`${pe.default.valCxt}.${pe.default.parentDataProperty}`),t.var(pe.default.rootData,(0,oe._)`${pe.default.valCxt}.${pe.default.rootData}`),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,oe._)`${pe.default.valCxt}.${pe.default.dynamicAnchors}`)},()=>{t.var(pe.default.instancePath,(0,oe._)`""`),t.var(pe.default.parentData,(0,oe._)`undefined`),t.var(pe.default.parentDataProperty,(0,oe._)`undefined`),t.var(pe.default.rootData,pe.default.data),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,oe._)`{}`)})}function Q9e(t){let{schema:e,opts:r,gen:n}=t;oce(t,()=>{r.$comment&&e.$comment&&uce(t),iVe(t),n.let(pe.default.vErrors,null),n.let(pe.default.errors,0),r.unevaluated&&eVe(t),lce(t),aVe(t)})}function eVe(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,oe._)`${r}.evaluated`),e.if((0,oe._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,oe._)`${t.evaluated}.props`,(0,oe._)`undefined`)),e.if((0,oe._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,oe._)`${t.evaluated}.items`,(0,oe._)`undefined`))}function tce(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,oe._)`/*# sourceURL=${r} */`:oe.nil}function tVe(t,e){if(ace(t)&&(cce(t),sce(t))){rVe(t,e);return}(0,ice.boolOrEmptySchema)(t,e)}function sce({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function ace(t){return typeof t.schema!="boolean"}function rVe(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&uce(t),oVe(t),sVe(t);let o=n.const("_errs",pe.default.errors);lce(t,o),n.var(e,(0,oe._)`${o} === ${pe.default.errors}`)}function cce(t){(0,Go.checkUnknownRules)(t),nVe(t)}function lce(t,e){if(t.opts.jtd)return rce(t,[],!1,e);let r=(0,ece.getSchemaTypes)(t.schema),n=(0,ece.coerceAndCheckDataType)(t,r);rce(t,r,!n,e)}function nVe(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Go.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function iVe(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Go.checkStrictMode)(t,"default is ignored in the schema root")}function oVe(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,K9e.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function sVe(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function uce({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let o=r.$comment;if(i.$comment===!0)t.code((0,oe._)`${pe.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){let s=(0,oe.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,oe._)`${pe.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function aVe(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=t;r.$async?e.if((0,oe._)`${pe.default.errors} === 0`,()=>e.return(pe.default.data),()=>e.throw((0,oe._)`new ${i}(${pe.default.vErrors})`)):(e.assign((0,oe._)`${n}.errors`,pe.default.vErrors),o.unevaluated&&cVe(t),e.return((0,oe._)`${pe.default.errors} === 0`))}function cVe({gen:t,evaluated:e,props:r,items:n}){r instanceof oe.Name&&t.assign((0,oe._)`${e}.props`,r),n instanceof oe.Name&&t.assign((0,oe._)`${e}.items`,n)}function rce(t,e,r,n){let{gen:i,schema:o,data:s,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,Go.schemaHasRulesButRef)(o,u))){i.block(()=>fce(t,"$ref",u.all.$ref.definition));return}c.jtd||lVe(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,vU.shouldUseGroup)(o,f)&&(f.type?(i.if((0,zE.checkDataType)(f.type,s,c.strictNumbers)),nce(t,f),e.length===1&&e[0]===f.type&&r&&(i.else(),(0,zE.reportTypeError)(t)),i.endIf()):nce(t,f),a||i.if((0,oe._)`${pe.default.errors} === ${n||0}`))}}function nce(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,W9e.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,vU.shouldUseRule)(n,o)&&fce(t,o.keyword,o.definition,e.type)})}function lVe(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(uVe(t,e),t.opts.allowUnionTypes||dVe(t,e),fVe(t,t.dataTypes))}function uVe(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{dce(t.dataTypes,r)||SU(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),mVe(t,e)}}function dVe(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&SU(t,"use allowUnionTypes to allow union type keyword")}function fVe(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,vU.shouldUseRule)(t.schema,i)){let{type:o}=i.definition;o.length&&!o.some(s=>pVe(e,s))&&SU(t,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function pVe(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function dce(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function mVe(t,e){let r=[];for(let n of t.dataTypes)dce(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function SU(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Go.checkStrictMode)(t,e,t.opts.strictTypes)}var UE=class{constructor(e,r,n){if((0,Hg.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Go.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",pce(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Hg.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",pe.default.errors))}result(e,r,n){this.failResult((0,oe.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,oe.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,oe._)`${r} !== undefined && (${(0,oe.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Bg.reportExtraError:Bg.reportError)(this,this.def.error,r)}$dataError(){(0,Bg.reportError)(this,this.def.$dataError||Bg.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Bg.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=oe.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=oe.nil,r=oe.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:o,def:s}=this;n.if((0,oe.or)((0,oe._)`${i} === undefined`,r)),e!==oe.nil&&n.assign(e,!0),(o.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==oe.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:o}=this;return(0,oe.or)(s(),a());function s(){if(n.length){if(!(r instanceof oe.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,oe._)`${(0,zE.checkDataTypes)(c,r,o.opts.strictNumbers,zE.DataType.Wrong)}`}return oe.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,oe._)`!${c}(${r})`}return oe.nil}}subschema(e,r){let n=(0,bU.getSubschema)(this.it,e);(0,bU.extendSubschemaData)(n,this.it,e),(0,bU.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return tVe(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Go.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Go.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,oe.Name)),!0}};ia.KeywordCxt=UE;function fce(t,e,r,n){let i=new UE(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Hg.funcKeywordCode)(i,r):"macro"in r?(0,Hg.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Hg.funcKeywordCode)(i,r)}var hVe=/^\/(?:[^~]|~0|~1)*$/,gVe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function pce(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,o;if(t==="")return pe.default.rootData;if(t[0]==="/"){if(!hVe.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,o=pe.default.rootData}else{let l=gVe.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=e)throw new Error(c("property/index",u));return n[e-u]}if(u>e)throw new Error(c("data",u));if(o=r[e-u],!i)return o}let s=o,a=i.split("/");for(let l of a)l&&(o=(0,oe._)`${o}${(0,oe.getProperty)((0,Go.unescapeJsonPointer)(l))}`,s=(0,oe._)`${s} && ${o}`);return s;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}ia.getData=pce});var qE=v(xU=>{"use strict";Object.defineProperty(xU,"__esModule",{value:!0});var wU=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};xU.default=wU});var Zg=v(EU=>{"use strict";Object.defineProperty(EU,"__esModule",{value:!0});var $U=qg(),kU=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,$U.resolveUrl)(e,r,n),this.missingSchema=(0,$U.normalizeId)((0,$U.getFullPath)(e,this.missingRef))}};EU.default=kU});var HE=v(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.resolveSchema=Zn.getCompilingSchema=Zn.resolveRef=Zn.compileSchema=Zn.SchemaEnv=void 0;var vi=we(),yVe=qE(),Gc=Ho(),Si=qg(),mce=Ne(),_Ve=Gg(),Bd=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Si.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Zn.SchemaEnv=Bd;function TU(t){let e=hce.call(this,t);if(e)return e;let r=(0,Si.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,s=new vi.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o}),a;t.$async&&(a=s.scopeValue("Error",{ref:yVe.default,code:(0,vi._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");t.validateName=c;let l={gen:s,allErrors:this.opts.allErrors,data:Gc.default.data,parentData:Gc.default.parentData,parentDataProperty:Gc.default.parentDataProperty,dataNames:[Gc.default.data],dataPathArr:[vi.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,vi.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:vi.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,vi._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,_Ve.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();u=`${s.scopeRefs(Gc.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let p=new Function(`${Gc.default.self}`,`${Gc.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:m,items:h}=l;p.evaluated={props:m instanceof vi.Name?void 0:m,items:h instanceof vi.Name?void 0:h,dynamicProps:m instanceof vi.Name,dynamicItems:h instanceof vi.Name},p.source&&(p.source.evaluated=(0,vi.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}Zn.compileSchema=TU;function bVe(t,e,r){var n;r=(0,Si.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let o=wVe.call(this,t,r);if(o===void 0){let s=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(o=new Bd({schema:s,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=vVe.call(this,o)}Zn.resolveRef=bVe;function vVe(t){return(0,Si.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:TU.call(this,t)}function hce(t){for(let e of this._compilations)if(SVe(e,t))return e}Zn.getCompilingSchema=hce;function SVe(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function wVe(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||BE.call(this,t,e)}function BE(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Si._getFullPath)(this.opts.uriResolver,r),i=(0,Si.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return AU.call(this,r,t);let o=(0,Si.normalizeId)(n),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let a=BE.call(this,t,s);return typeof a?.schema!="object"?void 0:AU.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||TU.call(this,s),o===(0,Si.normalizeId)(e)){let{schema:a}=s,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Si.resolveUrl)(this.opts.uriResolver,i,l)),new Bd({schema:a,schemaId:c,root:t,baseId:i})}return AU.call(this,r,s)}}Zn.resolveSchema=BE;var xVe=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function AU(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,mce.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!xVe.has(a)&&l&&(e=(0,Si.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,mce.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Si.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=BE.call(this,n,a)}let{schemaId:s}=this.opts;if(o=o||new Bd({schema:r,schemaId:s,root:n,baseId:e}),o.schema!==o.root.schema)return o}});var gce=v((wRt,$Ve)=>{$Ve.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var IU=v((xRt,wce)=>{"use strict";var kVe=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),_ce=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),OU=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),bce=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),EVe=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function RU(t){let e="",r=0,n=0;for(n=0;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var AVe=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function yce(t){return t.length=0,!0}function TVe(t,e,r){if(t.length){let n=RU(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function OVe(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],o=!1,s=!1,a=TVe;for(let c=0;c7){r.error=!0;break}c>0&&t[c-1]===":"&&(o=!0),n.push(":");continue}else if(l==="%"){if(!a(i,n,r))break;a=yce}else{i.push(l);continue}}return i.length&&(a===yce?r.zone=i.join(""):s?n.push(i.join("")):n.push(RU(i))),r.address=n.join(""),r}function vce(t){if(RVe(t,":")<2)return{host:t,isIPV6:!1};let e=OVe(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function RVe(t,e){let r=0;for(let n=0;nPVe[n])}function NVe(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";var{isUUID:LVe}=IU(),zVe=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,UVe=["http","https","ws","wss","urn","urn:uuid"];function qVe(t){return UVe.indexOf(t)!==-1}function PU(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function xce(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function $ce(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function BVe(t){return t.secure=PU(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function HVe(t){if((t.port===(PU(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function GVe(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(zVe);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,o=CU(i);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function ZVe(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,o=CU(i);o&&(t=o.serialize(t,e));let s=t,a=t.nss;return s.path=`${n||e.nid}:${a}`,e.skipEscape=!0,s}function VVe(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!LVe(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function WVe(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var kce={scheme:"http",domainHost:!0,parse:xce,serialize:$ce},KVe={scheme:"https",domainHost:kce.domainHost,parse:xce,serialize:$ce},GE={scheme:"ws",domainHost:!0,parse:BVe,serialize:HVe},JVe={scheme:"wss",domainHost:GE.domainHost,parse:GE.parse,serialize:GE.serialize},YVe={scheme:"urn",parse:GVe,serialize:ZVe,skipNormalize:!0},XVe={scheme:"urn:uuid",parse:VVe,serialize:WVe,skipNormalize:!0},ZE={http:kce,https:KVe,ws:GE,wss:JVe,urn:YVe,"urn:uuid":XVe};Object.setPrototypeOf(ZE,null);function CU(t){return t&&(ZE[t]||ZE[t.toLowerCase()])||void 0}Ece.exports={wsIsSecure:PU,SCHEMES:ZE,isValidSchemeName:qVe,getSchemeHandler:CU}});var Cce=v((kRt,VE)=>{"use strict";var{normalizeIPv6:QVe,removeDotSegments:Vg,recomposeAuthority:eWe,normalizePercentEncoding:tWe,normalizePathEncoding:rWe,escapePreservingEscapes:nWe,reescapeHostDelimiters:iWe,isIPv4:oWe,nonSimpleDomain:sWe}=IU(),{SCHEMES:aWe,getSchemeHandler:Oce}=Ace();function cWe(t,e){return typeof t=="string"?t=pWe(t,e):typeof t=="object"&&(t=Hd(Zc(t,e),e)),t}function lWe(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Rce(Hd(t,n),Hd(e,n),n,!0);return n.skipEscape=!0,Zc(i,n)}function Rce(t,e,r,n){let i={};return n||(t=Hd(Zc(t,r),r),e=Hd(Zc(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Vg(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Vg(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Vg(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=Vg(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function uWe(t,e,r){let n=Tce(t,r),i=Tce(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function Zc(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],o=Oce(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=tWe(r.path):(r.path=nWe(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let s=eWe(r);if(s!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(s),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(a=Vg(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var dWe=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function fWe(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function Ice(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,o=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(dWe);if(s){n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]);let a=fWe(n,s);if(a!==void 0&&(n.error=n.error||a,i=!0),n.host)if(oWe(n.host)===!1){let u=QVe(n.host);n.host=u.host.toLowerCase(),o=u.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=Oce(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&o===!1&&sWe(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(l){n.error=n.error||"Host's domain name can not be converted to ASCII: "+l}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=iWe(unescape(n.host),o))),n.path&&(n.path=rWe(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function Hd(t,e){return Ice(t,e).parsed}function pWe(t,e){return Pce(t,e).normalized}function Pce(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Ice(t,e);return{normalized:n?t:Zc(r,e),malformedAuthorityOrPort:n}}function Tce(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Pce(t,e);return n?void 0:r}if(typeof t=="object")return Zc(t,e)}var DU={SCHEMES:aWe,normalize:cWe,resolve:lWe,resolveComponent:Rce,equal:uWe,serialize:Zc,parse:Hd};VE.exports=DU;VE.exports.default=DU;VE.exports.fastUri=DU});var Nce=v(NU=>{"use strict";Object.defineProperty(NU,"__esModule",{value:!0});var Dce=Cce();Dce.code='require("ajv/dist/runtime/uri").default';NU.default=Dce});var Bce=v(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.CodeGen=lr.Name=lr.nil=lr.stringify=lr.str=lr._=lr.KeywordCxt=void 0;var mWe=Gg();Object.defineProperty(lr,"KeywordCxt",{enumerable:!0,get:function(){return mWe.KeywordCxt}});var Gd=we();Object.defineProperty(lr,"_",{enumerable:!0,get:function(){return Gd._}});Object.defineProperty(lr,"str",{enumerable:!0,get:function(){return Gd.str}});Object.defineProperty(lr,"stringify",{enumerable:!0,get:function(){return Gd.stringify}});Object.defineProperty(lr,"nil",{enumerable:!0,get:function(){return Gd.nil}});Object.defineProperty(lr,"Name",{enumerable:!0,get:function(){return Gd.Name}});Object.defineProperty(lr,"CodeGen",{enumerable:!0,get:function(){return Gd.CodeGen}});var hWe=qE(),zce=Zg(),gWe=lU(),Wg=HE(),yWe=we(),Kg=qg(),WE=Ug(),MU=Ne(),jce=gce(),_We=Nce(),Uce=(t,e)=>new RegExp(t,e);Uce.code="new RegExp";var bWe=["removeAdditional","useDefaults","coerceTypes"],vWe=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),SWe={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},wWe={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Mce=200;function xWe(t){var e,r,n,i,o,s,a,c,l,u,d,f,p,m,h,g,b,_,S,x,w,O,T,A,D;let $=t.strict,ie=(e=t.code)===null||e===void 0?void 0:e.optimize,K=ie===!0||ie===void 0?1:ie||0,xe=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Uce,C=(i=t.uriResolver)!==null&&i!==void 0?i:_We.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:$)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:$)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:$)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:$)!==null&&f!==void 0?f:"log",strictRequired:(m=(p=t.strictRequired)!==null&&p!==void 0?p:$)!==null&&m!==void 0?m:!1,code:t.code?{...t.code,optimize:K,regExp:xe}:{optimize:K,regExp:xe},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Mce,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Mce,meta:(b=t.meta)!==null&&b!==void 0?b:!0,messages:(_=t.messages)!==null&&_!==void 0?_:!0,inlineRefs:(S=t.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(x=t.schemaId)!==null&&x!==void 0?x:"$id",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(O=t.validateSchema)!==null&&O!==void 0?O:!0,validateFormats:(T=t.validateFormats)!==null&&T!==void 0?T:!0,unicodeRegExp:(A=t.unicodeRegExp)!==null&&A!==void 0?A:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:C}}var Jg=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...xWe(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new yWe.ValueScope({scope:{},prefixes:vWe,es5:r,lines:n}),this.logger=OWe(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,gWe.getRules)(),Fce.call(this,SWe,e,"NOT SUPPORTED"),Fce.call(this,wWe,e,"DEPRECATED","warn"),this._metaOpts=AWe.call(this),e.formats&&kWe.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&EWe.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),$We.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=jce;n==="id"&&(i={...jce},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,d){await o.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||s.call(this,f)}async function o(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function s(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof zce.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,n,i);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return r=(0,Kg.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return i}getSchema(e){let r;for(;typeof(r=Lce.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Wg.SchemaEnv({schema:{},schemaId:n});if(r=Wg.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Lce.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,Kg.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(IWe.call(this,n,r),!r)return(0,MU.eachItem)(n,o=>jU.call(this,o)),this;CWe.call(this,r);let i={...r,type:(0,WE.getJSONTypes)(r.type),schemaType:(0,WE.getJSONTypes)(r.schemaType)};return(0,MU.eachItem)(n,i.type.length===0?o=>jU.call(this,o,i):o=>i.type.forEach(s=>jU.call(this,o,i,s))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(o=>o.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,o)=>i+r+o)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let o=i.split("/").slice(1),s=e;for(let a of o)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=s[a];l&&u&&(s[a]=qce(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof e=="object")s=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,Kg.normalizeId)(s||n);let l=Kg.getSchemaRefs.call(this,e,n);return c=new Wg.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Wg.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Wg.compileSchema.call(this,e)}finally{this.opts=r}}};Jg.ValidationError=hWe.default;Jg.MissingRefError=zce.default;lr.default=Jg;function Fce(t,e,r,n="error"){for(let i in t){let o=i;o in e&&this.logger[n](`${r}: option ${i}. ${t[o]}`)}}function Lce(t){return t=(0,Kg.normalizeId)(t),this.schemas[t]||this.refs[t]}function $We(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function kWe(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function EWe(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function AWe(){let t={...this.opts};for(let e of bWe)delete t[e];return t}var TWe={log(){},warn(){},error(){}};function OWe(t){if(t===!1)return TWe;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var RWe=/^[a-z_$][a-z0-9_$:-]*$/i;function IWe(t,e){let{RULES:r}=this;if((0,MU.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!RWe.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function jU(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=i?o.post:o.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,WE.getJSONTypes)(e.type),schemaType:(0,WE.getJSONTypes)(e.schemaType)}};e.before?PWe.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function PWe(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function CWe(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=qce(e)),t.validateSchema=this.compile(e,!0))}var DWe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function qce(t){return{anyOf:[t,DWe]}}});var Hce=v(FU=>{"use strict";Object.defineProperty(FU,"__esModule",{value:!0});var NWe={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};FU.default=NWe});var Wce=v(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.callRef=Vc.getValidate=void 0;var jWe=Zg(),Gce=Gn(),Yr=we(),Zd=Ho(),Zce=HE(),KE=Ne(),MWe={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:o,validateName:s,opts:a,self:c}=n,{root:l}=o;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=Zce.resolveRef.call(c,l,i,r);if(u===void 0)throw new jWe.default(n.opts.uriResolver,i,r);if(u instanceof Zce.SchemaEnv)return f(u);return p(u);function d(){if(o===l)return JE(t,s,o,o.$async);let m=e.scopeValue("root",{ref:l});return JE(t,(0,Yr._)`${m}.validate`,l,l.$async)}function f(m){let h=Vce(t,m);JE(t,h,m,m.$async)}function p(m){let h=e.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,Yr.stringify)(m)}:{ref:m}),g=e.name("valid"),b=t.subschema({schema:m,dataTypes:[],schemaPath:Yr.nil,topSchemaRef:h,errSchemaPath:r},g);t.mergeEvaluated(b),t.ok(g)}}};function Vce(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Yr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Vc.getValidate=Vce;function JE(t,e,r,n){let{gen:i,it:o}=t,{allErrors:s,schemaEnv:a,opts:c}=o,l=c.passContext?Zd.default.this:Yr.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=i.let("valid");i.try(()=>{i.code((0,Yr._)`await ${(0,Gce.callValidateCode)(t,e,l)}`),p(e),s||i.assign(m,!0)},h=>{i.if((0,Yr._)`!(${h} instanceof ${o.ValidationError})`,()=>i.throw(h)),f(h),s||i.assign(m,!1)}),t.ok(m)}function d(){t.result((0,Gce.callValidateCode)(t,e,l),()=>p(e),()=>f(e))}function f(m){let h=(0,Yr._)`${m}.errors`;i.assign(Zd.default.vErrors,(0,Yr._)`${Zd.default.vErrors} === null ? ${h} : ${Zd.default.vErrors}.concat(${h})`),i.assign(Zd.default.errors,(0,Yr._)`${Zd.default.vErrors}.length`)}function p(m){var h;if(!o.opts.unevaluated)return;let g=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(o.props=KE.mergeEvaluated.props(i,g.props,o.props));else{let b=i.var("props",(0,Yr._)`${m}.evaluated.props`);o.props=KE.mergeEvaluated.props(i,b,o.props,Yr.Name)}if(o.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(o.items=KE.mergeEvaluated.items(i,g.items,o.items));else{let b=i.var("items",(0,Yr._)`${m}.evaluated.items`);o.items=KE.mergeEvaluated.items(i,b,o.items,Yr.Name)}}}Vc.callRef=JE;Vc.default=MWe});var Kce=v(LU=>{"use strict";Object.defineProperty(LU,"__esModule",{value:!0});var FWe=Hce(),LWe=Wce(),zWe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",FWe.default,LWe.default];LU.default=zWe});var Jce=v(zU=>{"use strict";Object.defineProperty(zU,"__esModule",{value:!0});var YE=we(),oa=YE.operators,XE={maximum:{okStr:"<=",ok:oa.LTE,fail:oa.GT},minimum:{okStr:">=",ok:oa.GTE,fail:oa.LT},exclusiveMaximum:{okStr:"<",ok:oa.LT,fail:oa.GTE},exclusiveMinimum:{okStr:">",ok:oa.GT,fail:oa.LTE}},UWe={message:({keyword:t,schemaCode:e})=>(0,YE.str)`must be ${XE[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,YE._)`{comparison: ${XE[t].okStr}, limit: ${e}}`},qWe={keyword:Object.keys(XE),type:"number",schemaType:"number",$data:!0,error:UWe,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,YE._)`${r} ${XE[e].fail} ${n} || isNaN(${r})`)}};zU.default=qWe});var Yce=v(UU=>{"use strict";Object.defineProperty(UU,"__esModule",{value:!0});var Yg=we(),BWe={message:({schemaCode:t})=>(0,Yg.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Yg._)`{multipleOf: ${t}}`},HWe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:BWe,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,Yg._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,Yg._)`${s} !== parseInt(${s})`;t.fail$data((0,Yg._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};UU.default=HWe});var Qce=v(qU=>{"use strict";Object.defineProperty(qU,"__esModule",{value:!0});function Xce(t){let e=t.length,r=0,n=0,i;for(;n=55296&&i<=56319&&n{"use strict";Object.defineProperty(BU,"__esModule",{value:!0});var Wc=we(),GWe=Ne(),ZWe=Qce(),VWe={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Wc.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Wc._)`{limit: ${t}}`},WWe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:VWe,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,o=e==="maxLength"?Wc.operators.GT:Wc.operators.LT,s=i.opts.unicode===!1?(0,Wc._)`${r}.length`:(0,Wc._)`${(0,GWe.useFunc)(t.gen,ZWe.default)}(${r})`;t.fail$data((0,Wc._)`${s} ${o} ${n}`)}};BU.default=WWe});var tle=v(HU=>{"use strict";Object.defineProperty(HU,"__esModule",{value:!0});var KWe=Gn(),JWe=Ne(),Vd=we(),YWe={message:({schemaCode:t})=>(0,Vd.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Vd._)`{pattern: ${t}}`},XWe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:YWe,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t,a=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=s.opts.code,l=c.code==="new RegExp"?(0,Vd._)`new RegExp`:(0,JWe.useFunc)(e,c),u=e.let("valid");e.try(()=>e.assign(u,(0,Vd._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Vd._)`!${u}`)}else{let c=(0,KWe.usePattern)(t,i);t.fail$data((0,Vd._)`!${c}.test(${r})`)}}};HU.default=XWe});var rle=v(GU=>{"use strict";Object.defineProperty(GU,"__esModule",{value:!0});var Xg=we(),QWe={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Xg.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Xg._)`{limit: ${t}}`},e3e={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:QWe,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Xg.operators.GT:Xg.operators.LT;t.fail$data((0,Xg._)`Object.keys(${r}).length ${i} ${n}`)}};GU.default=e3e});var nle=v(ZU=>{"use strict";Object.defineProperty(ZU,"__esModule",{value:!0});var Qg=Gn(),ey=we(),t3e=Ne(),r3e={message:({params:{missingProperty:t}})=>(0,ey.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ey._)`{missingProperty: ${t}}`},n3e={keyword:"required",type:"object",schemaType:"array",$data:!0,error:r3e,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:o,it:s}=t,{opts:a}=s;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?l():u(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:m}=t.it;for(let h of r)if(p?.[h]===void 0&&!m.has(h)){let g=s.schemaEnv.baseId+s.errSchemaPath,b=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,t3e.checkStrictMode)(s,b,s.opts.strictRequired)}}function l(){if(c||o)t.block$data(ey.nil,d);else for(let p of r)(0,Qg.checkReportMissingProp)(t,p)}function u(){let p=e.let("missing");if(c||o){let m=e.let("valid",!0);t.block$data(m,()=>f(p,m)),t.ok(m)}else e.if((0,Qg.checkMissingProp)(t,r,p)),(0,Qg.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,Qg.noPropertyInData)(e,i,p,a.ownProperties),()=>t.error())})}function f(p,m){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(m,(0,Qg.propertyInData)(e,i,p,a.ownProperties)),e.if((0,ey.not)(m),()=>{t.error(),e.break()})},ey.nil)}}};ZU.default=n3e});var ile=v(VU=>{"use strict";Object.defineProperty(VU,"__esModule",{value:!0});var ty=we(),i3e={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,ty.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,ty._)`{limit: ${t}}`},o3e={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:i3e,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?ty.operators.GT:ty.operators.LT;t.fail$data((0,ty._)`${r}.length ${i} ${n}`)}};VU.default=o3e});var QE=v(WU=>{"use strict";Object.defineProperty(WU,"__esModule",{value:!0});var ole=yU();ole.code='require("ajv/dist/runtime/equal").default';WU.default=ole});var sle=v(JU=>{"use strict";Object.defineProperty(JU,"__esModule",{value:!0});var KU=Ug(),ur=we(),s3e=Ne(),a3e=QE(),c3e={message:({params:{i:t,j:e}})=>(0,ur.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,ur._)`{i: ${t}, j: ${e}}`},l3e={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:c3e,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:o,schemaCode:s,it:a}=t;if(!n&&!i)return;let c=e.let("valid"),l=o.items?(0,KU.getSchemaTypes)(o.items):[];t.block$data(c,u,(0,ur._)`${s} === false`),t.ok(c);function u(){let m=e.let("i",(0,ur._)`${r}.length`),h=e.let("j");t.setParams({i:m,j:h}),e.assign(c,!0),e.if((0,ur._)`${m} > 1`,()=>(d()?f:p)(m,h))}function d(){return l.length>0&&!l.some(m=>m==="object"||m==="array")}function f(m,h){let g=e.name("item"),b=(0,KU.checkDataTypes)(l,g,a.opts.strictNumbers,KU.DataType.Wrong),_=e.const("indices",(0,ur._)`{}`);e.for((0,ur._)`;${m}--;`,()=>{e.let(g,(0,ur._)`${r}[${m}]`),e.if(b,(0,ur._)`continue`),l.length>1&&e.if((0,ur._)`typeof ${g} == "string"`,(0,ur._)`${g} += "_"`),e.if((0,ur._)`typeof ${_}[${g}] == "number"`,()=>{e.assign(h,(0,ur._)`${_}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,ur._)`${_}[${g}] = ${m}`)})}function p(m,h){let g=(0,s3e.useFunc)(e,a3e.default),b=e.name("outer");e.label(b).for((0,ur._)`;${m}--;`,()=>e.for((0,ur._)`${h} = ${m}; ${h}--;`,()=>e.if((0,ur._)`${g}(${r}[${m}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(b)})))}}};JU.default=l3e});var ale=v(XU=>{"use strict";Object.defineProperty(XU,"__esModule",{value:!0});var YU=we(),u3e=Ne(),d3e=QE(),f3e={message:"must be equal to constant",params:({schemaCode:t})=>(0,YU._)`{allowedValue: ${t}}`},p3e={keyword:"const",$data:!0,error:f3e,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:o}=t;n||o&&typeof o=="object"?t.fail$data((0,YU._)`!${(0,u3e.useFunc)(e,d3e.default)}(${r}, ${i})`):t.fail((0,YU._)`${o} !== ${r}`)}};XU.default=p3e});var cle=v(QU=>{"use strict";Object.defineProperty(QU,"__esModule",{value:!0});var ry=we(),m3e=Ne(),h3e=QE(),g3e={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,ry._)`{allowedValues: ${t}}`},y3e={keyword:"enum",schemaType:"array",$data:!0,error:g3e,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=s.opts.loopEnum,c,l=()=>c??(c=(0,m3e.useFunc)(e,h3e.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",o);u=(0,ry.or)(...i.map((m,h)=>f(p,h)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",o,p=>e.if((0,ry._)`${l()}(${r}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,m){let h=i[m];return typeof h=="object"&&h!==null?(0,ry._)`${l()}(${r}, ${p}[${m}])`:(0,ry._)`${r} === ${h}`}}};QU.default=y3e});var lle=v(eq=>{"use strict";Object.defineProperty(eq,"__esModule",{value:!0});var _3e=Jce(),b3e=Yce(),v3e=ele(),S3e=tle(),w3e=rle(),x3e=nle(),$3e=ile(),k3e=sle(),E3e=ale(),A3e=cle(),T3e=[_3e.default,b3e.default,v3e.default,S3e.default,w3e.default,x3e.default,$3e.default,k3e.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},E3e.default,A3e.default];eq.default=T3e});var rq=v(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});ny.validateAdditionalItems=void 0;var Kc=we(),tq=Ne(),O3e={message:({params:{len:t}})=>(0,Kc.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Kc._)`{limit: ${t}}`},R3e={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:O3e,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,tq.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ule(t,n)}};function ule(t,e){let{gen:r,schema:n,data:i,keyword:o,it:s}=t;s.items=!0;let a=r.const("len",(0,Kc._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Kc._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,tq.alwaysValidSchema)(s,n)){let l=r.var("valid",(0,Kc._)`${a} <= ${e.length}`);r.if((0,Kc.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:tq.Type.Num},l),s.allErrors||r.if((0,Kc.not)(l),()=>r.break())})}}ny.validateAdditionalItems=ule;ny.default=R3e});var nq=v(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.validateTuple=void 0;var dle=we(),eA=Ne(),I3e=Gn(),P3e={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return fle(t,"additionalItems",e);r.items=!0,!(0,eA.alwaysValidSchema)(r,e)&&t.ok((0,I3e.validateArray)(t))}};function fle(t,e,r=t.schema){let{gen:n,parentSchema:i,data:o,keyword:s,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=eA.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,dle._)`${o}.length`);r.forEach((d,f)=>{(0,eA.alwaysValidSchema)(a,d)||(n.if((0,dle._)`${l} > ${f}`,()=>t.subschema({keyword:s,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,m=r.length,h=m===d.minItems&&(m===d.maxItems||d[e]===!1);if(f.strictTuples&&!h){let g=`"${s}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,eA.checkStrictMode)(a,g,f.strictTuples)}}}iy.validateTuple=fle;iy.default=P3e});var ple=v(iq=>{"use strict";Object.defineProperty(iq,"__esModule",{value:!0});var C3e=nq(),D3e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,C3e.validateTuple)(t,"items")};iq.default=D3e});var hle=v(oq=>{"use strict";Object.defineProperty(oq,"__esModule",{value:!0});var mle=we(),N3e=Ne(),j3e=Gn(),M3e=rq(),F3e={message:({params:{len:t}})=>(0,mle.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,mle._)`{limit: ${t}}`},L3e={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:F3e,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,N3e.alwaysValidSchema)(n,e)&&(i?(0,M3e.validateAdditionalItems)(t,i):t.ok((0,j3e.validateArray)(t)))}};oq.default=L3e});var gle=v(sq=>{"use strict";Object.defineProperty(sq,"__esModule",{value:!0});var Vn=we(),tA=Ne(),z3e={message:({params:{min:t,max:e}})=>e===void 0?(0,Vn.str)`must contain at least ${t} valid item(s)`:(0,Vn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Vn._)`{minContains: ${t}}`:(0,Vn._)`{minContains: ${t}, maxContains: ${e}}`},U3e={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:z3e,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t,s,a,{minContains:c,maxContains:l}=n;o.opts.next?(s=c===void 0?1:c,a=l):s=1;let u=e.const("len",(0,Vn._)`${i}.length`);if(t.setParams({min:s,max:a}),a===void 0&&s===0){(0,tA.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,tA.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,tA.alwaysValidSchema)(o,r)){let h=(0,Vn._)`${u} >= ${s}`;a!==void 0&&(h=(0,Vn._)`${h} && ${u} <= ${a}`),t.pass(h);return}o.items=!0;let d=e.name("valid");a===void 0&&s===1?p(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),a!==void 0&&e.if((0,Vn._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let h=e.name("_valid"),g=e.let("count",0);p(h,()=>e.if(h,()=>m(g)))}function p(h,g){e.forRange("i",0,u,b=>{t.subschema({keyword:"contains",dataProp:b,dataPropType:tA.Type.Num,compositeRule:!0},h),g()})}function m(h){e.code((0,Vn._)`${h}++`),a===void 0?e.if((0,Vn._)`${h} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,Vn._)`${h} > ${a}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,Vn._)`${h} >= ${s}`,()=>e.assign(d,!0)))}}};sq.default=U3e});var ble=v(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.validateSchemaDeps=oo.validatePropertyDeps=oo.error=void 0;var aq=we(),q3e=Ne(),oy=Gn();oo.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,aq.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,aq._)`{property: ${t}, + || ${s} === "boolean" || ${i} === null`).assign(a,(0,Se._)`[${i}]`)}}}function u9e({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Se._)`${e} !== undefined`,()=>t.assign((0,Se._)`${e}[${r}]`,n))}function dU(t,e,r,n=zd.Correct){let i=n===zd.Correct?Se.operators.EQ:Se.operators.NEQ,o;switch(t){case"null":return(0,Se._)`${e} ${i} null`;case"array":o=(0,Se._)`Array.isArray(${e})`;break;case"object":o=(0,Se._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,Se._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,Se._)`typeof ${e} ${i} ${t}`}return n===zd.Correct?o:(0,Se.not)(o);function s(a=Se.nil){return(0,Se.and)((0,Se._)`typeof ${e} == "number"`,a,r?(0,Se._)`isFinite(${e})`:Se.nil)}}br.checkDataType=dU;function fU(t,e,r,n){if(t.length===1)return dU(t[0],e,r,n);let i,o=(0,jae.toHash)(t);if(o.array&&o.object){let s=(0,Se._)`typeof ${e} != "object"`;i=o.null?s:(0,Se._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else i=Se.nil;o.number&&delete o.integer;for(let s in o)i=(0,Se.and)(i,dU(s,e,r,n));return i}br.checkDataTypes=fU;var d9e={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Se._)`{type: ${t}}`:(0,Se._)`{type: ${e}}`};function pU(t){let e=f9e(t);(0,o9e.reportError)(e,d9e)}br.reportTypeError=pU;function f9e(t){let{gen:e,data:r,schema:n}=t,i=(0,jae.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var zae=v(FE=>{"use strict";Object.defineProperty(FE,"__esModule",{value:!0});FE.assignDefaults=void 0;var Ud=we(),p9e=Ne();function m9e(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)Lae(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,o)=>Lae(t,o,i.default))}FE.assignDefaults=m9e;function Lae(t,e,r){let{gen:n,compositeRule:i,data:o,opts:s}=t;if(r===void 0)return;let a=(0,Ud._)`${o}${(0,Ud.getProperty)(e)}`;if(i){(0,p9e.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Ud._)`${a} === undefined`;s.useDefaults==="empty"&&(c=(0,Ud._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Ud._)`${a} = ${(0,Ud.stringify)(r)}`)}});var Gn=v(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.validateUnion=nt.validateArray=nt.usePattern=nt.callValidateCode=nt.schemaProperties=nt.allSchemaProperties=nt.noPropertyInData=nt.propertyInData=nt.isOwnProperty=nt.hasPropFunc=nt.reportMissingProp=nt.checkMissingProp=nt.checkReportMissingProp=void 0;var ft=we(),mU=Ne(),ta=Ho(),h9e=Ne();function g9e(t,e){let{gen:r,data:n,it:i}=t;r.if(gU(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ft._)`${e}`},!0),t.error()})}nt.checkReportMissingProp=g9e;function y9e({gen:t,data:e,it:{opts:r}},n,i){return(0,ft.or)(...n.map(o=>(0,ft.and)(gU(t,e,o,r.ownProperties),(0,ft._)`${i} = ${o}`)))}nt.checkMissingProp=y9e;function _9e(t,e){t.setParams({missingProperty:e},!0),t.error()}nt.reportMissingProp=_9e;function Uae(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ft._)`Object.prototype.hasOwnProperty`})}nt.hasPropFunc=Uae;function hU(t,e,r){return(0,ft._)`${Uae(t)}.call(${e}, ${r})`}nt.isOwnProperty=hU;function b9e(t,e,r,n){let i=(0,ft._)`${e}${(0,ft.getProperty)(r)} !== undefined`;return n?(0,ft._)`${i} && ${hU(t,e,r)}`:i}nt.propertyInData=b9e;function gU(t,e,r,n){let i=(0,ft._)`${e}${(0,ft.getProperty)(r)} === undefined`;return n?(0,ft.or)(i,(0,ft.not)(hU(t,e,r))):i}nt.noPropertyInData=gU;function qae(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}nt.allSchemaProperties=qae;function v9e(t,e){return qae(e).filter(r=>!(0,mU.alwaysValidSchema)(t,e[r]))}nt.schemaProperties=v9e;function S9e({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:s},a,c,l){let u=l?(0,ft._)`${t}, ${e}, ${n}${i}`:e,d=[[ta.default.instancePath,(0,ft.strConcat)(ta.default.instancePath,o)],[ta.default.parentData,s.parentData],[ta.default.parentDataProperty,s.parentDataProperty],[ta.default.rootData,ta.default.rootData]];s.opts.dynamicRef&&d.push([ta.default.dynamicAnchors,ta.default.dynamicAnchors]);let f=(0,ft._)`${u}, ${r.object(...d)}`;return c!==ft.nil?(0,ft._)`${a}.call(${c}, ${f})`:(0,ft._)`${a}(${f})`}nt.callValidateCode=S9e;var w9e=(0,ft._)`new RegExp`;function x9e({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,o=i(r,n);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,ft._)`${i.code==="new RegExp"?w9e:(0,h9e.useFunc)(t,i)}(${r}, ${n})`})}nt.usePattern=x9e;function $9e(t){let{gen:e,data:r,keyword:n,it:i}=t,o=e.name("valid");if(i.allErrors){let a=e.let("valid",!0);return s(()=>e.assign(a,!1)),a}return e.var(o,!0),s(()=>e.break()),o;function s(a){let c=e.const("len",(0,ft._)`${r}.length`);e.forRange("i",0,c,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:mU.Type.Num},o),e.if((0,ft.not)(o),a)})}}nt.validateArray=$9e;function k9e(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,mU.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let s=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,l)=>{let u=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(s,(0,ft._)`${s} || ${a}`),t.mergeValidEvaluated(u,a)||e.if((0,ft.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}nt.validateUnion=k9e});var Gae=v(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.validateKeywordUsage=no.validSchemaType=no.funcKeywordCode=no.macroKeywordCode=void 0;var Rr=we(),Hc=Ho(),E9e=Gn(),A9e=zg();function T9e(t,e){let{gen:r,keyword:n,schema:i,parentSchema:o,it:s}=t,a=e.macro.call(s.self,i,o,s),c=Hae(r,n,a);s.opts.validateSchema!==!1&&s.self.validateSchema(a,!0);let l=r.name("valid");t.subschema({schema:a,schemaPath:Rr.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}no.macroKeywordCode=T9e;function O9e(t,e){var r;let{gen:n,keyword:i,schema:o,parentSchema:s,$data:a,it:c}=t;I9e(c,e);let l=!a&&e.compile?e.compile.call(c.self,o,s,c):e.validate,u=Hae(n,i,l),d=n.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)h(),e.modifying&&Bae(t),g(()=>t.error());else{let b=e.async?p():m();e.modifying&&Bae(t),g(()=>R9e(t,b))}}function p(){let b=n.let("ruleErrs",null);return n.try(()=>h((0,Rr._)`await `),_=>n.assign(d,!1).if((0,Rr._)`${_} instanceof ${c.ValidationError}`,()=>n.assign(b,(0,Rr._)`${_}.errors`),()=>n.throw(_))),b}function m(){let b=(0,Rr._)`${u}.errors`;return n.assign(b,null),h(Rr.nil),b}function h(b=e.async?(0,Rr._)`await `:Rr.nil){let _=c.opts.passContext?Hc.default.this:Hc.default.self,S=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Rr._)`${b}${(0,E9e.callValidateCode)(t,u,_,S)}`,e.modifying)}function g(b){var _;n.if((0,Rr.not)((_=e.valid)!==null&&_!==void 0?_:d),b)}}no.funcKeywordCode=O9e;function Bae(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Rr._)`${n.parentData}[${n.parentDataProperty}]`))}function R9e(t,e){let{gen:r}=t;r.if((0,Rr._)`Array.isArray(${e})`,()=>{r.assign(Hc.default.vErrors,(0,Rr._)`${Hc.default.vErrors} === null ? ${e} : ${Hc.default.vErrors}.concat(${e})`).assign(Hc.default.errors,(0,Rr._)`${Hc.default.vErrors}.length`),(0,A9e.extendErrors)(t)},()=>t.error())}function I9e({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Hae(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Rr.stringify)(r)})}function P9e(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}no.validSchemaType=P9e;function C9e({schema:t,opts:e,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");let s=i.dependencies;if(s?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}no.validateKeywordUsage=C9e});var Vae=v(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.extendSubschemaMode=ra.extendSubschemaData=ra.getSubschema=void 0;var io=we(),Zae=Ne();function D9e(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,io._)`${t.schemaPath}${(0,io.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,io._)`${t.schemaPath}${(0,io.getProperty)(e)}${(0,io.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Zae.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}ra.getSubschema=D9e;function N9e(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:s}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=e,f=a.let("data",(0,io._)`${e.data}${(0,io.getProperty)(r)}`,!0);c(f),t.errorPath=(0,io.str)`${l}${(0,Zae.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,io._)`${r}`,t.dataPathArr=[...u,t.parentDataProperty]}if(i!==void 0){let l=i instanceof io.Name?i:a.let("data",i,!0);c(l),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function c(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}}ra.extendSubschemaData=N9e;function j9e(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}ra.extendSubschemaMode=j9e});var yU=v((hRt,Wae)=>{"use strict";Wae.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var s=o[i];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var Jae=v((gRt,Kae)=>{"use strict";var na=Kae.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};LE(e,n,i,t,"",t)};na.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};na.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};na.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};na.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function LE(t,e,r,n,i,o,s,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,o,s,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in na.arrayKeywords)for(var f=0;f{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.getSchemaRefs=Jr.resolveUrl=Jr.normalizeId=Jr._getFullPath=Jr.getFullPath=Jr.inlineRef=void 0;var F9e=Ne(),L9e=yU(),z9e=Jae(),U9e=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function q9e(t,e=!0){return typeof t=="boolean"?!0:e===!0?!_U(t):e?Yae(t)<=e:!1}Jr.inlineRef=q9e;var B9e=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function _U(t){for(let e in t){if(B9e.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(_U)||typeof r=="object"&&_U(r))return!0}return!1}function Yae(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!U9e.has(r)&&(typeof t[r]=="object"&&(0,F9e.eachItem)(t[r],n=>e+=Yae(n)),e===1/0))return 1/0}return e}function Xae(t,e="",r){r!==!1&&(e=qd(e));let n=t.parse(e);return Qae(t,n)}Jr.getFullPath=Xae;function Qae(t,e){return t.serialize(e).split("#")[0]+"#"}Jr._getFullPath=Qae;var H9e=/#\/?$/;function qd(t){return t?t.replace(H9e,""):""}Jr.normalizeId=qd;function G9e(t,e,r){return r=qd(r),t.resolve(e,r)}Jr.resolveUrl=G9e;var Z9e=/^[a-z_][-a-z0-9._]*$/i;function V9e(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=qd(t[r]||e),o={"":i},s=Xae(n,i,!1),a={},c=new Set;return z9e(t,{allKeys:!0},(d,f,p,m)=>{if(m===void 0)return;let h=s+f,g=o[m];typeof d[r]=="string"&&(g=b.call(this,d[r])),_.call(this,d.$anchor),_.call(this,d.$dynamicAnchor),o[f]=g;function b(S){let x=this.opts.uriResolver.resolve;if(S=qd(g?x(g,S):S),c.has(S))throw u(S);c.add(S);let w=this.refs[S];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?l(d,w.schema,S):S!==qd(h)&&(S[0]==="#"?(l(d,a[S],S),a[S]=d):this.refs[S]=h),S}function _(S){if(typeof S=="string"){if(!Z9e.test(S))throw new Error(`invalid anchor "${S}"`);b.call(this,`#${S}`)}}}),a;function l(d,f,p){if(f!==void 0&&!L9e(d,f))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Jr.getSchemaRefs=V9e});var Gg=v(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.getData=ia.KeywordCxt=ia.validateFunctionCode=void 0;var ice=Cae(),ece=Ug(),vU=uU(),zE=Ug(),W9e=zae(),Hg=Gae(),bU=Vae(),oe=we(),pe=Ho(),K9e=qg(),Go=Ne(),Bg=zg();function J9e(t){if(ace(t)&&(cce(t),sce(t))){Q9e(t);return}oce(t,()=>(0,ice.topBoolOrEmptySchema)(t))}ia.validateFunctionCode=J9e;function oce({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},o){i.code.es5?t.func(e,(0,oe._)`${pe.default.data}, ${pe.default.valCxt}`,n.$async,()=>{t.code((0,oe._)`"use strict"; ${tce(r,i)}`),X9e(t,i),t.code(o)}):t.func(e,(0,oe._)`${pe.default.data}, ${Y9e(i)}`,n.$async,()=>t.code(tce(r,i)).code(o))}function Y9e(t){return(0,oe._)`{${pe.default.instancePath}="", ${pe.default.parentData}, ${pe.default.parentDataProperty}, ${pe.default.rootData}=${pe.default.data}${t.dynamicRef?(0,oe._)`, ${pe.default.dynamicAnchors}={}`:oe.nil}}={}`}function X9e(t,e){t.if(pe.default.valCxt,()=>{t.var(pe.default.instancePath,(0,oe._)`${pe.default.valCxt}.${pe.default.instancePath}`),t.var(pe.default.parentData,(0,oe._)`${pe.default.valCxt}.${pe.default.parentData}`),t.var(pe.default.parentDataProperty,(0,oe._)`${pe.default.valCxt}.${pe.default.parentDataProperty}`),t.var(pe.default.rootData,(0,oe._)`${pe.default.valCxt}.${pe.default.rootData}`),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,oe._)`${pe.default.valCxt}.${pe.default.dynamicAnchors}`)},()=>{t.var(pe.default.instancePath,(0,oe._)`""`),t.var(pe.default.parentData,(0,oe._)`undefined`),t.var(pe.default.parentDataProperty,(0,oe._)`undefined`),t.var(pe.default.rootData,pe.default.data),e.dynamicRef&&t.var(pe.default.dynamicAnchors,(0,oe._)`{}`)})}function Q9e(t){let{schema:e,opts:r,gen:n}=t;oce(t,()=>{r.$comment&&e.$comment&&uce(t),iVe(t),n.let(pe.default.vErrors,null),n.let(pe.default.errors,0),r.unevaluated&&eVe(t),lce(t),aVe(t)})}function eVe(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,oe._)`${r}.evaluated`),e.if((0,oe._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,oe._)`${t.evaluated}.props`,(0,oe._)`undefined`)),e.if((0,oe._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,oe._)`${t.evaluated}.items`,(0,oe._)`undefined`))}function tce(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,oe._)`/*# sourceURL=${r} */`:oe.nil}function tVe(t,e){if(ace(t)&&(cce(t),sce(t))){rVe(t,e);return}(0,ice.boolOrEmptySchema)(t,e)}function sce({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function ace(t){return typeof t.schema!="boolean"}function rVe(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&uce(t),oVe(t),sVe(t);let o=n.const("_errs",pe.default.errors);lce(t,o),n.var(e,(0,oe._)`${o} === ${pe.default.errors}`)}function cce(t){(0,Go.checkUnknownRules)(t),nVe(t)}function lce(t,e){if(t.opts.jtd)return rce(t,[],!1,e);let r=(0,ece.getSchemaTypes)(t.schema),n=(0,ece.coerceAndCheckDataType)(t,r);rce(t,r,!n,e)}function nVe(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Go.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function iVe(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Go.checkStrictMode)(t,"default is ignored in the schema root")}function oVe(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,K9e.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function sVe(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function uce({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let o=r.$comment;if(i.$comment===!0)t.code((0,oe._)`${pe.default.self}.logger.log(${o})`);else if(typeof i.$comment=="function"){let s=(0,oe.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,oe._)`${pe.default.self}.opts.$comment(${o}, ${s}, ${a}.schema)`)}}function aVe(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=t;r.$async?e.if((0,oe._)`${pe.default.errors} === 0`,()=>e.return(pe.default.data),()=>e.throw((0,oe._)`new ${i}(${pe.default.vErrors})`)):(e.assign((0,oe._)`${n}.errors`,pe.default.vErrors),o.unevaluated&&cVe(t),e.return((0,oe._)`${pe.default.errors} === 0`))}function cVe({gen:t,evaluated:e,props:r,items:n}){r instanceof oe.Name&&t.assign((0,oe._)`${e}.props`,r),n instanceof oe.Name&&t.assign((0,oe._)`${e}.items`,n)}function rce(t,e,r,n){let{gen:i,schema:o,data:s,allErrors:a,opts:c,self:l}=t,{RULES:u}=l;if(o.$ref&&(c.ignoreKeywordsWithRef||!(0,Go.schemaHasRulesButRef)(o,u))){i.block(()=>fce(t,"$ref",u.all.$ref.definition));return}c.jtd||lVe(t,e),i.block(()=>{for(let f of u.rules)d(f);d(u.post)});function d(f){(0,vU.shouldUseGroup)(o,f)&&(f.type?(i.if((0,zE.checkDataType)(f.type,s,c.strictNumbers)),nce(t,f),e.length===1&&e[0]===f.type&&r&&(i.else(),(0,zE.reportTypeError)(t)),i.endIf()):nce(t,f),a||i.if((0,oe._)`${pe.default.errors} === ${n||0}`))}}function nce(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,W9e.assignDefaults)(t,e.type),r.block(()=>{for(let o of e.rules)(0,vU.shouldUseRule)(n,o)&&fce(t,o.keyword,o.definition,e.type)})}function lVe(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(uVe(t,e),t.opts.allowUnionTypes||dVe(t,e),fVe(t,t.dataTypes))}function uVe(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{dce(t.dataTypes,r)||SU(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),mVe(t,e)}}function dVe(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&SU(t,"use allowUnionTypes to allow union type keyword")}function fVe(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,vU.shouldUseRule)(t.schema,i)){let{type:o}=i.definition;o.length&&!o.some(s=>pVe(e,s))&&SU(t,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function pVe(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function dce(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function mVe(t,e){let r=[];for(let n of t.dataTypes)dce(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function SU(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Go.checkStrictMode)(t,e,t.opts.strictTypes)}var UE=class{constructor(e,r,n){if((0,Hg.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Go.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",pce(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Hg.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",pe.default.errors))}result(e,r,n){this.failResult((0,oe.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,oe.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,oe._)`${r} !== undefined && (${(0,oe.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Bg.reportExtraError:Bg.reportError)(this,this.def.error,r)}$dataError(){(0,Bg.reportError)(this,this.def.$dataError||Bg.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Bg.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=oe.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=oe.nil,r=oe.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:o,def:s}=this;n.if((0,oe.or)((0,oe._)`${i} === undefined`,r)),e!==oe.nil&&n.assign(e,!0),(o.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==oe.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:o}=this;return(0,oe.or)(s(),a());function s(){if(n.length){if(!(r instanceof oe.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,oe._)`${(0,zE.checkDataTypes)(c,r,o.opts.strictNumbers,zE.DataType.Wrong)}`}return oe.nil}function a(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,oe._)`!${c}(${r})`}return oe.nil}}subschema(e,r){let n=(0,bU.getSubschema)(this.it,e);(0,bU.extendSubschemaData)(n,this.it,e),(0,bU.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return tVe(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Go.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Go.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,oe.Name)),!0}};ia.KeywordCxt=UE;function fce(t,e,r,n){let i=new UE(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Hg.funcKeywordCode)(i,r):"macro"in r?(0,Hg.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Hg.funcKeywordCode)(i,r)}var hVe=/^\/(?:[^~]|~0|~1)*$/,gVe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function pce(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,o;if(t==="")return pe.default.rootData;if(t[0]==="/"){if(!hVe.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,o=pe.default.rootData}else{let l=gVe.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=e)throw new Error(c("property/index",u));return n[e-u]}if(u>e)throw new Error(c("data",u));if(o=r[e-u],!i)return o}let s=o,a=i.split("/");for(let l of a)l&&(o=(0,oe._)`${o}${(0,oe.getProperty)((0,Go.unescapeJsonPointer)(l))}`,s=(0,oe._)`${s} && ${o}`);return s;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${e}`}}ia.getData=pce});var qE=v(xU=>{"use strict";Object.defineProperty(xU,"__esModule",{value:!0});var wU=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};xU.default=wU});var Zg=v(EU=>{"use strict";Object.defineProperty(EU,"__esModule",{value:!0});var $U=qg(),kU=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,$U.resolveUrl)(e,r,n),this.missingSchema=(0,$U.normalizeId)((0,$U.getFullPath)(e,this.missingRef))}};EU.default=kU});var HE=v(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.resolveSchema=Zn.getCompilingSchema=Zn.resolveRef=Zn.compileSchema=Zn.SchemaEnv=void 0;var vi=we(),yVe=qE(),Gc=Ho(),Si=qg(),mce=Ne(),_Ve=Gg(),Bd=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Si.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Zn.SchemaEnv=Bd;function TU(t){let e=hce.call(this,t);if(e)return e;let r=(0,Si.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,s=new vi.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o}),a;t.$async&&(a=s.scopeValue("Error",{ref:yVe.default,code:(0,vi._)`require("ajv/dist/runtime/validation_error").default`}));let c=s.scopeName("validate");t.validateName=c;let l={gen:s,allErrors:this.opts.allErrors,data:Gc.default.data,parentData:Gc.default.parentData,parentDataProperty:Gc.default.parentDataProperty,dataNames:[Gc.default.data],dataPathArr:[vi.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,vi.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:vi.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,vi._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,_Ve.validateFunctionCode)(l),s.optimize(this.opts.code.optimize);let d=s.toString();u=`${s.scopeRefs(Gc.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,t));let p=new Function(`${Gc.default.self}`,`${Gc.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:s._values}),this.opts.unevaluated){let{props:m,items:h}=l;p.evaluated={props:m instanceof vi.Name?void 0:m,items:h instanceof vi.Name?void 0:h,dynamicProps:m instanceof vi.Name,dynamicItems:h instanceof vi.Name},p.source&&(p.source.evaluated=(0,vi.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(t)}}Zn.compileSchema=TU;function bVe(t,e,r){var n;r=(0,Si.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let o=wVe.call(this,t,r);if(o===void 0){let s=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;s&&(o=new Bd({schema:s,schemaId:a,root:t,baseId:e}))}if(o!==void 0)return t.refs[r]=vVe.call(this,o)}Zn.resolveRef=bVe;function vVe(t){return(0,Si.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:TU.call(this,t)}function hce(t){for(let e of this._compilations)if(SVe(e,t))return e}Zn.getCompilingSchema=hce;function SVe(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function wVe(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||BE.call(this,t,e)}function BE(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Si._getFullPath)(this.opts.uriResolver,r),i=(0,Si.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return AU.call(this,r,t);let o=(0,Si.normalizeId)(n),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let a=BE.call(this,t,s);return typeof a?.schema!="object"?void 0:AU.call(this,r,a)}if(typeof s?.schema=="object"){if(s.validate||TU.call(this,s),o===(0,Si.normalizeId)(e)){let{schema:a}=s,{schemaId:c}=this.opts,l=a[c];return l&&(i=(0,Si.resolveUrl)(this.opts.uriResolver,i,l)),new Bd({schema:a,schemaId:c,root:t,baseId:i})}return AU.call(this,r,s)}}Zn.resolveSchema=BE;var xVe=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function AU(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,mce.unescapeFragment)(a)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!xVe.has(a)&&l&&(e=(0,Si.resolveUrl)(this.opts.uriResolver,e,l))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,mce.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Si.resolveUrl)(this.opts.uriResolver,e,r.$ref);o=BE.call(this,n,a)}let{schemaId:s}=this.opts;if(o=o||new Bd({schema:r,schemaId:s,root:n,baseId:e}),o.schema!==o.root.schema)return o}});var gce=v((wRt,$Ve)=>{$Ve.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var IU=v((xRt,wce)=>{"use strict";var kVe=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),_ce=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),OU=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),bce=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),EVe=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function RU(t){let e="",r=0,n=0;for(n=0;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var AVe=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function yce(t){return t.length=0,!0}function TVe(t,e,r){if(t.length){let n=RU(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function OVe(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],o=!1,s=!1,a=TVe;for(let c=0;c7){r.error=!0;break}c>0&&t[c-1]===":"&&(o=!0),n.push(":");continue}else if(l==="%"){if(!a(i,n,r))break;a=yce}else{i.push(l);continue}}return i.length&&(a===yce?r.zone=i.join(""):s?n.push(i.join("")):n.push(RU(i))),r.address=n.join(""),r}function vce(t){if(RVe(t,":")<2)return{host:t,isIPV6:!1};let e=OVe(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function RVe(t,e){let r=0;for(let n=0;nPVe[n])}function NVe(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";var{isUUID:LVe}=IU(),zVe=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,UVe=["http","https","ws","wss","urn","urn:uuid"];function qVe(t){return UVe.indexOf(t)!==-1}function PU(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function xce(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function $ce(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function BVe(t){return t.secure=PU(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function HVe(t){if((t.port===(PU(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function GVe(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(zVe);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,o=CU(i);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function ZVe(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,o=CU(i);o&&(t=o.serialize(t,e));let s=t,a=t.nss;return s.path=`${n||e.nid}:${a}`,e.skipEscape=!0,s}function VVe(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!LVe(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function WVe(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var kce={scheme:"http",domainHost:!0,parse:xce,serialize:$ce},KVe={scheme:"https",domainHost:kce.domainHost,parse:xce,serialize:$ce},GE={scheme:"ws",domainHost:!0,parse:BVe,serialize:HVe},JVe={scheme:"wss",domainHost:GE.domainHost,parse:GE.parse,serialize:GE.serialize},YVe={scheme:"urn",parse:GVe,serialize:ZVe,skipNormalize:!0},XVe={scheme:"urn:uuid",parse:VVe,serialize:WVe,skipNormalize:!0},ZE={http:kce,https:KVe,ws:GE,wss:JVe,urn:YVe,"urn:uuid":XVe};Object.setPrototypeOf(ZE,null);function CU(t){return t&&(ZE[t]||ZE[t.toLowerCase()])||void 0}Ece.exports={wsIsSecure:PU,SCHEMES:ZE,isValidSchemeName:qVe,getSchemeHandler:CU}});var Cce=v((kRt,VE)=>{"use strict";var{normalizeIPv6:QVe,removeDotSegments:Vg,recomposeAuthority:eWe,normalizePercentEncoding:tWe,normalizePathEncoding:rWe,escapePreservingEscapes:nWe,reescapeHostDelimiters:iWe,isIPv4:oWe,nonSimpleDomain:sWe}=IU(),{SCHEMES:aWe,getSchemeHandler:Oce}=Ace();function cWe(t,e){return typeof t=="string"?t=pWe(t,e):typeof t=="object"&&(t=Hd(Zc(t,e),e)),t}function lWe(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Rce(Hd(t,n),Hd(e,n),n,!0);return n.skipEscape=!0,Zc(i,n)}function Rce(t,e,r,n){let i={};return n||(t=Hd(Zc(t,r),r),e=Hd(Zc(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Vg(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Vg(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Vg(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=Vg(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function uWe(t,e,r){let n=Tce(t,r),i=Tce(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function Zc(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],o=Oce(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=tWe(r.path):(r.path=nWe(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let s=eWe(r);if(s!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(s),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!o||!o.absolutePath)&&(a=Vg(a)),s===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),i.push(a)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var dWe=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function fWe(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function Ice(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,o=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(dWe);if(s){n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]);let a=fWe(n,s);if(a!==void 0&&(n.error=n.error||a,i=!0),n.host)if(oWe(n.host)===!1){let u=QVe(n.host);n.host=u.host.toLowerCase(),o=u.isIPV6}else o=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=Oce(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&o===!1&&sWe(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(l){n.error=n.error||"Host's domain name can not be converted to ASCII: "+l}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=iWe(unescape(n.host),o))),n.path&&(n.path=rWe(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function Hd(t,e){return Ice(t,e).parsed}function pWe(t,e){return Pce(t,e).normalized}function Pce(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Ice(t,e);return{normalized:n?t:Zc(r,e),malformedAuthorityOrPort:n}}function Tce(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Pce(t,e);return n?void 0:r}if(typeof t=="object")return Zc(t,e)}var DU={SCHEMES:aWe,normalize:cWe,resolve:lWe,resolveComponent:Rce,equal:uWe,serialize:Zc,parse:Hd};VE.exports=DU;VE.exports.default=DU;VE.exports.fastUri=DU});var Nce=v(NU=>{"use strict";Object.defineProperty(NU,"__esModule",{value:!0});var Dce=Cce();Dce.code='require("ajv/dist/runtime/uri").default';NU.default=Dce});var Bce=v(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.CodeGen=lr.Name=lr.nil=lr.stringify=lr.str=lr._=lr.KeywordCxt=void 0;var mWe=Gg();Object.defineProperty(lr,"KeywordCxt",{enumerable:!0,get:function(){return mWe.KeywordCxt}});var Gd=we();Object.defineProperty(lr,"_",{enumerable:!0,get:function(){return Gd._}});Object.defineProperty(lr,"str",{enumerable:!0,get:function(){return Gd.str}});Object.defineProperty(lr,"stringify",{enumerable:!0,get:function(){return Gd.stringify}});Object.defineProperty(lr,"nil",{enumerable:!0,get:function(){return Gd.nil}});Object.defineProperty(lr,"Name",{enumerable:!0,get:function(){return Gd.Name}});Object.defineProperty(lr,"CodeGen",{enumerable:!0,get:function(){return Gd.CodeGen}});var hWe=qE(),zce=Zg(),gWe=lU(),Wg=HE(),yWe=we(),Kg=qg(),WE=Ug(),MU=Ne(),jce=gce(),_We=Nce(),Uce=(t,e)=>new RegExp(t,e);Uce.code="new RegExp";var bWe=["removeAdditional","useDefaults","coerceTypes"],vWe=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),SWe={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},wWe={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Mce=200;function xWe(t){var e,r,n,i,o,s,a,c,l,u,d,f,p,m,h,g,b,_,S,x,w,O,T,A,D;let $=t.strict,re=(e=t.code)===null||e===void 0?void 0:e.optimize,K=re===!0||re===void 0?1:re||0,xe=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Uce,C=(i=t.uriResolver)!==null&&i!==void 0?i:_We.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:$)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:$)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=t.strictTypes)!==null&&l!==void 0?l:$)!==null&&u!==void 0?u:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:$)!==null&&f!==void 0?f:"log",strictRequired:(m=(p=t.strictRequired)!==null&&p!==void 0?p:$)!==null&&m!==void 0?m:!1,code:t.code?{...t.code,optimize:K,regExp:xe}:{optimize:K,regExp:xe},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Mce,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Mce,meta:(b=t.meta)!==null&&b!==void 0?b:!0,messages:(_=t.messages)!==null&&_!==void 0?_:!0,inlineRefs:(S=t.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(x=t.schemaId)!==null&&x!==void 0?x:"$id",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(O=t.validateSchema)!==null&&O!==void 0?O:!0,validateFormats:(T=t.validateFormats)!==null&&T!==void 0?T:!0,unicodeRegExp:(A=t.unicodeRegExp)!==null&&A!==void 0?A:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:C}}var Jg=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...xWe(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new yWe.ValueScope({scope:{},prefixes:vWe,es5:r,lines:n}),this.logger=OWe(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,gWe.getRules)(),Fce.call(this,SWe,e,"NOT SUPPORTED"),Fce.call(this,wWe,e,"DEPRECATED","warn"),this._metaOpts=AWe.call(this),e.formats&&kWe.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&EWe.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),$We.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=jce;n==="id"&&(i={...jce},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(u,d){await o.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||s.call(this,f)}async function o(u){u&&!this.getSchema(u)&&await i.call(this,{$ref:u},!0)}async function s(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof zce.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),s.call(this,u)}}function a({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await o.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,n,i);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return r=(0,Kg.normalizeId)(r||o),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return i}getSchema(e){let r;for(;typeof(r=Lce.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Wg.SchemaEnv({schema:{},schemaId:n});if(r=Wg.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Lce.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,Kg.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(IWe.call(this,n,r),!r)return(0,MU.eachItem)(n,o=>jU.call(this,o)),this;CWe.call(this,r);let i={...r,type:(0,WE.getJSONTypes)(r.type),schemaType:(0,WE.getJSONTypes)(r.schemaType)};return(0,MU.eachItem)(n,i.type.length===0?o=>jU.call(this,o,i):o=>i.type.forEach(s=>jU.call(this,o,i,s))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(o=>o.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,o)=>i+r+o)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let o=i.split("/").slice(1),s=e;for(let a of o)s=s[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,u=s[a];l&&u&&(s[a]=qce(u))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:a}=this.opts;if(typeof e=="object")s=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,Kg.normalizeId)(s||n);let l=Kg.getSchemaRefs.call(this,e,n);return c=new Wg.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Wg.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Wg.compileSchema.call(this,e)}finally{this.opts=r}}};Jg.ValidationError=hWe.default;Jg.MissingRefError=zce.default;lr.default=Jg;function Fce(t,e,r,n="error"){for(let i in t){let o=i;o in e&&this.logger[n](`${r}: option ${i}. ${t[o]}`)}}function Lce(t){return t=(0,Kg.normalizeId)(t),this.schemas[t]||this.refs[t]}function $We(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function kWe(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function EWe(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function AWe(){let t={...this.opts};for(let e of bWe)delete t[e];return t}var TWe={log(){},warn(){},error(){}};function OWe(t){if(t===!1)return TWe;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var RWe=/^[a-z_$][a-z0-9_$:-]*$/i;function IWe(t,e){let{RULES:r}=this;if((0,MU.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!RWe.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function jU(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=i?o.post:o.rules.find(({type:c})=>c===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,WE.getJSONTypes)(e.type),schemaType:(0,WE.getJSONTypes)(e.schemaType)}};e.before?PWe.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function PWe(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function CWe(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=qce(e)),t.validateSchema=this.compile(e,!0))}var DWe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function qce(t){return{anyOf:[t,DWe]}}});var Hce=v(FU=>{"use strict";Object.defineProperty(FU,"__esModule",{value:!0});var NWe={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};FU.default=NWe});var Wce=v(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.callRef=Vc.getValidate=void 0;var jWe=Zg(),Gce=Gn(),Yr=we(),Zd=Ho(),Zce=HE(),KE=Ne(),MWe={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:o,validateName:s,opts:a,self:c}=n,{root:l}=o;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=Zce.resolveRef.call(c,l,i,r);if(u===void 0)throw new jWe.default(n.opts.uriResolver,i,r);if(u instanceof Zce.SchemaEnv)return f(u);return p(u);function d(){if(o===l)return JE(t,s,o,o.$async);let m=e.scopeValue("root",{ref:l});return JE(t,(0,Yr._)`${m}.validate`,l,l.$async)}function f(m){let h=Vce(t,m);JE(t,h,m,m.$async)}function p(m){let h=e.scopeValue("schema",a.code.source===!0?{ref:m,code:(0,Yr.stringify)(m)}:{ref:m}),g=e.name("valid"),b=t.subschema({schema:m,dataTypes:[],schemaPath:Yr.nil,topSchemaRef:h,errSchemaPath:r},g);t.mergeEvaluated(b),t.ok(g)}}};function Vce(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Yr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Vc.getValidate=Vce;function JE(t,e,r,n){let{gen:i,it:o}=t,{allErrors:s,schemaEnv:a,opts:c}=o,l=c.passContext?Zd.default.this:Yr.nil;n?u():d();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");let m=i.let("valid");i.try(()=>{i.code((0,Yr._)`await ${(0,Gce.callValidateCode)(t,e,l)}`),p(e),s||i.assign(m,!0)},h=>{i.if((0,Yr._)`!(${h} instanceof ${o.ValidationError})`,()=>i.throw(h)),f(h),s||i.assign(m,!1)}),t.ok(m)}function d(){t.result((0,Gce.callValidateCode)(t,e,l),()=>p(e),()=>f(e))}function f(m){let h=(0,Yr._)`${m}.errors`;i.assign(Zd.default.vErrors,(0,Yr._)`${Zd.default.vErrors} === null ? ${h} : ${Zd.default.vErrors}.concat(${h})`),i.assign(Zd.default.errors,(0,Yr._)`${Zd.default.vErrors}.length`)}function p(m){var h;if(!o.opts.unevaluated)return;let g=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(o.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(o.props=KE.mergeEvaluated.props(i,g.props,o.props));else{let b=i.var("props",(0,Yr._)`${m}.evaluated.props`);o.props=KE.mergeEvaluated.props(i,b,o.props,Yr.Name)}if(o.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(o.items=KE.mergeEvaluated.items(i,g.items,o.items));else{let b=i.var("items",(0,Yr._)`${m}.evaluated.items`);o.items=KE.mergeEvaluated.items(i,b,o.items,Yr.Name)}}}Vc.callRef=JE;Vc.default=MWe});var Kce=v(LU=>{"use strict";Object.defineProperty(LU,"__esModule",{value:!0});var FWe=Hce(),LWe=Wce(),zWe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",FWe.default,LWe.default];LU.default=zWe});var Jce=v(zU=>{"use strict";Object.defineProperty(zU,"__esModule",{value:!0});var YE=we(),oa=YE.operators,XE={maximum:{okStr:"<=",ok:oa.LTE,fail:oa.GT},minimum:{okStr:">=",ok:oa.GTE,fail:oa.LT},exclusiveMaximum:{okStr:"<",ok:oa.LT,fail:oa.GTE},exclusiveMinimum:{okStr:">",ok:oa.GT,fail:oa.LTE}},UWe={message:({keyword:t,schemaCode:e})=>(0,YE.str)`must be ${XE[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,YE._)`{comparison: ${XE[t].okStr}, limit: ${e}}`},qWe={keyword:Object.keys(XE),type:"number",schemaType:"number",$data:!0,error:UWe,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,YE._)`${r} ${XE[e].fail} ${n} || isNaN(${r})`)}};zU.default=qWe});var Yce=v(UU=>{"use strict";Object.defineProperty(UU,"__esModule",{value:!0});var Yg=we(),BWe={message:({schemaCode:t})=>(0,Yg.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Yg._)`{multipleOf: ${t}}`},HWe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:BWe,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?(0,Yg._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,Yg._)`${s} !== parseInt(${s})`;t.fail$data((0,Yg._)`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};UU.default=HWe});var Qce=v(qU=>{"use strict";Object.defineProperty(qU,"__esModule",{value:!0});function Xce(t){let e=t.length,r=0,n=0,i;for(;n=55296&&i<=56319&&n{"use strict";Object.defineProperty(BU,"__esModule",{value:!0});var Wc=we(),GWe=Ne(),ZWe=Qce(),VWe={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Wc.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Wc._)`{limit: ${t}}`},WWe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:VWe,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,o=e==="maxLength"?Wc.operators.GT:Wc.operators.LT,s=i.opts.unicode===!1?(0,Wc._)`${r}.length`:(0,Wc._)`${(0,GWe.useFunc)(t.gen,ZWe.default)}(${r})`;t.fail$data((0,Wc._)`${s} ${o} ${n}`)}};BU.default=WWe});var tle=v(HU=>{"use strict";Object.defineProperty(HU,"__esModule",{value:!0});var KWe=Gn(),JWe=Ne(),Vd=we(),YWe={message:({schemaCode:t})=>(0,Vd.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Vd._)`{pattern: ${t}}`},XWe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:YWe,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t,a=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=s.opts.code,l=c.code==="new RegExp"?(0,Vd._)`new RegExp`:(0,JWe.useFunc)(e,c),u=e.let("valid");e.try(()=>e.assign(u,(0,Vd._)`${l}(${o}, ${a}).test(${r})`),()=>e.assign(u,!1)),t.fail$data((0,Vd._)`!${u}`)}else{let c=(0,KWe.usePattern)(t,i);t.fail$data((0,Vd._)`!${c}.test(${r})`)}}};HU.default=XWe});var rle=v(GU=>{"use strict";Object.defineProperty(GU,"__esModule",{value:!0});var Xg=we(),QWe={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Xg.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Xg._)`{limit: ${t}}`},e3e={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:QWe,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Xg.operators.GT:Xg.operators.LT;t.fail$data((0,Xg._)`Object.keys(${r}).length ${i} ${n}`)}};GU.default=e3e});var nle=v(ZU=>{"use strict";Object.defineProperty(ZU,"__esModule",{value:!0});var Qg=Gn(),ey=we(),t3e=Ne(),r3e={message:({params:{missingProperty:t}})=>(0,ey.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ey._)`{missingProperty: ${t}}`},n3e={keyword:"required",type:"object",schemaType:"array",$data:!0,error:r3e,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:o,it:s}=t,{opts:a}=s;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors?l():u(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:m}=t.it;for(let h of r)if(p?.[h]===void 0&&!m.has(h)){let g=s.schemaEnv.baseId+s.errSchemaPath,b=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,t3e.checkStrictMode)(s,b,s.opts.strictRequired)}}function l(){if(c||o)t.block$data(ey.nil,d);else for(let p of r)(0,Qg.checkReportMissingProp)(t,p)}function u(){let p=e.let("missing");if(c||o){let m=e.let("valid",!0);t.block$data(m,()=>f(p,m)),t.ok(m)}else e.if((0,Qg.checkMissingProp)(t,r,p)),(0,Qg.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,Qg.noPropertyInData)(e,i,p,a.ownProperties),()=>t.error())})}function f(p,m){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(m,(0,Qg.propertyInData)(e,i,p,a.ownProperties)),e.if((0,ey.not)(m),()=>{t.error(),e.break()})},ey.nil)}}};ZU.default=n3e});var ile=v(VU=>{"use strict";Object.defineProperty(VU,"__esModule",{value:!0});var ty=we(),i3e={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,ty.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,ty._)`{limit: ${t}}`},o3e={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:i3e,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?ty.operators.GT:ty.operators.LT;t.fail$data((0,ty._)`${r}.length ${i} ${n}`)}};VU.default=o3e});var QE=v(WU=>{"use strict";Object.defineProperty(WU,"__esModule",{value:!0});var ole=yU();ole.code='require("ajv/dist/runtime/equal").default';WU.default=ole});var sle=v(JU=>{"use strict";Object.defineProperty(JU,"__esModule",{value:!0});var KU=Ug(),ur=we(),s3e=Ne(),a3e=QE(),c3e={message:({params:{i:t,j:e}})=>(0,ur.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,ur._)`{i: ${t}, j: ${e}}`},l3e={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:c3e,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:o,schemaCode:s,it:a}=t;if(!n&&!i)return;let c=e.let("valid"),l=o.items?(0,KU.getSchemaTypes)(o.items):[];t.block$data(c,u,(0,ur._)`${s} === false`),t.ok(c);function u(){let m=e.let("i",(0,ur._)`${r}.length`),h=e.let("j");t.setParams({i:m,j:h}),e.assign(c,!0),e.if((0,ur._)`${m} > 1`,()=>(d()?f:p)(m,h))}function d(){return l.length>0&&!l.some(m=>m==="object"||m==="array")}function f(m,h){let g=e.name("item"),b=(0,KU.checkDataTypes)(l,g,a.opts.strictNumbers,KU.DataType.Wrong),_=e.const("indices",(0,ur._)`{}`);e.for((0,ur._)`;${m}--;`,()=>{e.let(g,(0,ur._)`${r}[${m}]`),e.if(b,(0,ur._)`continue`),l.length>1&&e.if((0,ur._)`typeof ${g} == "string"`,(0,ur._)`${g} += "_"`),e.if((0,ur._)`typeof ${_}[${g}] == "number"`,()=>{e.assign(h,(0,ur._)`${_}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,ur._)`${_}[${g}] = ${m}`)})}function p(m,h){let g=(0,s3e.useFunc)(e,a3e.default),b=e.name("outer");e.label(b).for((0,ur._)`;${m}--;`,()=>e.for((0,ur._)`${h} = ${m}; ${h}--;`,()=>e.if((0,ur._)`${g}(${r}[${m}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(b)})))}}};JU.default=l3e});var ale=v(XU=>{"use strict";Object.defineProperty(XU,"__esModule",{value:!0});var YU=we(),u3e=Ne(),d3e=QE(),f3e={message:"must be equal to constant",params:({schemaCode:t})=>(0,YU._)`{allowedValue: ${t}}`},p3e={keyword:"const",$data:!0,error:f3e,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:o}=t;n||o&&typeof o=="object"?t.fail$data((0,YU._)`!${(0,u3e.useFunc)(e,d3e.default)}(${r}, ${i})`):t.fail((0,YU._)`${o} !== ${r}`)}};XU.default=p3e});var cle=v(QU=>{"use strict";Object.defineProperty(QU,"__esModule",{value:!0});var ry=we(),m3e=Ne(),h3e=QE(),g3e={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,ry._)`{allowedValues: ${t}}`},y3e={keyword:"enum",schemaType:"array",$data:!0,error:g3e,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let a=i.length>=s.opts.loopEnum,c,l=()=>c??(c=(0,m3e.useFunc)(e,h3e.default)),u;if(a||n)u=e.let("valid"),t.block$data(u,d);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let p=e.const("vSchema",o);u=(0,ry.or)(...i.map((m,h)=>f(p,h)))}t.pass(u);function d(){e.assign(u,!1),e.forOf("v",o,p=>e.if((0,ry._)`${l()}(${r}, ${p})`,()=>e.assign(u,!0).break()))}function f(p,m){let h=i[m];return typeof h=="object"&&h!==null?(0,ry._)`${l()}(${r}, ${p}[${m}])`:(0,ry._)`${r} === ${h}`}}};QU.default=y3e});var lle=v(eq=>{"use strict";Object.defineProperty(eq,"__esModule",{value:!0});var _3e=Jce(),b3e=Yce(),v3e=ele(),S3e=tle(),w3e=rle(),x3e=nle(),$3e=ile(),k3e=sle(),E3e=ale(),A3e=cle(),T3e=[_3e.default,b3e.default,v3e.default,S3e.default,w3e.default,x3e.default,$3e.default,k3e.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},E3e.default,A3e.default];eq.default=T3e});var rq=v(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});ny.validateAdditionalItems=void 0;var Kc=we(),tq=Ne(),O3e={message:({params:{len:t}})=>(0,Kc.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Kc._)`{limit: ${t}}`},R3e={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:O3e,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,tq.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ule(t,n)}};function ule(t,e){let{gen:r,schema:n,data:i,keyword:o,it:s}=t;s.items=!0;let a=r.const("len",(0,Kc._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Kc._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,tq.alwaysValidSchema)(s,n)){let l=r.var("valid",(0,Kc._)`${a} <= ${e.length}`);r.if((0,Kc.not)(l),()=>c(l)),t.ok(l)}function c(l){r.forRange("i",e.length,a,u=>{t.subschema({keyword:o,dataProp:u,dataPropType:tq.Type.Num},l),s.allErrors||r.if((0,Kc.not)(l),()=>r.break())})}}ny.validateAdditionalItems=ule;ny.default=R3e});var nq=v(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.validateTuple=void 0;var dle=we(),eA=Ne(),I3e=Gn(),P3e={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return fle(t,"additionalItems",e);r.items=!0,!(0,eA.alwaysValidSchema)(r,e)&&t.ok((0,I3e.validateArray)(t))}};function fle(t,e,r=t.schema){let{gen:n,parentSchema:i,data:o,keyword:s,it:a}=t;u(i),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=eA.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),l=n.const("len",(0,dle._)`${o}.length`);r.forEach((d,f)=>{(0,eA.alwaysValidSchema)(a,d)||(n.if((0,dle._)`${l} > ${f}`,()=>t.subschema({keyword:s,schemaProp:f,dataProp:f},c)),t.ok(c))});function u(d){let{opts:f,errSchemaPath:p}=a,m=r.length,h=m===d.minItems&&(m===d.maxItems||d[e]===!1);if(f.strictTuples&&!h){let g=`"${s}" is ${m}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,eA.checkStrictMode)(a,g,f.strictTuples)}}}iy.validateTuple=fle;iy.default=P3e});var ple=v(iq=>{"use strict";Object.defineProperty(iq,"__esModule",{value:!0});var C3e=nq(),D3e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,C3e.validateTuple)(t,"items")};iq.default=D3e});var hle=v(oq=>{"use strict";Object.defineProperty(oq,"__esModule",{value:!0});var mle=we(),N3e=Ne(),j3e=Gn(),M3e=rq(),F3e={message:({params:{len:t}})=>(0,mle.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,mle._)`{limit: ${t}}`},L3e={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:F3e,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,N3e.alwaysValidSchema)(n,e)&&(i?(0,M3e.validateAdditionalItems)(t,i):t.ok((0,j3e.validateArray)(t)))}};oq.default=L3e});var gle=v(sq=>{"use strict";Object.defineProperty(sq,"__esModule",{value:!0});var Vn=we(),tA=Ne(),z3e={message:({params:{min:t,max:e}})=>e===void 0?(0,Vn.str)`must contain at least ${t} valid item(s)`:(0,Vn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Vn._)`{minContains: ${t}}`:(0,Vn._)`{minContains: ${t}, maxContains: ${e}}`},U3e={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:z3e,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t,s,a,{minContains:c,maxContains:l}=n;o.opts.next?(s=c===void 0?1:c,a=l):s=1;let u=e.const("len",(0,Vn._)`${i}.length`);if(t.setParams({min:s,max:a}),a===void 0&&s===0){(0,tA.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,tA.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,tA.alwaysValidSchema)(o,r)){let h=(0,Vn._)`${u} >= ${s}`;a!==void 0&&(h=(0,Vn._)`${h} && ${u} <= ${a}`),t.pass(h);return}o.items=!0;let d=e.name("valid");a===void 0&&s===1?p(d,()=>e.if(d,()=>e.break())):s===0?(e.let(d,!0),a!==void 0&&e.if((0,Vn._)`${i}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let h=e.name("_valid"),g=e.let("count",0);p(h,()=>e.if(h,()=>m(g)))}function p(h,g){e.forRange("i",0,u,b=>{t.subschema({keyword:"contains",dataProp:b,dataPropType:tA.Type.Num,compositeRule:!0},h),g()})}function m(h){e.code((0,Vn._)`${h}++`),a===void 0?e.if((0,Vn._)`${h} >= ${s}`,()=>e.assign(d,!0).break()):(e.if((0,Vn._)`${h} > ${a}`,()=>e.assign(d,!1).break()),s===1?e.assign(d,!0):e.if((0,Vn._)`${h} >= ${s}`,()=>e.assign(d,!0)))}}};sq.default=U3e});var ble=v(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.validateSchemaDeps=oo.validatePropertyDeps=oo.error=void 0;var aq=we(),q3e=Ne(),oy=Gn();oo.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,aq.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,aq._)`{property: ${t}, missingProperty: ${n}, depsCount: ${e}, - deps: ${r}}`};var B3e={keyword:"dependencies",type:"object",schemaType:"object",error:oo.error,code(t){let[e,r]=H3e(t);yle(t,e),_le(t,r)}};function H3e({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function yle(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let c=(0,oy.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,oy.checkReportMissingProp)(t,l)}):(r.if((0,aq._)`${c} && (${(0,oy.checkMissingProp)(t,a,o)})`),(0,oy.reportMissingProp)(t,o),r.else())}}oo.validatePropertyDeps=yle;function _le(t,e=t.schema){let{gen:r,data:n,keyword:i,it:o}=t,s=r.name("valid");for(let a in e)(0,q3e.alwaysValidSchema)(o,e[a])||(r.if((0,oy.propertyInData)(r,n,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),t.ok(s))}oo.validateSchemaDeps=_le;oo.default=B3e});var Sle=v(cq=>{"use strict";Object.defineProperty(cq,"__esModule",{value:!0});var vle=we(),G3e=Ne(),Z3e={message:"property name must be valid",params:({params:t})=>(0,vle._)`{propertyName: ${t.propertyName}}`},V3e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Z3e,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,G3e.alwaysValidSchema)(i,r))return;let o=e.name("valid");e.forIn("key",n,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,vle.not)(o),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(o)}};cq.default=V3e});var uq=v(lq=>{"use strict";Object.defineProperty(lq,"__esModule",{value:!0});var rA=Gn(),wi=we(),W3e=Ho(),nA=Ne(),K3e={message:"must NOT have additional properties",params:({params:t})=>(0,wi._)`{additionalProperty: ${t.additionalProperty}}`},J3e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:K3e,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,nA.alwaysValidSchema)(s,r))return;let l=(0,rA.allSchemaProperties)(n.properties),u=(0,rA.allSchemaProperties)(n.patternProperties);d(),t.ok((0,wi._)`${o} === ${W3e.default.errors}`);function d(){e.forIn("key",i,g=>{!l.length&&!u.length?m(g):e.if(f(g),()=>m(g))})}function f(g){let b;if(l.length>8){let _=(0,nA.schemaRefOrVal)(s,n.properties,"properties");b=(0,rA.isOwnProperty)(e,_,g)}else l.length?b=(0,wi.or)(...l.map(_=>(0,wi._)`${g} === ${_}`)):b=wi.nil;return u.length&&(b=(0,wi.or)(b,...u.map(_=>(0,wi._)`${(0,rA.usePattern)(t,_)}.test(${g})`))),(0,wi.not)(b)}function p(g){e.code((0,wi._)`delete ${i}[${g}]`)}function m(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,nA.alwaysValidSchema)(s,r)){let b=e.name("valid");c.removeAdditional==="failing"?(h(g,b,!1),e.if((0,wi.not)(b),()=>{t.reset(),p(g)})):(h(g,b),a||e.if((0,wi.not)(b),()=>e.break()))}}function h(g,b,_){let S={keyword:"additionalProperties",dataProp:g,dataPropType:nA.Type.Str};_===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(S,b)}}};lq.default=J3e});var $le=v(fq=>{"use strict";Object.defineProperty(fq,"__esModule",{value:!0});var Y3e=Gg(),wle=Gn(),dq=Ne(),xle=uq(),X3e={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&xle.default.code(new Y3e.KeywordCxt(o,xle.default,"additionalProperties"));let s=(0,wle.allSchemaProperties)(r);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=dq.mergeEvaluated.props(e,(0,dq.toHash)(s),o.props));let a=s.filter(d=>!(0,dq.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,wle.propertyInData)(e,i,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};fq.default=X3e});var Tle=v(pq=>{"use strict";Object.defineProperty(pq,"__esModule",{value:!0});var kle=Gn(),iA=we(),Ele=Ne(),Ale=Ne(),Q3e={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:o}=t,{opts:s}=o,a=(0,kle.allSchemaProperties)(r),c=a.filter(h=>(0,Ele.alwaysValidSchema)(o,r[h]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&i.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof iA.Name)&&(o.props=(0,Ale.evaluatedPropsToName)(e,o.props));let{props:d}=o;f();function f(){for(let h of a)l&&p(h),o.allErrors?m(h):(e.var(u,!0),m(h),e.if(u))}function p(h){for(let g in l)new RegExp(h).test(g)&&(0,Ele.checkStrictMode)(o,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function m(h){e.forIn("key",n,g=>{e.if((0,iA._)`${(0,kle.usePattern)(t,h)}.test(${g})`,()=>{let b=c.includes(h);b||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:Ale.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,iA._)`${d}[${g}]`,!0):!b&&!o.allErrors&&e.if((0,iA.not)(u),()=>e.break())})})}}};pq.default=Q3e});var Ole=v(mq=>{"use strict";Object.defineProperty(mq,"__esModule",{value:!0});var eKe=Ne(),tKe={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,eKe.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};mq.default=tKe});var Rle=v(hq=>{"use strict";Object.defineProperty(hq,"__esModule",{value:!0});var rKe=Gn(),nKe={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:rKe.validateUnion,error:{message:"must match a schema in anyOf"}};hq.default=nKe});var Ile=v(gq=>{"use strict";Object.defineProperty(gq,"__esModule",{value:!0});var oA=we(),iKe=Ne(),oKe={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,oA._)`{passingSchemas: ${t.passing}}`},sKe={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:oKe,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let o=r,s=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(s,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((u,d)=>{let f;(0,iKe.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,oA._)`${c} && ${s}`).assign(s,!1).assign(a,(0,oA._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),f&&t.mergeEvaluated(f,oA.Name)})})}}};gq.default=sKe});var Ple=v(yq=>{"use strict";Object.defineProperty(yq,"__esModule",{value:!0});var aKe=Ne(),cKe={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((o,s)=>{if((0,aKe.alwaysValidSchema)(n,o))return;let a=t.subschema({keyword:"allOf",schemaProp:s},i);t.ok(i),t.mergeEvaluated(a)})}};yq.default=cKe});var Nle=v(_q=>{"use strict";Object.defineProperty(_q,"__esModule",{value:!0});var sA=we(),Dle=Ne(),lKe={message:({params:t})=>(0,sA.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,sA._)`{failingKeyword: ${t.ifClause}}`},uKe={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:lKe,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Dle.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=Cle(n,"then"),o=Cle(n,"else");if(!i&&!o)return;let s=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),i&&o){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else i?e.if(a,l("then")):e.if((0,sA.not)(a),l("else"));t.pass(s,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let f=t.subschema({keyword:u},a);e.assign(s,a),t.mergeValidEvaluated(f,s),d?e.assign(d,(0,sA._)`${u}`):t.setParams({ifClause:u})}}}};function Cle(t,e){let r=t.schema[e];return r!==void 0&&!(0,Dle.alwaysValidSchema)(t,r)}_q.default=uKe});var jle=v(bq=>{"use strict";Object.defineProperty(bq,"__esModule",{value:!0});var dKe=Ne(),fKe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,dKe.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};bq.default=fKe});var Mle=v(vq=>{"use strict";Object.defineProperty(vq,"__esModule",{value:!0});var pKe=rq(),mKe=ple(),hKe=nq(),gKe=hle(),yKe=gle(),_Ke=ble(),bKe=Sle(),vKe=uq(),SKe=$le(),wKe=Tle(),xKe=Ole(),$Ke=Rle(),kKe=Ile(),EKe=Ple(),AKe=Nle(),TKe=jle();function OKe(t=!1){let e=[xKe.default,$Ke.default,kKe.default,EKe.default,AKe.default,TKe.default,bKe.default,vKe.default,_Ke.default,SKe.default,wKe.default];return t?e.push(mKe.default,gKe.default):e.push(pKe.default,hKe.default),e.push(yKe.default),e}vq.default=OKe});var Fle=v(Sq=>{"use strict";Object.defineProperty(Sq,"__esModule",{value:!0});var Pt=we(),RKe={message:({schemaCode:t})=>(0,Pt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Pt._)`{format: ${t}}`},IKe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:RKe,code(t,e){let{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():p();function f(){let m=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,Pt._)`${m}[${s}]`),g=r.let("fType"),b=r.let("format");r.if((0,Pt._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,Pt._)`${h}.type || "string"`).assign(b,(0,Pt._)`${h}.validate`),()=>r.assign(g,(0,Pt._)`"string"`).assign(b,h)),t.fail$data((0,Pt.or)(_(),S()));function _(){return c.strictSchema===!1?Pt.nil:(0,Pt._)`${s} && !${b}`}function S(){let x=u.$async?(0,Pt._)`(${h}.async ? await ${b}(${n}) : ${b}(${n}))`:(0,Pt._)`${b}(${n})`,w=(0,Pt._)`(typeof ${b} == "function" ? ${x} : ${b}.test(${n}))`;return(0,Pt._)`${b} && ${b} !== true && ${g} === ${e} && !${w}`}}function p(){let m=d.formats[o];if(!m){_();return}if(m===!0)return;let[h,g,b]=S(m);h===e&&t.pass(x());function _(){if(c.strictSchema===!1){d.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function S(w){let O=w instanceof RegExp?(0,Pt.regexpCode)(w):c.code.formats?(0,Pt._)`${c.code.formats}${(0,Pt.getProperty)(o)}`:void 0,T=r.scopeValue("formats",{key:o,ref:w,code:O});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,Pt._)`${T}.validate`]:["string",w,T]}function x(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Pt._)`await ${b}(${n})`}return typeof g=="function"?(0,Pt._)`${b}(${n})`:(0,Pt._)`${b}.test(${n})`}}}};Sq.default=IKe});var Lle=v(wq=>{"use strict";Object.defineProperty(wq,"__esModule",{value:!0});var PKe=Fle(),CKe=[PKe.default];wq.default=CKe});var zle=v(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.contentVocabulary=Wd.metadataVocabulary=void 0;Wd.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Wd.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var qle=v(xq=>{"use strict";Object.defineProperty(xq,"__esModule",{value:!0});var DKe=Kce(),NKe=lle(),jKe=Mle(),MKe=Lle(),Ule=zle(),FKe=[DKe.default,NKe.default,(0,jKe.default)(),MKe.default,Ule.metadataVocabulary,Ule.contentVocabulary];xq.default=FKe});var Hle=v(aA=>{"use strict";Object.defineProperty(aA,"__esModule",{value:!0});aA.DiscrError=void 0;var Ble;(function(t){t.Tag="tag",t.Mapping="mapping"})(Ble||(aA.DiscrError=Ble={}))});var Zle=v(kq=>{"use strict";Object.defineProperty(kq,"__esModule",{value:!0});var Kd=we(),$q=Hle(),Gle=HE(),LKe=Zg(),zKe=Ne(),UKe={message:({params:{discrError:t,tagName:e}})=>t===$q.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Kd._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},qKe={keyword:"discriminator",type:"object",schemaType:"object",error:UKe,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:o}=t,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,Kd._)`${r}${(0,Kd.getProperty)(a)}`);e.if((0,Kd._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:$q.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let p=f();e.if(!1);for(let m in p)e.elseIf((0,Kd._)`${l} === ${m}`),e.assign(c,d(p[m]));e.else(),t.error(!1,{discrError:$q.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let m=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:p},m);return t.mergeEvaluated(h,Kd.Name),m}function f(){var p;let m={},h=b(i),g=!0;for(let x=0;x{BKe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Aq=v((pt,Eq)=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.MissingRefError=pt.ValidationError=pt.CodeGen=pt.Name=pt.nil=pt.stringify=pt.str=pt._=pt.KeywordCxt=pt.Ajv=void 0;var HKe=Bce(),GKe=qle(),ZKe=Zle(),Wle=Vle(),VKe=["/properties"],cA="http://json-schema.org/draft-07/schema",Jd=class extends HKe.default{_addVocabularies(){super._addVocabularies(),GKe.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(ZKe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Wle,VKe):Wle;this.addMetaSchema(e,cA,!1),this.refs["http://json-schema.org/schema"]=cA}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(cA)?cA:void 0)}};pt.Ajv=Jd;Eq.exports=pt=Jd;Eq.exports.Ajv=Jd;Object.defineProperty(pt,"__esModule",{value:!0});pt.default=Jd;var WKe=Gg();Object.defineProperty(pt,"KeywordCxt",{enumerable:!0,get:function(){return WKe.KeywordCxt}});var Yd=we();Object.defineProperty(pt,"_",{enumerable:!0,get:function(){return Yd._}});Object.defineProperty(pt,"str",{enumerable:!0,get:function(){return Yd.str}});Object.defineProperty(pt,"stringify",{enumerable:!0,get:function(){return Yd.stringify}});Object.defineProperty(pt,"nil",{enumerable:!0,get:function(){return Yd.nil}});Object.defineProperty(pt,"Name",{enumerable:!0,get:function(){return Yd.Name}});Object.defineProperty(pt,"CodeGen",{enumerable:!0,get:function(){return Yd.CodeGen}});var KKe=qE();Object.defineProperty(pt,"ValidationError",{enumerable:!0,get:function(){return KKe.default}});var JKe=Zg();Object.defineProperty(pt,"MissingRefError",{enumerable:!0,get:function(){return JKe.default}})});var rue=v(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.formatNames=ao.fastFormats=ao.fullFormats=void 0;function so(t,e){return{validate:t,compare:e}}ao.fullFormats={date:so(Xle,Iq),time:so(Oq(!0),Pq),"date-time":so(Kle(!0),eue),"iso-time":so(Oq(),Qle),"iso-date-time":so(Kle(),tue),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:rJe,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:lJe,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:nJe,int32:{type:"number",validate:sJe},int64:{type:"number",validate:aJe},float:{type:"number",validate:Yle},double:{type:"number",validate:Yle},password:!0,binary:!0};ao.fastFormats={...ao.fullFormats,date:so(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Iq),time:so(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Pq),"date-time":so(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,eue),"iso-time":so(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Qle),"iso-date-time":so(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,tue),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};ao.formatNames=Object.keys(ao.fullFormats);function YKe(t){return t%4===0&&(t%100!==0||t%400===0)}var XKe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,QKe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Xle(t){let e=XKe.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&YKe(r)?29:QKe[n])}function Iq(t,e){if(t&&e)return t>e?1:t23||u>59||t&&!a)return!1;if(i<=23&&o<=59&&s<60)return!0;let d=o-u*c,f=i-l*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&s<61}}function Pq(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function Qle(t,e){if(!(t&&e))return;let r=Tq.exec(t),n=Tq.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=iJe}function aJe(t){return Number.isInteger(t)}function Yle(){return!0}var cJe=/[^\\]\\Z/;function lJe(t){if(cJe.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var nue=v(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.formatLimitDefinition=void 0;var uJe=Aq(),xi=we(),sa=xi.operators,lA={formatMaximum:{okStr:"<=",ok:sa.LTE,fail:sa.GT},formatMinimum:{okStr:">=",ok:sa.GTE,fail:sa.LT},formatExclusiveMaximum:{okStr:"<",ok:sa.LT,fail:sa.GTE},formatExclusiveMinimum:{okStr:">",ok:sa.GT,fail:sa.LTE}},dJe={message:({keyword:t,schemaCode:e})=>(0,xi.str)`should be ${lA[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,xi._)`{comparison: ${lA[t].okStr}, limit: ${e}}`};Xd.formatLimitDefinition={keyword:Object.keys(lA),type:"string",schemaType:"string",$data:!0,error:dJe,code(t){let{gen:e,data:r,schemaCode:n,keyword:i,it:o}=t,{opts:s,self:a}=o;if(!s.validateFormats)return;let c=new uJe.KeywordCxt(o,a.RULES.all.format.definition,"format");c.$data?l():u();function l(){let f=e.scopeValue("formats",{ref:a.formats,code:s.code.formats}),p=e.const("fmt",(0,xi._)`${f}[${c.schemaCode}]`);t.fail$data((0,xi.or)((0,xi._)`typeof ${p} != "object"`,(0,xi._)`${p} instanceof RegExp`,(0,xi._)`typeof ${p}.compare != "function"`,d(p)))}function u(){let f=c.schema,p=a.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${i}": format "${f}" does not define "compare" function`);let m=e.scopeValue("formats",{key:f,ref:p,code:s.code.formats?(0,xi._)`${s.code.formats}${(0,xi.getProperty)(f)}`:void 0});t.fail$data(d(m))}function d(f){return(0,xi._)`${f}.compare(${r}, ${n}) ${lA[i].fail} 0`}},dependencies:["format"]};var fJe=t=>(t.addKeyword(Xd.formatLimitDefinition),t);Xd.default=fJe});var aue=v((sy,sue)=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});var Qd=rue(),pJe=nue(),Cq=we(),iue=new Cq.Name("fullFormats"),mJe=new Cq.Name("fastFormats"),Dq=(t,e={keywords:!0})=>{if(Array.isArray(e))return oue(t,e,Qd.fullFormats,iue),t;let[r,n]=e.mode==="fast"?[Qd.fastFormats,mJe]:[Qd.fullFormats,iue],i=e.formats||Qd.formatNames;return oue(t,i,r,n),e.keywords&&(0,pJe.default)(t),t};Dq.get=(t,e="full")=>{let n=(e==="fast"?Qd.fastFormats:Qd.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function oue(t,e,r,n){var i,o;(i=(o=t.opts.code).formats)!==null&&i!==void 0||(o.formats=(0,Cq._)`require("ajv-formats/dist/formats").${n}`);for(let s of e)t.addFormat(s,r[s])}sue.exports=sy=Dq;Object.defineProperty(sy,"__esModule",{value:!0});sy.default=Dq});function hJe(){let t=new cue.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,lue.default)(t),t}var cue,lue,uA,uue=y(()=>{cue=St(Aq(),1),lue=St(aue(),1);uA=class{constructor(e){this._ajv=e??hJe()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var dA,due=y(()=>{Fc();dA=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],o=Array.isArray(i.content)?i.content:[i.content],s=o.some(u=>u.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],l=c.some(u=>u.type==="tool_use");if(s){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let u=new Set(c.filter(f=>f.type==="tool_use").map(f=>f.id)),d=new Set(o.filter(f=>f.type==="tool_result").map(f=>f.toolUseId));if(u.size!==d.size||![...u].every(f=>d.has(f)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},Rg,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),i=e.mode??"form";switch(i){case"url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=i==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},Nd,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}}});function fue(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function pue(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var mue=y(()=>{});var fA,hue=y(()=>{yae();Fc();uue();ig();due();mue();fA=class extends OE{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Og.options.map((n,i)=>[n,i])),this.isMessageIgnored=(n,i)=>{let o=this._loggingLevels.get(i);return o?this.LOG_LEVEL_SEVERITY.get(n)this._oninitialize(n)),this.setNotificationHandler(Vz,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(r2,async(n,i)=>{let o=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=Og.safeParse(s);return a.success&&this._loggingLevels.set(o,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new dA(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=gae(this._capabilities,e)}setRequestHandler(e,r){let i=Ws(e)?.method;if(!i)throw new Error("Schema is missing a method literal");let o;if(zn(i)){let a=i;o=a._zod?.def?.value??a.value}else{let a=i;o=a._def?.value??a.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let a=async(c,l)=>{let u=Vs(Dd,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new ne(ae.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=Vs(Pd,f);if(!m.success){let h=m.error instanceof Error?m.error.message:String(m.error);throw new ne(ae.InvalidParams,`Invalid task creation result: ${h}`)}return m.data}let p=Vs(yE,f);if(!p.success){let m=p.error instanceof Error?p.error.message:String(p.error);throw new ne(ae.InvalidParams,`Invalid tools/call result: ${m}`)}return p.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){pue(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&fue(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:gse.includes(r)?r:Uz,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},tE)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],i=Array.isArray(n.content)?n.content:[n.content],o=i.some(l=>l.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(l=>l.type==="tool_use");if(o){if(i.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let l=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),u=new Set(i.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(l.size!==u.size||![...l].every(d=>u.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},n2,r):this.request({method:"sampling/createMessage",params:e},Rg,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let i=e;return this.request({method:"elicitation/create",params:i},Nd,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let i=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:i},Nd,r);if(o.action==="accept"&&o.content&&i.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(i.requestedSchema)(o.content);if(!a.valid)throw new ne(ae.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof ne?s:new ne(ae.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},i2,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function Nq(t){return!!t&&typeof t=="object"&&yue in t}function _ue(t){return t[yue]?.complete}var yue,gue,bue=y(()=>{yue=Symbol.for("mcp.completable");(function(t){t.Completable="McpCompletable"})(gue||(gue={}))});var vue=y(()=>{});function yJe(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!gJe.test(t)){let r=t.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,i,o)=>o.indexOf(n)===i);return e.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function _Je(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function jq(t){let e=yJe(t);return _Je(t,e.warnings),e.isValid}var gJe,Sue=y(()=>{gJe=/^[A-Za-z0-9._-]{1,128}$/});var pA,wue=y(()=>{pA=class{constructor(e){this._mcpServer=e}registerToolTask(e,r,n){let i={taskSupport:"required",...r.execution};if(i.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,i,r._meta,n)}}});var Mq=y(()=>{Yk();Yk()});function kue(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function Eue(t){return"_def"in t||"_zod"in t||kue(t)}function Fq(t){return typeof t!="object"||t===null||Eue(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(kue)}function xue(t){if(t){if(Fq(t))return jc(t);if(!Eue(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function vJe(t){let e=Ws(t);return e?Object.entries(e).map(([r,n])=>{let i=Jie(n),o=Yie(n);return{name:r,description:i,required:!o}}):[]}function aa(t){let r=Ws(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=vk(r);if(typeof n=="string")return n;throw new Error("Schema method literal must be a string")}function $ue(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var mA,bJe,ay,Aue=y(()=>{hue();ig();U2();Fc();bue();vue();Sue();wue();Mq();mA=class{constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new fA(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new pA(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(aa(gE)),this.server.assertCanSetRequestHandler(aa(Dd)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(gE,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let n={name:e,title:r.title,description:r.description,inputSchema:(()=>{let i=Sd(r.inputSchema);return i?F2(i,{strictUnions:!0,pipeStrategy:"input"}):bJe})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let i=Sd(r.outputSchema);i&&(n.outputSchema=F2(i,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Dd,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new ne(ae.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new ne(ae.InvalidParams,`Tool ${e.params.name} disabled`);let i=!!e.params.task,o=n.execution?.taskSupport,s="createTask"in n.handler;if((o==="required"||o==="optional")&&!s)throw new ne(ae.InternalError,`Tool ${e.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!i)throw new ne(ae.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!i&&s)return await this.handleAutomaticTaskPolling(n,e,r);let a=await this.validateToolInput(n,e.params.arguments,e.params.name),c=await this.executeToolHandler(n,a,r);return i||await this.validateToolOutput(n,c,e.params.name),c}catch(n){if(n instanceof ne&&n.code===ae.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,n){if(!e.inputSchema)return;let o=Sd(e.inputSchema)??e.inputSchema,s=await _k(o,r);if(!s.success){let a="error"in s?s.error:"Unknown error",c=bk(a);throw new ne(ae.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${c}`)}return s.data}async validateToolOutput(e,r,n){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new ne(ae.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let i=Sd(e.outputSchema),o=await _k(i,r.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",a=bk(s);throw new ne(ae.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${a}`)}}async executeToolHandler(e,r,n){let i=e.handler;if("createTask"in i){if(!n.taskStore)throw new Error("No task store provided.");let s={...n,taskStore:n.taskStore};if(e.inputSchema){let a=i;return await Promise.resolve(a.createTask(r,s))}else{let a=i;return await Promise.resolve(a.createTask(s))}}if(e.inputSchema){let s=i;return await Promise.resolve(s(r,n))}else{let s=i;return await Promise.resolve(s(n))}}async handleAutomaticTaskPolling(e,r,n){if(!n.taskStore)throw new Error("No task store provided for task-capable tool.");let i=await this.validateToolInput(e,r.params.arguments,r.params.name),o=e.handler,s={...n,taskStore:n.taskStore},a=i?await Promise.resolve(o.createTask(i,s)):await Promise.resolve(o.createTask(s)),c=a.task.taskId,l=a.task,u=l.pollInterval??5e3;for(;l.status!=="completed"&&l.status!=="failed"&&l.status!=="cancelled";){await new Promise(f=>setTimeout(f,u));let d=await n.taskStore.getTask(c);if(!d)throw new ne(ae.InternalError,`Task ${c} not found during polling`);l=d}return await n.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(aa(_E)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(_E,async e=>{switch(e.params.ref.type){case"ref/prompt":return Pse(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Cse(e),this.handleResourceCompletion(e,e.params.ref);default:throw new ne(ae.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new ne(ae.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new ne(ae.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return ay;let o=Ws(n.argsSchema)?.[e.params.argument.name];if(!Nq(o))return ay;let s=_ue(o);if(!s)return ay;let a=await s(e.params.argument.value,e.params.context);return $ue(a)}async handleResourceCompletion(e,r){let n=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return ay;throw new ne(ae.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let i=n.resourceTemplate.completeCallback(e.params.argument.name);if(!i)return ay;let o=await i(e.params.argument.value,e.params.context);return $ue(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(aa(dE)),this.server.assertCanSetRequestHandler(aa(fE)),this.server.assertCanSetRequestHandler(aa(pE)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(dE,async(e,r)=>{let n=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),i=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(r);for(let a of s.resources)i.push({...o.metadata,...a})}return{resources:[...n,...i]}}),this.server.setRequestHandler(fE,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,n])=>({name:r,uriTemplate:n.resourceTemplate.uriTemplate.toString(),...n.metadata}))})),this.server.setRequestHandler(pE,async(e,r)=>{let n=new URL(e.params.uri),i=this._registeredResources[n.toString()];if(i){if(!i.enabled)throw new ne(ae.InvalidParams,`Resource ${n} disabled`);return i.readCallback(n,r)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(n.toString());if(s)return o.readCallback(n,s,r)}throw new ne(ae.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(aa(mE)),this.server.assertCanSetRequestHandler(aa(hE)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(mE,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?vJe(r.argsSchema):void 0}))})),this.server.setRequestHandler(hE,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new ne(ae.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new ne(ae.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let i=Sd(n.argsSchema),o=await _k(i,e.params.arguments);if(!o.success){let c="error"in o?o.error:"Unknown error",l=bk(c);throw new ne(ae.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${l}`)}let s=o.data,a=n.callback;return await Promise.resolve(a(s,r))}else{let i=n.callback;return await Promise.resolve(i(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...n){let i;typeof n[0]=="object"&&(i=n.shift());let o=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,void 0,r,i,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,r,i,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,r,n,i){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let o=this._createRegisteredResource(e,n.title,r,n,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,n.title,r,n,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(e,r,n,i,o){let s={name:e,title:r,metadata:i,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:a=>{typeof a.uri<"u"&&a.uri!==n&&(delete this._registeredResources[n],a.uri&&(this._registeredResources[a.uri]=s)),typeof a.name<"u"&&(s.name=a.name),typeof a.title<"u"&&(s.title=a.title),typeof a.metadata<"u"&&(s.metadata=a.metadata),typeof a.callback<"u"&&(s.readCallback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[n]=s,s}_createRegisteredResourceTemplate(e,r,n,i,o){let s={resourceTemplate:n,title:r,metadata:i,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredResourceTemplates[e],l.name&&(this._registeredResourceTemplates[l.name]=s)),typeof l.title<"u"&&(s.title=l.title),typeof l.template<"u"&&(s.resourceTemplate=l.template),typeof l.metadata<"u"&&(s.metadata=l.metadata),typeof l.callback<"u"&&(s.readCallback=l.callback),typeof l.enabled<"u"&&(s.enabled=l.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let a=n.uriTemplate.variableNames;return Array.isArray(a)&&a.some(l=>!!n.completeCallback(l))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,r,n,i,o){let s={title:r,description:n,argsSchema:i===void 0?void 0:jc(i),callback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{typeof a.name<"u"&&a.name!==e&&(delete this._registeredPrompts[e],a.name&&(this._registeredPrompts[a.name]=s)),typeof a.title<"u"&&(s.title=a.title),typeof a.description<"u"&&(s.description=a.description),typeof a.argsSchema<"u"&&(s.argsSchema=jc(a.argsSchema)),typeof a.callback<"u"&&(s.callback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=s,i&&Object.values(i).some(c=>{let l=c instanceof Rd?c._def?.innerType:c;return Nq(l)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(e,r,n,i,o,s,a,c,l){jq(e);let u={title:r,description:n,inputSchema:xue(i),outputSchema:xue(o),annotations:s,execution:a,_meta:c,handler:l,enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==e&&(typeof d.name=="string"&&jq(d.name),delete this._registeredTools[e],d.name&&(this._registeredTools[d.name]=u)),typeof d.title<"u"&&(u.title=d.title),typeof d.description<"u"&&(u.description=d.description),typeof d.paramsSchema<"u"&&(u.inputSchema=jc(d.paramsSchema)),typeof d.outputSchema<"u"&&(u.outputSchema=jc(d.outputSchema)),typeof d.callback<"u"&&(u.handler=d.callback),typeof d.annotations<"u"&&(u.annotations=d.annotations),typeof d._meta<"u"&&(u._meta=d._meta),typeof d.enabled<"u"&&(u.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=u,this.setToolRequestHandlers(),this.sendToolListChanged(),u}tool(e,...r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let n,i,o,s;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let c=r[0];if(Fq(c))i=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!Fq(r[0])&&(s=r.shift());else if(typeof c=="object"&&c!==null){if(Object.values(c).some(l=>typeof l=="object"&&l!==null))throw new Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=r.shift()}}let a=r[0];return this._createRegisteredTool(e,void 0,n,i,o,s,{taskSupport:"forbidden"},void 0,a)}registerTool(e,r,n){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:i,description:o,inputSchema:s,outputSchema:a,annotations:c,_meta:l}=r;return this._createRegisteredTool(e,i,o,s,a,c,{taskSupport:"forbidden"},l,n)}prompt(e,...r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let i;r.length>1&&(i=r.shift());let o=r[0],s=this._createRegisteredPrompt(e,void 0,n,i,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,r,n){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:i,description:o,argsSchema:s}=r,a=this._createRegisteredPrompt(e,i,o,s,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},bJe={type:"object",properties:{}};ay={completion:{values:[],hasMore:!1}}});import{readFileSync as SJe,existsSync as Oue}from"node:fs";import{dirname as wJe,join as hA}from"node:path";import{fileURLToPath as xJe}from"node:url";function cy(t,e){let r=kJe[t];r&&process.stderr.write(`cladding: persona '${t}' is now '${r}' \u2014 the old id is removed in 0.8 + deps: ${r}}`};var B3e={keyword:"dependencies",type:"object",schemaType:"object",error:oo.error,code(t){let[e,r]=H3e(t);yle(t,e),_le(t,r)}};function H3e({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function yle(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let o=r.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let c=(0,oy.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(c,()=>{for(let l of a)(0,oy.checkReportMissingProp)(t,l)}):(r.if((0,aq._)`${c} && (${(0,oy.checkMissingProp)(t,a,o)})`),(0,oy.reportMissingProp)(t,o),r.else())}}oo.validatePropertyDeps=yle;function _le(t,e=t.schema){let{gen:r,data:n,keyword:i,it:o}=t,s=r.name("valid");for(let a in e)(0,q3e.alwaysValidSchema)(o,e[a])||(r.if((0,oy.propertyInData)(r,n,a,o.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),t.ok(s))}oo.validateSchemaDeps=_le;oo.default=B3e});var Sle=v(cq=>{"use strict";Object.defineProperty(cq,"__esModule",{value:!0});var vle=we(),G3e=Ne(),Z3e={message:"property name must be valid",params:({params:t})=>(0,vle._)`{propertyName: ${t.propertyName}}`},V3e={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Z3e,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,G3e.alwaysValidSchema)(i,r))return;let o=e.name("valid");e.forIn("key",n,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,vle.not)(o),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(o)}};cq.default=V3e});var uq=v(lq=>{"use strict";Object.defineProperty(lq,"__esModule",{value:!0});var rA=Gn(),wi=we(),W3e=Ho(),nA=Ne(),K3e={message:"must NOT have additional properties",params:({params:t})=>(0,wi._)`{additionalProperty: ${t.additionalProperty}}`},J3e={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:K3e,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,nA.alwaysValidSchema)(s,r))return;let l=(0,rA.allSchemaProperties)(n.properties),u=(0,rA.allSchemaProperties)(n.patternProperties);d(),t.ok((0,wi._)`${o} === ${W3e.default.errors}`);function d(){e.forIn("key",i,g=>{!l.length&&!u.length?m(g):e.if(f(g),()=>m(g))})}function f(g){let b;if(l.length>8){let _=(0,nA.schemaRefOrVal)(s,n.properties,"properties");b=(0,rA.isOwnProperty)(e,_,g)}else l.length?b=(0,wi.or)(...l.map(_=>(0,wi._)`${g} === ${_}`)):b=wi.nil;return u.length&&(b=(0,wi.or)(b,...u.map(_=>(0,wi._)`${(0,rA.usePattern)(t,_)}.test(${g})`))),(0,wi.not)(b)}function p(g){e.code((0,wi._)`delete ${i}[${g}]`)}function m(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,nA.alwaysValidSchema)(s,r)){let b=e.name("valid");c.removeAdditional==="failing"?(h(g,b,!1),e.if((0,wi.not)(b),()=>{t.reset(),p(g)})):(h(g,b),a||e.if((0,wi.not)(b),()=>e.break()))}}function h(g,b,_){let S={keyword:"additionalProperties",dataProp:g,dataPropType:nA.Type.Str};_===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(S,b)}}};lq.default=J3e});var $le=v(fq=>{"use strict";Object.defineProperty(fq,"__esModule",{value:!0});var Y3e=Gg(),wle=Gn(),dq=Ne(),xle=uq(),X3e={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;o.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&xle.default.code(new Y3e.KeywordCxt(o,xle.default,"additionalProperties"));let s=(0,wle.allSchemaProperties)(r);for(let d of s)o.definedProperties.add(d);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=dq.mergeEvaluated.props(e,(0,dq.toHash)(s),o.props));let a=s.filter(d=>!(0,dq.alwaysValidSchema)(o,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)l(d)?u(d):(e.if((0,wle.propertyInData)(e,i,d,o.opts.ownProperties)),u(d),o.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function l(d){return o.opts.useDefaults&&!o.compositeRule&&r[d].default!==void 0}function u(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};fq.default=X3e});var Tle=v(pq=>{"use strict";Object.defineProperty(pq,"__esModule",{value:!0});var kle=Gn(),iA=we(),Ele=Ne(),Ale=Ne(),Q3e={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:o}=t,{opts:s}=o,a=(0,kle.allSchemaProperties)(r),c=a.filter(h=>(0,Ele.alwaysValidSchema)(o,r[h]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let l=s.strictSchema&&!s.allowMatchingProperties&&i.properties,u=e.name("valid");o.props!==!0&&!(o.props instanceof iA.Name)&&(o.props=(0,Ale.evaluatedPropsToName)(e,o.props));let{props:d}=o;f();function f(){for(let h of a)l&&p(h),o.allErrors?m(h):(e.var(u,!0),m(h),e.if(u))}function p(h){for(let g in l)new RegExp(h).test(g)&&(0,Ele.checkStrictMode)(o,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function m(h){e.forIn("key",n,g=>{e.if((0,iA._)`${(0,kle.usePattern)(t,h)}.test(${g})`,()=>{let b=c.includes(h);b||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:Ale.Type.Str},u),o.opts.unevaluated&&d!==!0?e.assign((0,iA._)`${d}[${g}]`,!0):!b&&!o.allErrors&&e.if((0,iA.not)(u),()=>e.break())})})}}};pq.default=Q3e});var Ole=v(mq=>{"use strict";Object.defineProperty(mq,"__esModule",{value:!0});var eKe=Ne(),tKe={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,eKe.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};mq.default=tKe});var Rle=v(hq=>{"use strict";Object.defineProperty(hq,"__esModule",{value:!0});var rKe=Gn(),nKe={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:rKe.validateUnion,error:{message:"must match a schema in anyOf"}};hq.default=nKe});var Ile=v(gq=>{"use strict";Object.defineProperty(gq,"__esModule",{value:!0});var oA=we(),iKe=Ne(),oKe={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,oA._)`{passingSchemas: ${t.passing}}`},sKe={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:oKe,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let o=r,s=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(l),t.result(s,()=>t.reset(),()=>t.error(!0));function l(){o.forEach((u,d)=>{let f;(0,iKe.alwaysValidSchema)(i,u)?e.var(c,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,oA._)`${c} && ${s}`).assign(s,!1).assign(a,(0,oA._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(s,!0),e.assign(a,d),f&&t.mergeEvaluated(f,oA.Name)})})}}};gq.default=sKe});var Ple=v(yq=>{"use strict";Object.defineProperty(yq,"__esModule",{value:!0});var aKe=Ne(),cKe={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((o,s)=>{if((0,aKe.alwaysValidSchema)(n,o))return;let a=t.subschema({keyword:"allOf",schemaProp:s},i);t.ok(i),t.mergeEvaluated(a)})}};yq.default=cKe});var Nle=v(_q=>{"use strict";Object.defineProperty(_q,"__esModule",{value:!0});var sA=we(),Dle=Ne(),lKe={message:({params:t})=>(0,sA.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,sA._)`{failingKeyword: ${t.ifClause}}`},uKe={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:lKe,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Dle.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=Cle(n,"then"),o=Cle(n,"else");if(!i&&!o)return;let s=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),i&&o){let u=e.let("ifClause");t.setParams({ifClause:u}),e.if(a,l("then",u),l("else",u))}else i?e.if(a,l("then")):e.if((0,sA.not)(a),l("else"));t.pass(s,()=>t.error(!0));function c(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(u)}function l(u,d){return()=>{let f=t.subschema({keyword:u},a);e.assign(s,a),t.mergeValidEvaluated(f,s),d?e.assign(d,(0,sA._)`${u}`):t.setParams({ifClause:u})}}}};function Cle(t,e){let r=t.schema[e];return r!==void 0&&!(0,Dle.alwaysValidSchema)(t,r)}_q.default=uKe});var jle=v(bq=>{"use strict";Object.defineProperty(bq,"__esModule",{value:!0});var dKe=Ne(),fKe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,dKe.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};bq.default=fKe});var Mle=v(vq=>{"use strict";Object.defineProperty(vq,"__esModule",{value:!0});var pKe=rq(),mKe=ple(),hKe=nq(),gKe=hle(),yKe=gle(),_Ke=ble(),bKe=Sle(),vKe=uq(),SKe=$le(),wKe=Tle(),xKe=Ole(),$Ke=Rle(),kKe=Ile(),EKe=Ple(),AKe=Nle(),TKe=jle();function OKe(t=!1){let e=[xKe.default,$Ke.default,kKe.default,EKe.default,AKe.default,TKe.default,bKe.default,vKe.default,_Ke.default,SKe.default,wKe.default];return t?e.push(mKe.default,gKe.default):e.push(pKe.default,hKe.default),e.push(yKe.default),e}vq.default=OKe});var Fle=v(Sq=>{"use strict";Object.defineProperty(Sq,"__esModule",{value:!0});var Pt=we(),RKe={message:({schemaCode:t})=>(0,Pt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Pt._)`{format: ${t}}`},IKe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:RKe,code(t,e){let{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;i?f():p();function f(){let m=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,Pt._)`${m}[${s}]`),g=r.let("fType"),b=r.let("format");r.if((0,Pt._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,Pt._)`${h}.type || "string"`).assign(b,(0,Pt._)`${h}.validate`),()=>r.assign(g,(0,Pt._)`"string"`).assign(b,h)),t.fail$data((0,Pt.or)(_(),S()));function _(){return c.strictSchema===!1?Pt.nil:(0,Pt._)`${s} && !${b}`}function S(){let x=u.$async?(0,Pt._)`(${h}.async ? await ${b}(${n}) : ${b}(${n}))`:(0,Pt._)`${b}(${n})`,w=(0,Pt._)`(typeof ${b} == "function" ? ${x} : ${b}.test(${n}))`;return(0,Pt._)`${b} && ${b} !== true && ${g} === ${e} && !${w}`}}function p(){let m=d.formats[o];if(!m){_();return}if(m===!0)return;let[h,g,b]=S(m);h===e&&t.pass(x());function _(){if(c.strictSchema===!1){d.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${o}" ignored in schema at path "${l}"`}}function S(w){let O=w instanceof RegExp?(0,Pt.regexpCode)(w):c.code.formats?(0,Pt._)`${c.code.formats}${(0,Pt.getProperty)(o)}`:void 0,T=r.scopeValue("formats",{key:o,ref:w,code:O});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,Pt._)`${T}.validate`]:["string",w,T]}function x(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Pt._)`await ${b}(${n})`}return typeof g=="function"?(0,Pt._)`${b}(${n})`:(0,Pt._)`${b}.test(${n})`}}}};Sq.default=IKe});var Lle=v(wq=>{"use strict";Object.defineProperty(wq,"__esModule",{value:!0});var PKe=Fle(),CKe=[PKe.default];wq.default=CKe});var zle=v(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.contentVocabulary=Wd.metadataVocabulary=void 0;Wd.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Wd.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var qle=v(xq=>{"use strict";Object.defineProperty(xq,"__esModule",{value:!0});var DKe=Kce(),NKe=lle(),jKe=Mle(),MKe=Lle(),Ule=zle(),FKe=[DKe.default,NKe.default,(0,jKe.default)(),MKe.default,Ule.metadataVocabulary,Ule.contentVocabulary];xq.default=FKe});var Hle=v(aA=>{"use strict";Object.defineProperty(aA,"__esModule",{value:!0});aA.DiscrError=void 0;var Ble;(function(t){t.Tag="tag",t.Mapping="mapping"})(Ble||(aA.DiscrError=Ble={}))});var Zle=v(kq=>{"use strict";Object.defineProperty(kq,"__esModule",{value:!0});var Kd=we(),$q=Hle(),Gle=HE(),LKe=Zg(),zKe=Ne(),UKe={message:({params:{discrError:t,tagName:e}})=>t===$q.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Kd._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},qKe={keyword:"discriminator",type:"object",schemaType:"object",error:UKe,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:o}=t,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,Kd._)`${r}${(0,Kd.getProperty)(a)}`);e.if((0,Kd._)`typeof ${l} == "string"`,()=>u(),()=>t.error(!1,{discrError:$q.DiscrError.Tag,tag:l,tagName:a})),t.ok(c);function u(){let p=f();e.if(!1);for(let m in p)e.elseIf((0,Kd._)`${l} === ${m}`),e.assign(c,d(p[m]));e.else(),t.error(!1,{discrError:$q.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function d(p){let m=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:p},m);return t.mergeEvaluated(h,Kd.Name),m}function f(){var p;let m={},h=b(i),g=!0;for(let x=0;x{BKe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Aq=v((pt,Eq)=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.MissingRefError=pt.ValidationError=pt.CodeGen=pt.Name=pt.nil=pt.stringify=pt.str=pt._=pt.KeywordCxt=pt.Ajv=void 0;var HKe=Bce(),GKe=qle(),ZKe=Zle(),Wle=Vle(),VKe=["/properties"],cA="http://json-schema.org/draft-07/schema",Jd=class extends HKe.default{_addVocabularies(){super._addVocabularies(),GKe.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(ZKe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Wle,VKe):Wle;this.addMetaSchema(e,cA,!1),this.refs["http://json-schema.org/schema"]=cA}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(cA)?cA:void 0)}};pt.Ajv=Jd;Eq.exports=pt=Jd;Eq.exports.Ajv=Jd;Object.defineProperty(pt,"__esModule",{value:!0});pt.default=Jd;var WKe=Gg();Object.defineProperty(pt,"KeywordCxt",{enumerable:!0,get:function(){return WKe.KeywordCxt}});var Yd=we();Object.defineProperty(pt,"_",{enumerable:!0,get:function(){return Yd._}});Object.defineProperty(pt,"str",{enumerable:!0,get:function(){return Yd.str}});Object.defineProperty(pt,"stringify",{enumerable:!0,get:function(){return Yd.stringify}});Object.defineProperty(pt,"nil",{enumerable:!0,get:function(){return Yd.nil}});Object.defineProperty(pt,"Name",{enumerable:!0,get:function(){return Yd.Name}});Object.defineProperty(pt,"CodeGen",{enumerable:!0,get:function(){return Yd.CodeGen}});var KKe=qE();Object.defineProperty(pt,"ValidationError",{enumerable:!0,get:function(){return KKe.default}});var JKe=Zg();Object.defineProperty(pt,"MissingRefError",{enumerable:!0,get:function(){return JKe.default}})});var rue=v(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.formatNames=ao.fastFormats=ao.fullFormats=void 0;function so(t,e){return{validate:t,compare:e}}ao.fullFormats={date:so(Xle,Iq),time:so(Oq(!0),Pq),"date-time":so(Kle(!0),eue),"iso-time":so(Oq(),Qle),"iso-date-time":so(Kle(),tue),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:rJe,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:lJe,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:nJe,int32:{type:"number",validate:sJe},int64:{type:"number",validate:aJe},float:{type:"number",validate:Yle},double:{type:"number",validate:Yle},password:!0,binary:!0};ao.fastFormats={...ao.fullFormats,date:so(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Iq),time:so(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Pq),"date-time":so(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,eue),"iso-time":so(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Qle),"iso-date-time":so(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,tue),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};ao.formatNames=Object.keys(ao.fullFormats);function YKe(t){return t%4===0&&(t%100!==0||t%400===0)}var XKe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,QKe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Xle(t){let e=XKe.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&YKe(r)?29:QKe[n])}function Iq(t,e){if(t&&e)return t>e?1:t23||u>59||t&&!a)return!1;if(i<=23&&o<=59&&s<60)return!0;let d=o-u*c,f=i-l*c-(d<0?1:0);return(f===23||f===-1)&&(d===59||d===-1)&&s<61}}function Pq(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function Qle(t,e){if(!(t&&e))return;let r=Tq.exec(t),n=Tq.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=iJe}function aJe(t){return Number.isInteger(t)}function Yle(){return!0}var cJe=/[^\\]\\Z/;function lJe(t){if(cJe.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var nue=v(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.formatLimitDefinition=void 0;var uJe=Aq(),xi=we(),sa=xi.operators,lA={formatMaximum:{okStr:"<=",ok:sa.LTE,fail:sa.GT},formatMinimum:{okStr:">=",ok:sa.GTE,fail:sa.LT},formatExclusiveMaximum:{okStr:"<",ok:sa.LT,fail:sa.GTE},formatExclusiveMinimum:{okStr:">",ok:sa.GT,fail:sa.LTE}},dJe={message:({keyword:t,schemaCode:e})=>(0,xi.str)`should be ${lA[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,xi._)`{comparison: ${lA[t].okStr}, limit: ${e}}`};Xd.formatLimitDefinition={keyword:Object.keys(lA),type:"string",schemaType:"string",$data:!0,error:dJe,code(t){let{gen:e,data:r,schemaCode:n,keyword:i,it:o}=t,{opts:s,self:a}=o;if(!s.validateFormats)return;let c=new uJe.KeywordCxt(o,a.RULES.all.format.definition,"format");c.$data?l():u();function l(){let f=e.scopeValue("formats",{ref:a.formats,code:s.code.formats}),p=e.const("fmt",(0,xi._)`${f}[${c.schemaCode}]`);t.fail$data((0,xi.or)((0,xi._)`typeof ${p} != "object"`,(0,xi._)`${p} instanceof RegExp`,(0,xi._)`typeof ${p}.compare != "function"`,d(p)))}function u(){let f=c.schema,p=a.formats[f];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${i}": format "${f}" does not define "compare" function`);let m=e.scopeValue("formats",{key:f,ref:p,code:s.code.formats?(0,xi._)`${s.code.formats}${(0,xi.getProperty)(f)}`:void 0});t.fail$data(d(m))}function d(f){return(0,xi._)`${f}.compare(${r}, ${n}) ${lA[i].fail} 0`}},dependencies:["format"]};var fJe=t=>(t.addKeyword(Xd.formatLimitDefinition),t);Xd.default=fJe});var aue=v((sy,sue)=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});var Qd=rue(),pJe=nue(),Cq=we(),iue=new Cq.Name("fullFormats"),mJe=new Cq.Name("fastFormats"),Dq=(t,e={keywords:!0})=>{if(Array.isArray(e))return oue(t,e,Qd.fullFormats,iue),t;let[r,n]=e.mode==="fast"?[Qd.fastFormats,mJe]:[Qd.fullFormats,iue],i=e.formats||Qd.formatNames;return oue(t,i,r,n),e.keywords&&(0,pJe.default)(t),t};Dq.get=(t,e="full")=>{let n=(e==="fast"?Qd.fastFormats:Qd.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function oue(t,e,r,n){var i,o;(i=(o=t.opts.code).formats)!==null&&i!==void 0||(o.formats=(0,Cq._)`require("ajv-formats/dist/formats").${n}`);for(let s of e)t.addFormat(s,r[s])}sue.exports=sy=Dq;Object.defineProperty(sy,"__esModule",{value:!0});sy.default=Dq});function hJe(){let t=new cue.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,lue.default)(t),t}var cue,lue,uA,uue=y(()=>{cue=St(Aq(),1),lue=St(aue(),1);uA=class{constructor(e){this._ajv=e??hJe()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}}});var dA,due=y(()=>{Fc();dA=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],o=Array.isArray(i.content)?i.content:[i.content],s=o.some(u=>u.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],l=c.some(u=>u.type==="tool_use");if(s){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let u=new Set(c.filter(f=>f.type==="tool_use").map(f=>f.id)),d=new Set(o.filter(f=>f.type==="tool_result").map(f=>f.toolUseId));if(u.size!==d.size||![...u].every(f=>d.has(f)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},Rg,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),i=e.mode??"form";switch(i){case"url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=i==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},Nd,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}}});function fue(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function pue(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var mue=y(()=>{});var fA,hue=y(()=>{yae();Fc();uue();ig();due();mue();fA=class extends OE{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Og.options.map((n,i)=>[n,i])),this.isMessageIgnored=(n,i)=>{let o=this._loggingLevels.get(i);return o?this.LOG_LEVEL_SEVERITY.get(n)this._oninitialize(n)),this.setNotificationHandler(Vz,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(r2,async(n,i)=>{let o=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=n.params,a=Og.safeParse(s);return a.success&&this._loggingLevels.set(o,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new dA(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=gae(this._capabilities,e)}setRequestHandler(e,r){let i=Ws(e)?.method;if(!i)throw new Error("Schema is missing a method literal");let o;if(zn(i)){let a=i;o=a._zod?.def?.value??a.value}else{let a=i;o=a._def?.value??a.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let a=async(c,l)=>{let u=Vs(Dd,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new ie(ae.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=Vs(Pd,f);if(!m.success){let h=m.error instanceof Error?m.error.message:String(m.error);throw new ie(ae.InvalidParams,`Invalid task creation result: ${h}`)}return m.data}let p=Vs(yE,f);if(!p.success){let m=p.error instanceof Error?p.error.message:String(p.error);throw new ie(ae.InvalidParams,`Invalid tools/call result: ${m}`)}return p.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){pue(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&fue(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:gse.includes(r)?r:Uz,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},tE)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],i=Array.isArray(n.content)?n.content:[n.content],o=i.some(l=>l.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=s?Array.isArray(s.content)?s.content:[s.content]:[],c=a.some(l=>l.type==="tool_use");if(o){if(i.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let l=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),u=new Set(i.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(l.size!==u.size||![...l].every(d=>u.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},n2,r):this.request({method:"sampling/createMessage",params:e},Rg,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let i=e;return this.request({method:"elicitation/create",params:i},Nd,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let i=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:i},Nd,r);if(o.action==="accept"&&o.content&&i.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(i.requestedSchema)(o.content);if(!a.valid)throw new ie(ae.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(s){throw s instanceof ie?s:new ie(ae.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},i2,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}});function Nq(t){return!!t&&typeof t=="object"&&yue in t}function _ue(t){return t[yue]?.complete}var yue,gue,bue=y(()=>{yue=Symbol.for("mcp.completable");(function(t){t.Completable="McpCompletable"})(gue||(gue={}))});var vue=y(()=>{});function yJe(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!gJe.test(t)){let r=t.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,i,o)=>o.indexOf(n)===i);return e.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function _Je(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function jq(t){let e=yJe(t);return _Je(t,e.warnings),e.isValid}var gJe,Sue=y(()=>{gJe=/^[A-Za-z0-9._-]{1,128}$/});var pA,wue=y(()=>{pA=class{constructor(e){this._mcpServer=e}registerToolTask(e,r,n){let i={taskSupport:"required",...r.execution};if(i.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,i,r._meta,n)}}});var Mq=y(()=>{Yk();Yk()});function kue(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function Eue(t){return"_def"in t||"_zod"in t||kue(t)}function Fq(t){return typeof t!="object"||t===null||Eue(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(kue)}function xue(t){if(t){if(Fq(t))return jc(t);if(!Eue(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function vJe(t){let e=Ws(t);return e?Object.entries(e).map(([r,n])=>{let i=Jie(n),o=Yie(n);return{name:r,description:i,required:!o}}):[]}function aa(t){let r=Ws(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=vk(r);if(typeof n=="string")return n;throw new Error("Schema method literal must be a string")}function $ue(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var mA,bJe,ay,Aue=y(()=>{hue();ig();U2();Fc();bue();vue();Sue();wue();Mq();mA=class{constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new fA(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new pA(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(aa(gE)),this.server.assertCanSetRequestHandler(aa(Dd)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(gE,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let n={name:e,title:r.title,description:r.description,inputSchema:(()=>{let i=Sd(r.inputSchema);return i?F2(i,{strictUnions:!0,pipeStrategy:"input"}):bJe})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let i=Sd(r.outputSchema);i&&(n.outputSchema=F2(i,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(Dd,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new ie(ae.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new ie(ae.InvalidParams,`Tool ${e.params.name} disabled`);let i=!!e.params.task,o=n.execution?.taskSupport,s="createTask"in n.handler;if((o==="required"||o==="optional")&&!s)throw new ie(ae.InternalError,`Tool ${e.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!i)throw new ie(ae.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!i&&s)return await this.handleAutomaticTaskPolling(n,e,r);let a=await this.validateToolInput(n,e.params.arguments,e.params.name),c=await this.executeToolHandler(n,a,r);return i||await this.validateToolOutput(n,c,e.params.name),c}catch(n){if(n instanceof ie&&n.code===ae.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,n){if(!e.inputSchema)return;let o=Sd(e.inputSchema)??e.inputSchema,s=await _k(o,r);if(!s.success){let a="error"in s?s.error:"Unknown error",c=bk(a);throw new ie(ae.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${c}`)}return s.data}async validateToolOutput(e,r,n){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new ie(ae.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let i=Sd(e.outputSchema),o=await _k(i,r.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",a=bk(s);throw new ie(ae.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${a}`)}}async executeToolHandler(e,r,n){let i=e.handler;if("createTask"in i){if(!n.taskStore)throw new Error("No task store provided.");let s={...n,taskStore:n.taskStore};if(e.inputSchema){let a=i;return await Promise.resolve(a.createTask(r,s))}else{let a=i;return await Promise.resolve(a.createTask(s))}}if(e.inputSchema){let s=i;return await Promise.resolve(s(r,n))}else{let s=i;return await Promise.resolve(s(n))}}async handleAutomaticTaskPolling(e,r,n){if(!n.taskStore)throw new Error("No task store provided for task-capable tool.");let i=await this.validateToolInput(e,r.params.arguments,r.params.name),o=e.handler,s={...n,taskStore:n.taskStore},a=i?await Promise.resolve(o.createTask(i,s)):await Promise.resolve(o.createTask(s)),c=a.task.taskId,l=a.task,u=l.pollInterval??5e3;for(;l.status!=="completed"&&l.status!=="failed"&&l.status!=="cancelled";){await new Promise(f=>setTimeout(f,u));let d=await n.taskStore.getTask(c);if(!d)throw new ie(ae.InternalError,`Task ${c} not found during polling`);l=d}return await n.taskStore.getTaskResult(c)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(aa(_E)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(_E,async e=>{switch(e.params.ref.type){case"ref/prompt":return Pse(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Cse(e),this.handleResourceCompletion(e,e.params.ref);default:throw new ie(ae.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new ie(ae.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new ie(ae.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return ay;let o=Ws(n.argsSchema)?.[e.params.argument.name];if(!Nq(o))return ay;let s=_ue(o);if(!s)return ay;let a=await s(e.params.argument.value,e.params.context);return $ue(a)}async handleResourceCompletion(e,r){let n=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return ay;throw new ie(ae.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let i=n.resourceTemplate.completeCallback(e.params.argument.name);if(!i)return ay;let o=await i(e.params.argument.value,e.params.context);return $ue(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(aa(dE)),this.server.assertCanSetRequestHandler(aa(fE)),this.server.assertCanSetRequestHandler(aa(pE)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(dE,async(e,r)=>{let n=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),i=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(r);for(let a of s.resources)i.push({...o.metadata,...a})}return{resources:[...n,...i]}}),this.server.setRequestHandler(fE,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,n])=>({name:r,uriTemplate:n.resourceTemplate.uriTemplate.toString(),...n.metadata}))})),this.server.setRequestHandler(pE,async(e,r)=>{let n=new URL(e.params.uri),i=this._registeredResources[n.toString()];if(i){if(!i.enabled)throw new ie(ae.InvalidParams,`Resource ${n} disabled`);return i.readCallback(n,r)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(n.toString());if(s)return o.readCallback(n,s,r)}throw new ie(ae.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(aa(mE)),this.server.assertCanSetRequestHandler(aa(hE)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(mE,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?vJe(r.argsSchema):void 0}))})),this.server.setRequestHandler(hE,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new ie(ae.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new ie(ae.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let i=Sd(n.argsSchema),o=await _k(i,e.params.arguments);if(!o.success){let c="error"in o?o.error:"Unknown error",l=bk(c);throw new ie(ae.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${l}`)}let s=o.data,a=n.callback;return await Promise.resolve(a(s,r))}else{let i=n.callback;return await Promise.resolve(i(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...n){let i;typeof n[0]=="object"&&(i=n.shift());let o=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,void 0,r,i,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,r,i,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,r,n,i){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let o=this._createRegisteredResource(e,n.title,r,n,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,n.title,r,n,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(e,r,n,i,o){let s={name:e,title:r,metadata:i,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:a=>{typeof a.uri<"u"&&a.uri!==n&&(delete this._registeredResources[n],a.uri&&(this._registeredResources[a.uri]=s)),typeof a.name<"u"&&(s.name=a.name),typeof a.title<"u"&&(s.title=a.title),typeof a.metadata<"u"&&(s.metadata=a.metadata),typeof a.callback<"u"&&(s.readCallback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendResourceListChanged()}};return this._registeredResources[n]=s,s}_createRegisteredResourceTemplate(e,r,n,i,o){let s={resourceTemplate:n,title:r,metadata:i,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredResourceTemplates[e],l.name&&(this._registeredResourceTemplates[l.name]=s)),typeof l.title<"u"&&(s.title=l.title),typeof l.template<"u"&&(s.resourceTemplate=l.template),typeof l.metadata<"u"&&(s.metadata=l.metadata),typeof l.callback<"u"&&(s.readCallback=l.callback),typeof l.enabled<"u"&&(s.enabled=l.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let a=n.uriTemplate.variableNames;return Array.isArray(a)&&a.some(l=>!!n.completeCallback(l))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,r,n,i,o){let s={title:r,description:n,argsSchema:i===void 0?void 0:jc(i),callback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:a=>{typeof a.name<"u"&&a.name!==e&&(delete this._registeredPrompts[e],a.name&&(this._registeredPrompts[a.name]=s)),typeof a.title<"u"&&(s.title=a.title),typeof a.description<"u"&&(s.description=a.description),typeof a.argsSchema<"u"&&(s.argsSchema=jc(a.argsSchema)),typeof a.callback<"u"&&(s.callback=a.callback),typeof a.enabled<"u"&&(s.enabled=a.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=s,i&&Object.values(i).some(c=>{let l=c instanceof Rd?c._def?.innerType:c;return Nq(l)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(e,r,n,i,o,s,a,c,l){jq(e);let u={title:r,description:n,inputSchema:xue(i),outputSchema:xue(o),annotations:s,execution:a,_meta:c,handler:l,enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==e&&(typeof d.name=="string"&&jq(d.name),delete this._registeredTools[e],d.name&&(this._registeredTools[d.name]=u)),typeof d.title<"u"&&(u.title=d.title),typeof d.description<"u"&&(u.description=d.description),typeof d.paramsSchema<"u"&&(u.inputSchema=jc(d.paramsSchema)),typeof d.outputSchema<"u"&&(u.outputSchema=jc(d.outputSchema)),typeof d.callback<"u"&&(u.handler=d.callback),typeof d.annotations<"u"&&(u.annotations=d.annotations),typeof d._meta<"u"&&(u._meta=d._meta),typeof d.enabled<"u"&&(u.enabled=d.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=u,this.setToolRequestHandlers(),this.sendToolListChanged(),u}tool(e,...r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let n,i,o,s;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let c=r[0];if(Fq(c))i=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!Fq(r[0])&&(s=r.shift());else if(typeof c=="object"&&c!==null){if(Object.values(c).some(l=>typeof l=="object"&&l!==null))throw new Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=r.shift()}}let a=r[0];return this._createRegisteredTool(e,void 0,n,i,o,s,{taskSupport:"forbidden"},void 0,a)}registerTool(e,r,n){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:i,description:o,inputSchema:s,outputSchema:a,annotations:c,_meta:l}=r;return this._createRegisteredTool(e,i,o,s,a,c,{taskSupport:"forbidden"},l,n)}prompt(e,...r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let i;r.length>1&&(i=r.shift());let o=r[0],s=this._createRegisteredPrompt(e,void 0,n,i,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,r,n){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:i,description:o,argsSchema:s}=r,a=this._createRegisteredPrompt(e,i,o,s,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},bJe={type:"object",properties:{}};ay={completion:{values:[],hasMore:!1}}});import{readFileSync as SJe,existsSync as Oue}from"node:fs";import{dirname as wJe,join as hA}from"node:path";import{fileURLToPath as xJe}from"node:url";function cy(t,e){let r=kJe[t];r&&process.stderr.write(`cladding: persona '${t}' is now '${r}' \u2014 the old id is removed in 0.8 `);let n=r??t,i=EJe(n,e),o=Tue.get(i);if(o)return o;if(!Oue(i))throw new Error(`agents/${n}.md not found at ${i}`);let s=AJe(n,SJe(i,"utf8"));return Tue.set(i,s),s}function EJe(t,e){if(e)return hA(e,"agents",`${t}.md`);let r=wJe(xJe(import.meta.url)),n=[hA(r,`${t}.md`),hA(r,"agents",`${t}.md`),hA(r,"..","plugins","claude-code","agents",`${t}.md`)];return n.find(i=>Oue(i))??n[1]}function AJe(t,e){let{frontmatter:r,body:n}=TJe(e),i=OJe(r.capabilities);return{id:r.name??t,body:n.trim(),capabilities:i}}function TJe(t){if(!t.startsWith(`--- `))return{frontmatter:{},body:t};let e=t.indexOf(` --- @@ -643,8 +643,8 @@ name: ${i} `))}catch{return"failed"}}function hCe(t){try{let e=si(t),r=e==null?{}:JSON.parse(e),n=r.permissions;if(n!==void 0&&(typeof n!="object"||n===null||Array.isArray(n)))return"skipped-different";let i=n??{},o=i.allow;if(o!==void 0&&(!Array.isArray(o)||o.some(u=>typeof u!="string")))return"skipped-different";let s=i.deny;if(s!==void 0&&(!Array.isArray(s)||s.some(u=>typeof u!="string")))return"skipped-different";let a=o??[],c=s??[],l=[...a];for(let u of eCe)l.includes(u)||l.push(u);return l.length===a.length&&s!==void 0?"unchanged":(i.allow=l,i.deny=c,r.permissions=i,Qa(t,`${JSON.stringify(r,null,2)} `))}catch{return"failed"}}async function gCe(t,e,r){try{let{parse:n,stringify:i}=await Promise.resolve().then(()=>(BC(),qC)),o=si(t),s=o==null?{}:n(o);(!s.mcp_servers||typeof s.mcp_servers!="object")&&(s.mcp_servers={});let a=s.mcp_servers,c=a.cladding,l={command:e.command,args:e.args,description:"cladding MCP server (project-scoped by `clad setup`)",default_tools_approval_mode:"writes"};return JSON.stringify(c)===JSON.stringify(l)?"unchanged":c&&!r&&!Hp(c,[])?"skipped-different":(a.cladding=l,Qa(t,i(s)))}catch{return"failed"}}function yCe(t){let e=["---","description: Cladding bootstrap boundary","alwaysApply: true","---","","Cladding is available only in this project. Do not initialize or invoke Cladding for ordinary work.","Use the cladding-init skill only when the user explicitly names Cladding and asks to initialize, adopt, or refresh it.",""].join(` `);return Qa(he(t,".cursor","rules","cladding-bootstrap.mdc"),e)}function Yl(t){return t.includes("failed")?"failed":t.includes("skipped-different")?"skipped-different":t.includes("manual-required")?"manual-required":t.includes("removed")?"removed":t.includes("rewired")?"rewired":t.includes("created")?"created":"unchanged"}function UY(t){try{return JSON.parse(vS(t,"utf8")).cladding_version??null}catch{return null}}function NY(t,e,r,n){t==="failed"&&r.push({step:e,message:"project wiring failed"}),t==="skipped-different"&&n.push({step:e,message:"existing non-Cladding configuration was preserved; use --force to replace only the cladding entry"}),t==="manual-required"&&n.push({step:e,message:"run `claude plugin uninstall claude-code@cladding --scope user --keep-data` to remove the legacy user plugin"})}async function WC(t={}){let e=t.home??MY(),r=Ss(t.projectRoot??process.cwd()),n=t.pkgRoot??qY(),i=t.version??BY(n),o=bCe(e),s=new Set(t.hosts??QPe.filter(K=>o[K])),a=t.force??!1,c=he(r,".cladding",GC),l=UY(c),u=[],d=[];yS(r),pCe(r);let f=[Qa(he(r,ZC),dCe(n))];s.has("gemini")&&f.push(Qa(he(r,VC),fCe()));let p=Yl(f),m=he(n,"plugins","codex","skills","init"),h=s.has("codex")||s.has("gemini")||s.has("antigravity")?HC(m,he(r,".agents","skills","cladding-init"),a):"unchanged",g=mCe(),b=rCe(e,n),_=bS(he(e,".claude","plugins","cladding"),b),S=_==="removed"?uCe(t.activate??!0):"unchanged",x={claude_plugin:Yl([_,S]),gemini_extension:bS(he(e,".gemini","extensions","cladding"),b),antigravity_plugin:cCe(e,b),codex_skills:nCe(e,b),codex_mcp:await oCe(e,b),cursor_mcp:sCe(e,b)},w=s.has("codex")?await gCe(he(r,".codex","config.toml"),g,a):"skipped-not-selected",O=s.has("gemini")?Bp(he(r,".gemini","settings.json"),g,a):"skipped-not-selected",T=s.has("antigravity")?Yl([Bp(he(r,".agents","mcp_config.json"),g,a),aCe(e,n,a)]):"skipped-not-selected",A=s.has("claude")?Yl([HC(m,he(r,".claude","skills","cladding-init"),a),Bp(he(r,".mcp.json"),g,a)]):"skipped-not-selected",D=s.has("cursor")?Yl([HC(m,he(r,".cursor","skills","cladding-init"),a),Bp(he(r,".cursor","mcp.json"),g,a),hCe(he(r,".cursor","cli.json")),yCe(r)]):"skipped-not-selected",$={runtime:p,shared_init_skill:h,claude:A,codex:w,gemini:O,antigravity:T,cursor:D};s.size===0&&d.push({step:"hosts",message:"no supported AI host detected on this machine \u2014 only the shared runtime was written; use `clad setup --host ` to wire explicitly"});for(let[K,xe]of Object.entries($))NY(xe,K,u,d);for(let[K,xe]of Object.entries(x))NY(xe,`legacy:${K}`,u,d);yS(vs(c)),Xa(c,`${JSON.stringify({project_root:r,cladding_root:n,cladding_version:i,last_run:new Date().toISOString()},null,2)} -`,"utf8");let ie={projectRoot:r,wiring:$,legacyCleanup:x,errors:u,warnings:d,statusFile:c,cladding_root:n,cladding_version:i,last_setup_version:l};return t.quiet||process.stdout.write(`${_Ce(ie)} -`),ie}function qp(t){switch(t){case"created":return"wired";case"rewired":return"updated";case"unchanged":return"already ready";case"removed":return"legacy global removed";case"skipped-not-selected":return"not selected";case"skipped-different":return"preserved conflict";case"manual-required":return"manual cleanup required";default:return"failed"}}function _Ce(t,e){let r=[`cladding setup \u2014 project activation: ${t.projectRoot}`,"",` Claude Code \u2192 ${qp(t.wiring.claude)}`,` Codex \u2192 ${qp(t.wiring.codex)}`,` Gemini CLI \u2192 ${qp(t.wiring.gemini)}`,` Antigravity \u2192 ${qp(t.wiring.antigravity)}`,` Cursor \u2192 ${qp(t.wiring.cursor)}`];(t.wiring.antigravity==="created"||t.wiring.antigravity==="rewired")&&r.push(""," Note: Antigravity reads MCP config machine-wide only, so its wire lives in ~/.gemini/config/plugins/cladding (each session still resolves the project from its working directory).");let n=Object.values(t.legacyCleanup).filter(i=>i==="removed").length;n>0&&r.push("",`Removed ${n} legacy global Cladding wire(s).`);for(let i of t.warnings)r.push(` ! ${i.step}: ${i.message}`);return r.push("","Next steps:"," 1. Start a new AI session in this project directory",' 2. Ask: "Apply Cladding to this project"'," 3. Review the preview and reply with its exact approval phrase"," 4. After initialization, develop normally in natural language"),r.join(` +`,"utf8");let re={projectRoot:r,wiring:$,legacyCleanup:x,errors:u,warnings:d,statusFile:c,cladding_root:n,cladding_version:i,last_setup_version:l};return t.quiet||process.stdout.write(`${_Ce(re)} +`),re}function qp(t){switch(t){case"created":return"wired";case"rewired":return"updated";case"unchanged":return"already ready";case"removed":return"legacy global removed";case"skipped-not-selected":return"not selected";case"skipped-different":return"preserved conflict";case"manual-required":return"manual cleanup required";default:return"failed"}}function _Ce(t,e){let r=[`cladding setup \u2014 project activation: ${t.projectRoot}`,"",` Claude Code \u2192 ${qp(t.wiring.claude)}`,` Codex \u2192 ${qp(t.wiring.codex)}`,` Gemini CLI \u2192 ${qp(t.wiring.gemini)}`,` Antigravity \u2192 ${qp(t.wiring.antigravity)}`,` Cursor \u2192 ${qp(t.wiring.cursor)}`];(t.wiring.antigravity==="created"||t.wiring.antigravity==="rewired")&&r.push(""," Note: Antigravity reads MCP config machine-wide only, so its wire lives in ~/.gemini/config/plugins/cladding (each session still resolves the project from its working directory).");let n=Object.values(t.legacyCleanup).filter(i=>i==="removed").length;n>0&&r.push("",`Removed ${n} legacy global Cladding wire(s).`);for(let i of t.warnings)r.push(` ! ${i.step}: ${i.message}`);return r.push("","Next steps:"," 1. Start a new AI session in this project directory",' 2. Ask: "Apply Cladding to this project"'," 3. Review the preview and reply with its exact approval phrase"," 4. After initialization, develop normally in natural language"),r.join(` `)}function qY(){let t=XPe(import.meta.url),e=vs(t);for(let r=0;r<7;r++){try{if(JSON.parse(vS(he(e,"package.json"),"utf8")).name==="cladding")return e}catch{}e=vs(e)}return Ss(vs(t),"..")}function BY(t){try{return JSON.parse(vS(he(t,"package.json"),"utf8")).version??"unknown"}catch{return"unknown"}}function Xl(){let t=BY(qY());return t==="unknown"?null:t}function HY(t=process.cwd()){return UY(he(Ss(t),".cladding",GC))}function bCe(t=MY()){return{claude:Pn(he(t,".claude")),gemini:Pn(he(t,".gemini")),antigravity:Pn(he(t,".gemini","config"))||Pn(he(t,".gemini","antigravity-cli")),codex:Pn(he(t,".codex")),agents:Pn(he(t,".agents")),cursor:Pn(he(t,".cursor"))}}Ue();Ii();var wCe=["claude","gemini","antigravity","codex","cursor"],Ao={"list-features":{pattern:/F-[0-9a-f]{6,8}/,label:"a real feature id (F-xxxxxx)"},"get-feature":{pattern:/F-[0-9a-f]{6,8}/,label:"the queried feature id echoed"},"run-check":{pattern:/\b[Dd]rift\b|\b[Ff]indings?\b|\bGREEN\b|\bRED\b/,label:"a drift verdict (drift/findings/GREEN/RED)"}};function Ql(t,e=200){let r=t.replace(/\s+/g," ").trim();return r.length<=e?r:r.slice(-e)}function xCe(t,e,r){if(/\b(?:MCP|tool|clad_[a-z0-9_]+)(?:\s+tool)?(?:\s+calls?)?[^.\n]{0,80}\b(?:rejected|denied|refused|cancelled|canceled|not approved)\b|\buser cancelle?d MCP tool call\b|\bno tool payload\b|\bdon't have a findings count\b|\bre-approve the cladding MCP tool\b/i.test(e))return{result:"fail",sentinel:Ao[t].label,evidence:Ql(e)};let i=Ao[t].pattern,o=Ao[t].label;return t==="get-feature"&&r&&(i=new RegExp(r),o=`the queried id ${r} echoed`),{result:i.test(e)?"pass":"fail",sentinel:o,evidence:Ql(e)}}var $Ce={"list-features":()=>"Call the clad_list_features MCP tool and print exactly one feature id (format F-xxxxxxxx) from the result, nothing else.","get-feature":t=>`Call the clad_get_feature MCP tool for id ${t} and print that id verbatim.`,"run-check":()=>"Call the clad_run_check MCP tool and print the number of findings plus the word 'findings'."};function kCe(t,e){switch(t){case"claude":return{command:"claude",args:["-p",e,"--output-format","text","--settings",'{"enableAllProjectMcpServers":true}']};case"gemini":return{command:"gemini",args:["--skip-trust","--approval-mode","plan","--policy",VC,"--allowed-mcp-server-names","cladding","-o","text","-p",e]};case"antigravity":return{command:"agy",args:["--dangerously-skip-permissions","-p",e]};case"codex":return{command:"codex",args:["exec","--dangerously-bypass-approvals-and-sandbox",e]};case"cursor":return{command:"cursor-agent",args:["-p","--mode","ask","--trust","--approve-mcps",e]}}}function ECe(t){return t==="antigravity"?"agy":t==="cursor"?"cursor-agent":t}var GY={"list-features":12e4,"get-feature":12e4,"run-check":3e5},ACe=1e4;function TCe(t){let e=YC()==="win32"?"where":"which";return JC(e,[t],{stdio:"ignore"}).status===0}function OCe(t,e,r){let n=JC(t,[...e],{cwd:r.cwd,encoding:"utf8",timeout:r.timeoutMs,shell:YC()==="win32"});return{stdout:n.stdout??"",stderr:n.stderr??"",timedOut:n.signal==="SIGTERM"||n.error?.code==="ETIMEDOUT",code:n.status}}function RCe(t,e,r){let n=JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2024-11-05",capabilities:{},clientInfo:{name:"clad-doctor-hosts",version:"1"}}}),i=JSON.stringify({jsonrpc:"2.0",method:"notifications/initialized"}),o=JSON.stringify({jsonrpc:"2.0",id:2,method:"tools/list",params:{}}),s=`${n} ${i} ${o} @@ -815,10 +815,10 @@ ${r} `),!0}function xUe(t){let e=Sc(t,".github","workflows","cladding.yml");return Zm(e)?"exists":(kx(Sc(t,".github","workflows"),{recursive:!0}),Vm(e,["# Cladding \xB7 authoritative gate \u2014 scaffolded by `clad init --with-ci`.","# Local git hooks reduce latency; THIS check (as a required status check","# under branch protection) is where enforcement is real.","name: cladding gate","on:"," push:"," pull_request:","jobs:"," gate:"," runs-on: ubuntu-latest"," steps:"," - uses: actions/checkout@v4"," with:"," fetch-depth: 0 # history-aware detectors (attestation/staleness) need more than a shallow clone"," - uses: actions/setup-node@v4"," with: {node-version: 22}"," - run: npm ci || npm install"," - run: npx --yes cladding check --tier=pre-push --strict --json",""].join(` `),"utf8"),"created")}function $Ue(t,e){return t==null?"host channels not wired yet \u2014 run `clad setup`, restart your AI tool, then ask it to apply Cladding to this project":e&&t!==e?`this project's host wiring was set up at v${t} (current binary v${e}) \u2014 run \`clad setup\` in this project to refresh its local runtime`:null}async function mj(t={}){let e=t.cwd??".",r=t.force??!1,n=[],i=[],o=dt(e).language,s=o==="unknown"?"typescript":o,a=t.scan===!1?null:vx({cwd:e,roots:t.roots}),l=a!==null&&(t.scan===!0||a.stats.filesScanned>=3),u=a&&a.stats.dominantLanguage!=="unknown"&&a.stats.dominantLanguage!=="other"?a.stats.dominantLanguage:s,d=t.projectName??Ex(Mee(e)),f=t.intent?.trim(),p=f;if(f&&f.length>0){let $=Nee(f,e);$.warning&&process.stderr.write(`[clad init] ${$.warning} `),$.loadedFrom&&process.stderr.write(`[clad init] loaded intent from ${$.loadedFrom} -`),p=$.intent}let m=null,h=t.hostDispatcher??Bm({noLlm:t.noLlm});if(p&&p.length>0){let $={cwdBasename:Ex(Mee(e)),language:u,sourceFileCount:a?.stats.filesScanned??0,readmePresent:!!a?.projectContext?.readmeFirstParagraph,readmeFirstParagraph:a?.projectContext?.readmeFirstParagraph??null,projectName:d};m=await wee(p,$,h,e);let ie={intent:p,language:u,projectName:d,mode:m.mode,startedAt:new Date().toISOString(),status:m.clarifyingQuestions.length===0?"done":"active",qa:m.clarifyingQuestions.map(K=>({question:K,answer:null}))};vc(e,ie),m.source!=="llm"&&(t.noLlm?process.stderr.write(`[clad init] \u2139 deterministic mode (--no-llm): spec/scenarios are stubs derived from the intent verbatim (scenarios empty). Re-run without --no-llm \u2014 or use 'clad clarify' \u2014 for domain-aware generation. +`),p=$.intent}let m=null,h=t.hostDispatcher??Bm({noLlm:t.noLlm});if(p&&p.length>0){let $={cwdBasename:Ex(Mee(e)),language:u,sourceFileCount:a?.stats.filesScanned??0,readmePresent:!!a?.projectContext?.readmeFirstParagraph,readmeFirstParagraph:a?.projectContext?.readmeFirstParagraph??null,projectName:d};m=await wee(p,$,h,e);let re={intent:p,language:u,projectName:d,mode:m.mode,startedAt:new Date().toISOString(),status:m.clarifyingQuestions.length===0?"done":"active",qa:m.clarifyingQuestions.map(K=>({question:K,answer:null}))};vc(e,re),m.source!=="llm"&&(t.noLlm?process.stderr.write(`[clad init] \u2139 deterministic mode (--no-llm): spec/scenarios are stubs derived from the intent verbatim (scenarios empty). Re-run without --no-llm \u2014 or use 'clad clarify' \u2014 for domain-aware generation. `):m.source==="deterministic"?process.stderr.write(`[clad init] \u26A0 LLM dispatcher did not fire \u2014 spec/scenarios are deterministic stubs (scenarios empty, intent quoted). Wire a host (run cladding as an MCP server in your AI tool) or set an API key, then re-run or use 'clad clarify'. See 'clad doctor' for details. `):process.stderr.write(`[clad init] \u26A0 LLM dispatcher fired only partially \u2014 some spec/doc sections fell back to deterministic stubs. Run 'clad clarify' to complete them; see 'clad doctor' for the missed sections. -`))}let g=Sc(e,"spec.yaml");if(Zm(g)&&!r)i.push("spec.yaml (exists)");else{let $=p?{description:Lee(p),intent_summary:Lee(p),ai_hints:m?.aiHints}:void 0;Vm(g,SUe(d,u,$)),n.push("spec.yaml")}let b=Sc(e,".cladding");Zm(b)?i.push(".cladding/ (exists)"):(kx(b,{recursive:!0}),n.push(".cladding/"));let _=Sc(e,".gitignore");wUe(_,".cladding/",".cladding/")?n.push(".gitignore (.cladding/ entry appended)"):i.push(".gitignore (.cladding/ entry already present)");let x=[];if(l&&a){let $=await P1(a,h,e);Ki(e,"docs/conventions.md",$.conventionsMd,n,x),Ki(e,"spec/architecture.yaml",$.architectureYaml,n,x),Ki(e,"spec/capabilities.yaml",$.capabilitiesYaml,n,x),Ki(e,"spec/scenarios/README.md",Fee,n,x)}else Ki(e,"docs/conventions.md",mee(u,d),n,x),Ki(e,"spec/architecture.yaml",m?.architectureYaml??Hm(u),n,x),Ki(e,"spec/capabilities.yaml",m?.capabilitiesYaml??Gm(d),n,x),Ki(e,"spec/scenarios/README.md",Fee,n,x);let w=a?.projectContext??null,O;if(m?O=m.projectContextMd:h?O=await D1(w,d,h,e):O=Xp(w,d),Ki(e,"docs/project-context.md",O,n,x),m&&m.scenarios.length>0)for(let $ of m.scenarios){let ie=$.id.replace(/^S-/,""),K=`spec/scenarios/${$.slug}-${ie}.yaml`,xe=kUe($);Ki(e,K,xe,n,x)}let T=tu(e);T==="created"?n.push("AGENTS.md"):T==="updated"?n.push("AGENTS.md (managed block refreshed from spec)"):T==="skipped-unmanaged"?i.push("AGENTS.md (hand-authored \u2014 no clad markers, left untouched)"):i.push("AGENTS.md (managed block already current)");let A=Xl(),D=$Ue(HY(e),A);if(D&&i.push(D),t.withHook)for(let $ of["pre-commit","pre-push"]){let ie=$==="pre-commit"?"clad check --tier=pre-commit":"clad check --tier=pre-push --strict",K=lX($,e,{version:A??void 0});switch(K.result){case"created":n.push(`.git/hooks/${$} (${ie})`);break;case"updated":n.push(`.git/hooks/${$} (refreshed to current version)`);break;case"unchanged":i.push(`.git/hooks/${$} (already installed)`);break;case"skipped-foreign":i.push(`.git/hooks/${$} exists and is not cladding-authored \u2014 pass --force to overwrite`);break;case"skipped-no-git":i.push("--with-hook: no .git directory \u2014 run `git init` first, then re-run with --with-hook");break}if(K.result==="skipped-no-git")break}if(t.withCi){let $=xUe(e);$==="created"?n.push(".github/workflows/cladding.yml (clad check --tier=pre-push --strict \u2014 the authoritative gate)"):$==="exists"&&i.push(".github/workflows/cladding.yml already exists \u2014 cladding never overwrites a CI workflow")}if(m){let $=bc(e);$&&vc(e,{...$,artifactDigests:Ou(e)})}return{created:n,skipped:i,language:u,proposals:x.length?x:void 0,clarifyingQuestions:m?.clarifyingQuestions.length?[...m.clarifyingQuestions]:void 0,onboardingMode:m?.mode,onboardingSource:m?.source}}function kUe(t){let e=t.title.replace(/"/g,'\\"'),r=t.flow.split(` +`))}let g=Sc(e,"spec.yaml");if(Zm(g)&&!r)i.push("spec.yaml (exists)");else{let $=p?{description:Lee(p),intent_summary:Lee(p),ai_hints:m?.aiHints}:void 0;Vm(g,SUe(d,u,$)),n.push("spec.yaml")}let b=Sc(e,".cladding");Zm(b)?i.push(".cladding/ (exists)"):(kx(b,{recursive:!0}),n.push(".cladding/"));let _=Sc(e,".gitignore");wUe(_,".cladding/",".cladding/")?n.push(".gitignore (.cladding/ entry appended)"):i.push(".gitignore (.cladding/ entry already present)");let x=[];if(l&&a){let $=await P1(a,h,e);Ki(e,"docs/conventions.md",$.conventionsMd,n,x),Ki(e,"spec/architecture.yaml",$.architectureYaml,n,x);let re=m?.source==="llm"?m.capabilitiesYaml:$.capabilitiesYaml;Ki(e,"spec/capabilities.yaml",re,n,x),Ki(e,"spec/scenarios/README.md",Fee,n,x)}else Ki(e,"docs/conventions.md",mee(u,d),n,x),Ki(e,"spec/architecture.yaml",m?.architectureYaml??Hm(u),n,x),Ki(e,"spec/capabilities.yaml",m?.capabilitiesYaml??Gm(d),n,x),Ki(e,"spec/scenarios/README.md",Fee,n,x);let w=a?.projectContext??null,O;if(m?O=m.projectContextMd:h?O=await D1(w,d,h,e):O=Xp(w,d),Ki(e,"docs/project-context.md",O,n,x),m&&m.scenarios.length>0)for(let $ of m.scenarios){let re=$.id.replace(/^S-/,""),K=`spec/scenarios/${$.slug}-${re}.yaml`,xe=kUe($);Ki(e,K,xe,n,x)}let T=tu(e);T==="created"?n.push("AGENTS.md"):T==="updated"?n.push("AGENTS.md (managed block refreshed from spec)"):T==="skipped-unmanaged"?i.push("AGENTS.md (hand-authored \u2014 no clad markers, left untouched)"):i.push("AGENTS.md (managed block already current)");let A=Xl(),D=$Ue(HY(e),A);if(D&&i.push(D),t.withHook)for(let $ of["pre-commit","pre-push"]){let re=$==="pre-commit"?"clad check --tier=pre-commit":"clad check --tier=pre-push --strict",K=lX($,e,{version:A??void 0});switch(K.result){case"created":n.push(`.git/hooks/${$} (${re})`);break;case"updated":n.push(`.git/hooks/${$} (refreshed to current version)`);break;case"unchanged":i.push(`.git/hooks/${$} (already installed)`);break;case"skipped-foreign":i.push(`.git/hooks/${$} exists and is not cladding-authored \u2014 pass --force to overwrite`);break;case"skipped-no-git":i.push("--with-hook: no .git directory \u2014 run `git init` first, then re-run with --with-hook");break}if(K.result==="skipped-no-git")break}if(t.withCi){let $=xUe(e);$==="created"?n.push(".github/workflows/cladding.yml (clad check --tier=pre-push --strict \u2014 the authoritative gate)"):$==="exists"&&i.push(".github/workflows/cladding.yml already exists \u2014 cladding never overwrites a CI workflow")}if(m){let $=bc(e);$&&vc(e,{...$,artifactDigests:Ou(e)})}return{created:n,skipped:i,language:u,proposals:x.length?x:void 0,clarifyingQuestions:m?.clarifyingQuestions.length?[...m.clarifyingQuestions]:void 0,onboardingMode:m?.mode,onboardingSource:m?.source}}function kUe(t){let e=t.title.replace(/"/g,'\\"'),r=t.flow.split(` `).map(n=>` ${n}`).join(` `);return["# Cladding \xB7 Tier A \xB7 SSoT \u2014 onboarding output, edit-friendly \xB7 Refreshed by: clad init / clad clarify",`id: ${t.id}`,`slug: ${t.slug}`,`title: "${e}"`,"flow: |",r||" (no flow described)","features: []",""].join(` `)}function Ki(t,e,r,n,i){let o=Sc(t,e);if(Zm(o)){let s=Sc(t,".cladding","scan",`${Ex(e)}.proposal`);kx(jee(s),{recursive:!0}),Vm(s,r),i.push(`${e} \u2192 ${e.startsWith("docs/")||e.startsWith("spec/")?".cladding/scan/":""}${Ex(e)}.proposal`);return}kx(jee(o),{recursive:!0}),Vm(o,r),n.push(e)}import{existsSync as Rx,mkdirSync as Tx,readFileSync as yj,rmSync as Uee,writeFileSync as Wm}from"node:fs";import{basename as Ru,dirname as Ox,join as Ji,resolve as zee}from"node:path";import No from"node:process";Ii();async function _j(t,e={}){let r=e.cwd??".",n;try{n=bc(r)}catch(w){return{ok:!1,code:1,error:w.message,created:[],proposals:[]}}if(n===null)return{ok:!1,code:2,error:"no onboarding session \u2014 initialize Cladding with a project intent first",created:[],proposals:[]};if(n.status==="done")return{ok:!0,code:0,message:"onboarding already complete (state.yaml status: done)",report:hj(r,null,[],null,n),created:[],proposals:[]};let i=$x(n);if(i===-1){let w=pj(n);return vc(r,w),{ok:!0,code:0,message:"onboarding complete \xB7 state.yaml marked done",report:hj(r,null,[],null,w),created:[],proposals:[]}}if(!t.trim())return{ok:!1,code:2,error:`provide an answer for: "${n.qa[i].question}"`,created:[],proposals:[]};let o=t.trim(),s=Ree(n,o),a=s.projectName||Ru(zee(r)),c={cwdBasename:Ru(zee(r)),language:s.language,sourceFileCount:0,readmePresent:!1,readmeFirstParagraph:null,projectName:a},l=AUe(r),u=s.qa.flatMap(w=>w.answer===null?[]:[{question:w.question,answer:w.answer}]),d=e.hostDispatcher??Bm({noLlm:e.noLlm}),f=await Aee(s.intent,c,u,l,d,r),p=[],m=[],h=Cee(r,n),g=f.scenarios.map(w=>`spec/scenarios/${w.slug}-${w.id.replace(/^S-/,"")}.yaml`),b=["docs/project-context.md","spec/architecture.yaml","spec/capabilities.yaml",...g,".cladding/onboarding/state.yaml",...h?[]:["project-context.md","architecture.yaml","capabilities.yaml",...g.map(w=>Ru(w))].map(w=>`.cladding/scan/${w}.proposal`)],_=Bee(r,b),S;try{Ax(r,"docs/project-context.md",f.projectContextMd,m,p,h),Ax(r,"spec/architecture.yaml",f.architectureYaml,m,p,h),Ax(r,"spec/capabilities.yaml",f.capabilitiesYaml,m,p,h),f.scenarios.forEach((w,O)=>{Ax(r,g[O],TUe(w),m,p,h)}),S=Iee(s,f.clarifyingQuestions),h?(S={...S,artifactDigests:Ou(r)},f.clarifyingQuestions.length===0&&Pee(S)&&(S=pj(S))):S={...S,status:"needs_review",pendingReview:["docs/project-context.md","spec/architecture.yaml","spec/capabilities.yaml",...g]},vc(r,S)}catch(w){return Hee(r,b,_),{ok:!1,code:1,error:`onboarding refinement failed; active design was restored: ${w.message}`,created:[],proposals:[]}}let x=s.qa[i];return{ok:!0,code:0,report:hj(r,{question:x.question,answer:o},f.clarifyingQuestions,f.mode,S),source:f.source,created:m,proposals:p}}function qee(t,e={}){let r=e.cwd??".",n=bc(r);if(!n||n.status!=="needs_review"||!n.pendingReview?.length)return{ok:!1,changed:!1,error:"no onboarding design review is pending"};let i=[...new Set(t)];if(i.length===0||i.some(u=>!n.pendingReview.includes(u)))return{ok:!1,changed:!1,error:"targets must be selected from the pending onboarding review"};if(i.some(u=>!EUe(u)))return{ok:!1,changed:!1,error:"review targets must be Cladding onboarding design artifacts"};let o=i.map(u=>({target:u,proposal:`.cladding/scan/${Ru(u)}.proposal`})),s=o.filter(({proposal:u})=>!Rx(Ji(r,u))).map(({target:u})=>u);if(s.length>0)return{ok:!1,changed:!1,error:`proposal missing for: ${s.join(", ")}`};let c=[".cladding/onboarding/state.yaml",...o.flatMap(({target:u,proposal:d})=>[u,d])],l=Bee(r,c);try{for(let{target:f,proposal:p}of o)Tx(Ox(Ji(r,f)),{recursive:!0}),Wm(Ji(r,f),yj(Ji(r,p))),Uee(Ji(r,p),{force:!0});let u=n.pendingReview.filter(f=>!i.includes(f)),d={...n,status:u.length>0?"needs_review":$x(n)>=0?"active":"done",pendingReview:u.length>0?u:void 0};return d={...d,artifactDigests:Ou(r)},vc(r,d),{ok:!0,changed:!0,status:d.status,remaining:u}}catch(u){return Hee(r,c,l),{ok:!1,changed:!1,error:`review apply failed; files were restored: ${u.message}`}}}function EUe(t){return t==="docs/project-context.md"||t==="spec/architecture.yaml"||t==="spec/capabilities.yaml"||/^spec\/scenarios\/[a-z0-9][a-z0-9-]*-[a-f0-9]{6}\.yaml$/.test(t)}function Bee(t,e){return new Map(e.map(r=>{let n=Ji(t,r);return[r,Rx(n)?yj(n):null]}))}function Hee(t,e,r){for(let n of e){let i=Ji(t,n),o=r.get(n);o==null?Uee(i,{force:!0}):(Tx(Ox(i),{recursive:!0}),Wm(i,o))}}async function Gee(t,e={}){let r=(t??[]).join(" ").trim(),n=await _j(r,{cwd:e.cwd,noLlm:e.noLlm});if(!n.ok){L("fail","clarify",n.error),No.exit(n.code);return}if(e.json){No.stdout.write(`${JSON.stringify(n.report,null,2)} diff --git a/spec.yaml b/spec.yaml index c7ee704..75a3ef9 100644 --- a/spec.yaml +++ b/spec.yaml @@ -54,7 +54,7 @@ project: # Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand. inventory: - features: 261 + features: 262 scenarios: 2 capabilities: 6 test_files: 243 diff --git a/spec/attestation.yaml b/spec/attestation.yaml index 6d68a09..260822c 100644 --- a/spec/attestation.yaml +++ b/spec/attestation.yaml @@ -38,7 +38,7 @@ attested_modules: docs/ab-evaluation/README.md: 2467808b9871dcf0 docs/ab-evaluation/case-doverunner-scale.md: 2a435b6855823d41 docs/ab-evaluation/case-efficiency-measurement.md: 348aca146a7b2faa - docs/ab-evaluation/case-existing-adoption.md: 65fabb08cec129e0 + docs/ab-evaluation/case-existing-adoption.md: 240a7c641da50a42 docs/ab-evaluation/case-graph-efficiency.md: 83d3956d14a1517d docs/ab-evaluation/case-iterative-vs-fixed-vapt.md: 1d242b8b6071f343 docs/ab-evaluation/case-payment-saas.md: a316271b319816f6 @@ -113,7 +113,7 @@ attested_modules: skills/serve/SKILL.md: f08bbdbbfeb05041 skills/status/SKILL.md: 09faadc50b3449da skills/sync/SKILL.md: 775c0f990a52a3d9 - spec.yaml: b5dd1d4db56a1938 + spec.yaml: 33dc47a833bc0bb7 spec/README.md: 7c257426396d435c spec/architecture.yaml: f0888480405a13a8 spec/features/: a4d0f0eb87fed960 @@ -156,7 +156,7 @@ attested_modules: src/cli/graph.ts: bab410061b8c746a src/cli/hook.ts: 59d5fddd52d330ac src/cli/host-onboarding.ts: b046571d4be7280c - src/cli/init.ts: fbd96fa32906313c + src/cli/init.ts: 91cf7be2b7427fbf src/cli/intent-from-path.ts: e69862821d979f22 src/cli/measure.ts: 3a562f16589e26c2 src/cli/report.ts: 911f859b2446834b From a9402e0184e277a092040a87a20499d1fb27f230 Mon Sep 17 00:00:00 2001 From: qwerfunch Date: Tue, 21 Jul 2026 12:32:27 +0900 Subject: [PATCH 6/6] =?UTF-8?q?chore(release):=20v0.9.1=20=E2=80=94=20bump?= =?UTF-8?q?=20version=20sites=20+=20changelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- .claude-plugin/marketplace.json | 2 +- CHANGELOG.md | 14 +++++++++++-- package-lock.json | 4 ++-- package.json | 2 +- .../claude-code/.claude-plugin/plugin.json | 2 +- plugins/claude-code/dist/clad.js | 4 ++-- plugins/codex/.codex-plugin/plugin.json | 2 +- plugins/gemini-cli/gemini-extension.json | 2 +- spec.yaml | 2 +- spec/attestation.yaml | 20 +++++++++---------- src/cli/clad.ts | 2 +- src/serve/server.ts | 2 +- tests/cli/clad.test.ts | 2 +- 13 files changed, 35 insertions(+), 25 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 6798628..425e76f 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -9,7 +9,7 @@ "name": "claude-code", "source": "./plugins/claude-code", "description": "Reference implementation of the Ironclad standard — multi-agent dev harness for Claude Code.", - "version": "0.9.0", + "version": "0.9.1", "author": { "name": "qwerfunch" }, diff --git a/CHANGELOG.md b/CHANGELOG.md index dc1d19f..fc4f7c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,13 @@ All notable changes to Cladding are documented here. Format: [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/). Versioning: [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). -## [Unreleased] — Polyglot gate fidelity + feature-cycle signals +## [0.9.1] — Adoption keeps approved capabilities + polyglot gate fidelity (2026-07-21) -**In one line:** the gate reads and reports non-JavaScript projects honestly, and it now nudges when the feature cycle isn't being driven. +**In one line:** adopting an existing project now keeps the capabilities you approved, and the gate reads and reports non-JavaScript projects more faithfully while nudging when the feature cycle isn't being driven. + +### Fixed + +- **Existing-project adoption keeps the capabilities you approved.** When you adopt a project that already has code, the capabilities produced and confirmed during onboarding are now written to `spec/capabilities.yaml`. Previously the observed-scan path re-derived them from README headings — or left `capabilities: []` when the repo had none — silently discarding the approved set. The greenfield path already honored them; the scan path now matches it. Conventions and architecture stay scanner-sourced. ### Gate and toolchain fidelity @@ -19,6 +23,12 @@ Versioning: [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). - **A non-blocking nudge when sustained source edits are bound to no feature.** When edits to files that no feature tracks accumulate past a small threshold, the post-edit card surfaces one advisory to start a feature — so the spec-first cycle gets triggered instead of silently skipped. Debounced and once-per-window; it never blocks. - **`clad check` flags unenforced projects.** When a project has features not yet done but neither a git hook nor CI wires the gate, `clad check` prints one advisory that the checks run only when asked — with how to wire enforcement. Informational only; it never changes the exit status. +- **A cold-start signal when a project has code but no feature specs.** `clad check` and session start now say the spec-first cycle hasn't begun, instead of the project looking clean. Advisory only. +- **Onboarding hands off to authoring the first feature spec, not straight to code**, and writing code ahead of its spec is caught both at that handoff and at the resting state. + +### Plain-language output + +- **Soft-shell jargon leaks closed and enforcement tightened.** More user-facing output stays in plain words rather than internal cladding terms; the plain-language guard now also checks the finding lead line and forbids raw internal identifiers. ## [0.9.0] — Project-scoped natural-language onboarding (2026-07-16) diff --git a/package-lock.json b/package-lock.json index 425017f..e102545 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cladding", - "version": "0.9.0", + "version": "0.9.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cladding", - "version": "0.9.0", + "version": "0.9.1", "license": "MIT", "dependencies": { "@anthropic-ai/sdk": "^0.96.0", diff --git a/package.json b/package.json index d63f320..bec402f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cladding", - "version": "0.9.0", + "version": "0.9.1", "description": "Spec-driven verification layer for AI coding agents — Claude Code · Codex · Gemini · Antigravity · Cursor. Intent in before it writes, result verified against your spec after. Reference implementation of the Ironclad standard.", "type": "module", "license": "MIT", diff --git a/plugins/claude-code/.claude-plugin/plugin.json b/plugins/claude-code/.claude-plugin/plugin.json index 9afa72c..9a3de43 100644 --- a/plugins/claude-code/.claude-plugin/plugin.json +++ b/plugins/claude-code/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "cladding", - "version": "0.9.0", + "version": "0.9.1", "description": "Reference implementation of the Ironclad standard — multi-agent dev harness for Claude Code.", "author": { "name": "qwerfunch" diff --git a/plugins/claude-code/dist/clad.js b/plugins/claude-code/dist/clad.js index 2ee95e5..f7c74bc 100755 --- a/plugins/claude-code/dist/clad.js +++ b/plugins/claude-code/dist/clad.js @@ -457,7 +457,7 @@ schema: "0.1" source: spec.yaml `});function Yc(t){let e=t.identity.timestamp??new Date().toISOString(),r=`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;return{...t,id:r,identity:{...t.identity,timestamp:e}}}var yA=y(()=>{"use strict"});import{existsSync as FJe,mkdirSync as LJe,readFileSync as Fue,readdirSync as zJe,writeFileSync as Lue}from"node:fs";import{dirname as UJe,join as Hq}from"node:path";function BJe(t,e){return`${qJe}/${t}.${e}.test.ts`}function HJe(t,e){let r=Hq(t,"spec/features");if(!FJe(r))return null;for(let n of zJe(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))){let i=Hq(r,n);try{if((0,co.parseDocument)(Fue(i,"utf8")).get("id")===e)return i}catch{}}return null}function GJe(t,e,r,n){let i=HJe(t,e);if(!i)return!1;let o=(0,co.parseDocument)(Fue(i,"utf8")),s=o.get("acceptance_criteria");if(!(0,co.isSeq)(s))return!1;let a=s.items.find(l=>(0,co.isMap)(l)&&l.get("id")===r);if(!a||!(0,co.isMap)(a))return!1;let c=a.get("oracle_refs",!0);if((0,co.isSeq)(c)){if(c.items.some(l=>((0,co.isMap)(l)?void 0:l.value)===n))return!0;c.add(n)}else a.set("oracle_refs",[n]);return Lue(i,String(o),"utf8"),!0}function zue(t){let e=t.cwd??".",r=BJe(t.featureId,t.acId),n=Hq(e,r);LJe(UJe(n),{recursive:!0}),Lue(n,t.body.endsWith(` `)?t.body:`${t.body} -`,"utf8");let i=Yc({featureId:t.featureId,acId:t.acId,stage:"stage_2.3",identity:{author:"llm",name:t.authorName??"oracle-author"},kind:"oracle",content:`impl-blind oracle authored for ${t.featureId}.${t.acId} (blind=${t.blind===!0})`,artifact:r,readManifest:t.readManifest,blind:t.blind===!0});return Za(e,i),GJe(e,t.featureId,t.acId,r)?{ok:!0,oraclePath:r,evidenceId:i.id}:{ok:!1,oraclePath:r,evidenceId:i.id,reason:`oracle + provenance written, but could not stamp oracle_refs (no shard for ${t.featureId}.${t.acId}) \u2014 add 'oracle_refs: [${r}]' to the AC manually`}}var co,qJe,Uue=y(()=>{"use strict";co=St(er(),1);ni();yA();qJe="tests/oracle"});var nde={};Pr(nde,{PERSONA_IDS:()=>Kue,PERSONA_PROMPT_ALIASES:()=>Jue,RESOURCE_URIS:()=>ca,TOOL_NAMES:()=>t8e,buildServer:()=>r8e});import{spawnSync as que}from"node:child_process";import{createHash as yy,randomUUID as ZJe}from"node:crypto";import{readFileSync as ua,existsSync as $n,mkdirSync as Zq,realpathSync as Bue,readdirSync as Jq,rmSync as Xc,statSync as SA,writeFileSync as Vue}from"node:fs";import{basename as VJe,dirname as gy,extname as WJe,isAbsolute as Hue,join as Ct,relative as Wue,resolve as Vq,sep as KJe}from"node:path";import{fileURLToPath as JJe}from"node:url";import{TextDecoder as YJe}from"node:util";import{deflateRawSync as XJe,inflateRawSync as QJe}from"node:zlib";import{tmpdir as e8e}from"node:os";function r8e(t={}){let e=t.cwd??".",r=new mA({name:t.name??"cladding",version:t.version??"0.9.0"},{instructions:"For explicit Cladding onboarding, always call clad_prepare_init first, draft the requested structured data with the current host model, then call clad_stage_init before showing the planned changes. Wait for a separate user confirmation before calling clad_init with the confirmation verbatim. For each real user answer, call clad_prepare_clarify and then clad_clarify only after a new user message supplies the answer. Never infer an answer or call clarify during the initialization approval turn. Never run onboarding shell commands or request MCP sampling. Prepare tools are read-only; apply tools validate and write.",capabilities:{resources:{subscribe:!0}}});return m8e(r,e,t.onboarding),y8e(r,e),_8e(r,e),n8e(r),i8e(r,e),r}function n8e(t){t.server.setRequestHandler(Jz,async()=>({})),t.server.setRequestHandler(Yz,async()=>({}))}function i8e(t,e){L8(r=>{r===e&&t.server.sendResourceUpdated({uri:ca.audit})})}function la(t){try{return{spec:q(t)}}catch(e){return{error:`cladding: spec not loaded \u2014 ${e.message}. Run \`clad init\` to scaffold spec.yaml first.`}}}function o8e(t){return"error"in la(t)?"cladding: not_initialized \u2014 this project has host wiring but no valid spec.yaml; ordinary work must remain ordinary until the user explicitly requests Cladding initialization.":null}function fy(t){let e=o8e(t);return e?{isError:!0,content:[{type:"text",text:e}]}:null}function py(t){try{let e=oi({cwd:t}),r=e.findings.filter(n=>n.severity!=="info").slice(0,3).map(n=>({detector:n.detector,severity:n.severity,message:n.message.slice(0,220)}));return e.pass?{pass:!0,findings:r}:{pass:!1,findings:r,next:"Resolve these findings, then verify with clad_run_gate (or `clad check --strict`) before `clad done`."}}catch{return{pass:!1,unavailable:!0,findings:[],next:"gate could not run \u2014 verify with `clad check --strict`."}}}function Gq(t,e,r,n,i){try{tr(t,"working_set_served",{tool:e,query:r,resolved:n,...i??{}})}catch{}}function Gue(){let t=gy(JJe(import.meta.url));for(let r=0;r<5;r++){let n=Ct(t,"bin","clad");if($n(n))return n;t=gy(t)}let e=process.argv[1];return e&&VJe(e)==="clad.js"&&$n(e)?e:null}function a8e(t,e){if(!e.trim())return{error:"document_path is required for document mode"};if(Hue(e))return{error:"document_path must be relative to the connected project"};let r=Bue(Vq(t)),n=Vq(r,e);if(!$n(n))return{error:`planning document not found: ${e}`};let i;try{i=Bue(n)}catch(s){return{error:`planning document could not be resolved: ${s.message}`}}let o=Wue(r,i);if(o===".."||o.startsWith(`..${KJe}`)||Hue(o))return{error:"planning document must stay inside the connected project"};if(!SA(i).isFile())return{error:"planning document must be a regular file"};if(!s8e.has(WJe(i).toLowerCase()))return{error:"planning document must be .md, .txt, .yaml, .yml, or .markdown"};try{let s=new YJe("utf-8",{fatal:!0}).decode(ua(i));return{path:o,text:s}}catch(s){return{error:`planning document is not readable UTF-8 text: ${s.message}`}}}function Yue(t){let e=XJe(Buffer.from(JSON.stringify(t))).toString("base64url");return`v1.${yy("sha256").update(e).digest("hex").slice(0,24)}.${e}`}function Wq(t){let e=/^v1\.([a-f0-9]{24})\.([A-Za-z0-9_-]+)$/.exec(t);if(!e||yy("sha256").update(e[2]).digest("hex").slice(0,24)!==e[1])return null;try{let r=JSON.parse(QJe(Buffer.from(e[2],"base64url"),{maxOutputLength:bA}).toString("utf8"));return r.kind!=="init"&&r.kind!=="clarify"||typeof r.snapshot!="string"||typeof r.intent!="string"?null:r}catch{return null}}function vA(t,e,r=!1){let n=yy("sha256").update(`${Vq(t)}\0${e}`).digest("hex");return r?Ct(t,".cladding","host","onboarding-pending",`${n}.json`):Ct(e8e(),"cladding-onboarding-pending",`${n}.json`)}function l8e(t){let e;try{e=Jq(t)}catch{return}for(let r of e){if(!r.endsWith(".json"))continue;let n=Ct(t,r);try{let i=JSON.parse(ua(n,"utf8"));(!i.expiresAt||i.expiresAt{if($n(n))for(let i of Jq(n,{withFileTypes:!0}).sort((o,s)=>o.name.localeCompare(s.name))){if(i.name===".git"||i.name===".cladding"||i.name==="node_modules")continue;let o=Ct(n,i.name),s=Wue(t,o);if(i.isDirectory())r(o);else if(i.isFile()){let a=SA(o);e.update(`${s}\0${a.size}\0${a.mtimeMs} +`,"utf8");let i=Yc({featureId:t.featureId,acId:t.acId,stage:"stage_2.3",identity:{author:"llm",name:t.authorName??"oracle-author"},kind:"oracle",content:`impl-blind oracle authored for ${t.featureId}.${t.acId} (blind=${t.blind===!0})`,artifact:r,readManifest:t.readManifest,blind:t.blind===!0});return Za(e,i),GJe(e,t.featureId,t.acId,r)?{ok:!0,oraclePath:r,evidenceId:i.id}:{ok:!1,oraclePath:r,evidenceId:i.id,reason:`oracle + provenance written, but could not stamp oracle_refs (no shard for ${t.featureId}.${t.acId}) \u2014 add 'oracle_refs: [${r}]' to the AC manually`}}var co,qJe,Uue=y(()=>{"use strict";co=St(er(),1);ni();yA();qJe="tests/oracle"});var nde={};Pr(nde,{PERSONA_IDS:()=>Kue,PERSONA_PROMPT_ALIASES:()=>Jue,RESOURCE_URIS:()=>ca,TOOL_NAMES:()=>t8e,buildServer:()=>r8e});import{spawnSync as que}from"node:child_process";import{createHash as yy,randomUUID as ZJe}from"node:crypto";import{readFileSync as ua,existsSync as $n,mkdirSync as Zq,realpathSync as Bue,readdirSync as Jq,rmSync as Xc,statSync as SA,writeFileSync as Vue}from"node:fs";import{basename as VJe,dirname as gy,extname as WJe,isAbsolute as Hue,join as Ct,relative as Wue,resolve as Vq,sep as KJe}from"node:path";import{fileURLToPath as JJe}from"node:url";import{TextDecoder as YJe}from"node:util";import{deflateRawSync as XJe,inflateRawSync as QJe}from"node:zlib";import{tmpdir as e8e}from"node:os";function r8e(t={}){let e=t.cwd??".",r=new mA({name:t.name??"cladding",version:t.version??"0.9.1"},{instructions:"For explicit Cladding onboarding, always call clad_prepare_init first, draft the requested structured data with the current host model, then call clad_stage_init before showing the planned changes. Wait for a separate user confirmation before calling clad_init with the confirmation verbatim. For each real user answer, call clad_prepare_clarify and then clad_clarify only after a new user message supplies the answer. Never infer an answer or call clarify during the initialization approval turn. Never run onboarding shell commands or request MCP sampling. Prepare tools are read-only; apply tools validate and write.",capabilities:{resources:{subscribe:!0}}});return m8e(r,e,t.onboarding),y8e(r,e),_8e(r,e),n8e(r),i8e(r,e),r}function n8e(t){t.server.setRequestHandler(Jz,async()=>({})),t.server.setRequestHandler(Yz,async()=>({}))}function i8e(t,e){L8(r=>{r===e&&t.server.sendResourceUpdated({uri:ca.audit})})}function la(t){try{return{spec:q(t)}}catch(e){return{error:`cladding: spec not loaded \u2014 ${e.message}. Run \`clad init\` to scaffold spec.yaml first.`}}}function o8e(t){return"error"in la(t)?"cladding: not_initialized \u2014 this project has host wiring but no valid spec.yaml; ordinary work must remain ordinary until the user explicitly requests Cladding initialization.":null}function fy(t){let e=o8e(t);return e?{isError:!0,content:[{type:"text",text:e}]}:null}function py(t){try{let e=oi({cwd:t}),r=e.findings.filter(n=>n.severity!=="info").slice(0,3).map(n=>({detector:n.detector,severity:n.severity,message:n.message.slice(0,220)}));return e.pass?{pass:!0,findings:r}:{pass:!1,findings:r,next:"Resolve these findings, then verify with clad_run_gate (or `clad check --strict`) before `clad done`."}}catch{return{pass:!1,unavailable:!0,findings:[],next:"gate could not run \u2014 verify with `clad check --strict`."}}}function Gq(t,e,r,n,i){try{tr(t,"working_set_served",{tool:e,query:r,resolved:n,...i??{}})}catch{}}function Gue(){let t=gy(JJe(import.meta.url));for(let r=0;r<5;r++){let n=Ct(t,"bin","clad");if($n(n))return n;t=gy(t)}let e=process.argv[1];return e&&VJe(e)==="clad.js"&&$n(e)?e:null}function a8e(t,e){if(!e.trim())return{error:"document_path is required for document mode"};if(Hue(e))return{error:"document_path must be relative to the connected project"};let r=Bue(Vq(t)),n=Vq(r,e);if(!$n(n))return{error:`planning document not found: ${e}`};let i;try{i=Bue(n)}catch(s){return{error:`planning document could not be resolved: ${s.message}`}}let o=Wue(r,i);if(o===".."||o.startsWith(`..${KJe}`)||Hue(o))return{error:"planning document must stay inside the connected project"};if(!SA(i).isFile())return{error:"planning document must be a regular file"};if(!s8e.has(WJe(i).toLowerCase()))return{error:"planning document must be .md, .txt, .yaml, .yml, or .markdown"};try{let s=new YJe("utf-8",{fatal:!0}).decode(ua(i));return{path:o,text:s}}catch(s){return{error:`planning document is not readable UTF-8 text: ${s.message}`}}}function Yue(t){let e=XJe(Buffer.from(JSON.stringify(t))).toString("base64url");return`v1.${yy("sha256").update(e).digest("hex").slice(0,24)}.${e}`}function Wq(t){let e=/^v1\.([a-f0-9]{24})\.([A-Za-z0-9_-]+)$/.exec(t);if(!e||yy("sha256").update(e[2]).digest("hex").slice(0,24)!==e[1])return null;try{let r=JSON.parse(QJe(Buffer.from(e[2],"base64url"),{maxOutputLength:bA}).toString("utf8"));return r.kind!=="init"&&r.kind!=="clarify"||typeof r.snapshot!="string"||typeof r.intent!="string"?null:r}catch{return null}}function vA(t,e,r=!1){let n=yy("sha256").update(`${Vq(t)}\0${e}`).digest("hex");return r?Ct(t,".cladding","host","onboarding-pending",`${n}.json`):Ct(e8e(),"cladding-onboarding-pending",`${n}.json`)}function l8e(t){let e;try{e=Jq(t)}catch{return}for(let r of e){if(!r.endsWith(".json"))continue;let n=Ct(t,r);try{let i=JSON.parse(ua(n,"utf8"));(!i.expiresAt||i.expiresAt{if($n(n))for(let i of Jq(n,{withFileTypes:!0}).sort((o,s)=>o.name.localeCompare(s.name))){if(i.name===".git"||i.name===".cladding"||i.name==="node_modules")continue;let o=Ct(n,i.name),s=Wue(t,o);if(i.isDirectory())r(o);else if(i.isFile()){let a=SA(o);e.update(`${s}\0${a.size}\0${a.mtimeMs} `)}}};return r(t),e.digest("hex")}function hy(t){let e=yy("sha256").update(d8e(t)),r=Ct(t,".cladding","onboarding","state.yaml");return e.update($n(r)?ua(r):Buffer.from("absent")),e.digest("hex")}function tde(t,e){let r=new Map,n=new Set,i=o=>{let s=Ct(t,o);if(!$n(s))return;let a=SA(s);if(a.isFile()){r.set(o,ua(s));return}if(a.isDirectory()){n.add(o);for(let c of Jq(s))i(Ct(o,c))}};for(let o of e)i(o);return{files:r,directories:n}}function rde(t,e,r){for(let n of e)Xc(Ct(t,n),{recursive:!0,force:!0});for(let n of[...r.directories].sort((i,o)=>i.length-o.length))Zq(Ct(t,n),{recursive:!0});for(let[n,i]of r.files)Zq(gy(Ct(t,n)),{recursive:!0}),Vue(Ct(t,n),i)}function f8e(t){return tde(t,ede)}function p8e(t,e){rde(t,ede,e)}function mt(t,e=!1){return{...e?{isError:!0}:{},structuredContent:t,content:[{type:"text",text:JSON.stringify(t,null,2)}]}}function m8e(t,e,r){let n=new Map,i=!1,o=()=>{i||(i=!0,h8e(t,e,n,r))};t.registerTool("clad_prepare_init",{title:"Prepare Cladding onboarding context",description:"Non-destructive first step for every explicit Cladding initialization request: writes no authored project files (only a TTL'd consent cache). Inspect the connected project, then use this tool result to draft the structured input for clad_init. Never run clad init in a shell.",inputSchema:{mode:E.enum(["idea","document","existing"]),intent:E.string().optional(),document_path:E.string().optional(),refresh:E.boolean().optional()},outputSchema:{status:E.string(),changed:E.boolean(),schemaVersion:E.number().optional(),token:E.string().optional(),prompt:E.string().optional(),request:E.object({mode:E.string(),intent:E.string()}).optional(),observation:E.record(E.string(),E.unknown()).optional(),question:E.string().optional(),error:E.string().optional(),plannedChanges:E.array(E.string()).optional(),confirmationQuestion:E.string().optional(),requiresSeparateUserConfirmation:E.boolean().optional(),approvalChallenge:E.string().optional()},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}},async s=>{if(!r)return mt({status:"unavailable",changed:!1},!0);if($n(Ct(e,"spec.yaml"))&&!s.refresh)return mt({status:"already_initialized",changed:!1});let a=s.intent?.trim()??"";if(s.mode==="idea"&&!a)return mt({status:"needs_input",changed:!1,question:"What kind of project are you building?"});if(s.mode==="document"){let p=a8e(e,s.document_path??"");if(p.error)return mt({status:"invalid_request",changed:!1,error:p.error},!0);a=p.text}s.mode==="existing"&&!a&&(a="Adopt Cladding into the observed existing project.");let c=r.prepareInit({cwd:e,mode:s.mode,intent:a}),l=u8e(),u=Number(c.observation.source_file_count??0),d={kind:"init",snapshot:hy(e),mode:s.mode,intent:a,refresh:s.refresh,approvalChallenge:l,scan:s.mode==="existing"||u>0},f=Yue(d);return n.set(f,d),Kq(e,l,f,d),mt({status:"needs_confirmation",changed:!1,schemaVersion:1,token:f,prompt:c.prompt,request:c.request,observation:c.observation,plannedChanges:s.refresh?["Preserve authored files and write review proposals under .cladding/scan/.","Propose refreshed docs/project-context.md, spec/architecture.yaml, and spec/capabilities.yaml."]:["Create spec.yaml, spec/architecture.yaml, and spec/capabilities.yaml.","Create 1-3 spec/scenarios/*.yaml journey files.","Create docs/project-context.md and docs/conventions.md.","Create .cladding/onboarding/state.yaml and append .cladding/ to .gitignore.","Create a managed AGENTS.md block; preserve an existing unmanaged AGENTS.md.","Preserve any existing CLAUDE.md unchanged; AGENTS.md is the shared host instruction surface."],confirmationQuestion:`To apply these changes, reply with the exact approval phrase: ${l}`,approvalChallenge:l,requiresSeparateUserConfirmation:!0})}),t.registerTool("clad_stage_init",{title:"Stage a Cladding onboarding draft for approval",description:"Validate and temporarily cache the host-model draft from clad_prepare_init before showing the approval phrase. This does not modify project files and lets a later host process apply the exact staged draft.",inputSchema:{token:E.string().min(1).max(bA),draft:_A},outputSchema:{status:E.string(),changed:E.boolean(),approvalChallenge:E.string().optional(),confirmationQuestion:E.string().optional(),error:E.string().optional()},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}},async s=>{let a=n.get(s.token)??Wq(s.token);return!a||a.kind!=="init"||!a.approvalChallenge?mt({status:"invalid_token",changed:!1},!0):a.snapshot!==hy(e)?mt({status:"stale_preparation",changed:!1},!0):(Kq(e,a.approvalChallenge,s.token,a,s.draft),mt({status:"staged",changed:!1,approvalChallenge:a.approvalChallenge,confirmationQuestion:`To apply these changes, reply with the exact approval phrase: ${a.approvalChallenge}`}))}),t.registerTool("clad_init",{title:"Apply a validated Cladding onboarding draft",description:"Write Cladding artifacts from the host model draft returned after clad_prepare_init. Use the one-time token when the host retained it; process-per-turn hosts may use the exact approval phrase through the short-lived project runtime cache. Copy the complete user message, including the APPLY CLADDING prefix, into confirmation. Malformed, stale, or replayed requests do not write files.",inputSchema:{token:E.string().min(1).max(bA).optional(),confirmation:E.string().regex(/^APPLY CLADDING [A-F0-9]{6}$/).describe("The complete separate user reply, verbatim, including the APPLY CLADDING prefix"),draft:_A.optional()},outputSchema:{status:E.string(),changed:E.boolean(),created:E.array(E.string()).optional(),skipped:E.array(E.string()).optional(),language:E.string().optional(),proposals:E.array(E.string()).optional(),clarifyingQuestions:E.array(E.string()).optional(),onboardingMode:E.enum(["greenfield","existing-adoption","mixed"]).optional(),onboardingSource:E.string().optional(),nextQuestion:E.string().nullable().optional(),remainingQuestions:E.number().optional(),error:E.string().optional(),confirmation:E.string().optional()},annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}},async s=>{let a=Xue(e,s.confirmation.trim()),c=(s.token?n.get(s.token)??Wq(s.token):null)??a?.request;if(!c||c.kind!=="init")return mt({status:"invalid_token",changed:!1},!0);if(!c.approvalChallenge||s.confirmation.trim()!==c.approvalChallenge)return mt({status:"confirmation_required",changed:!1,error:"The exact one-time approval phrase shown in the preview is required."},!0);if(c.snapshot!==hy(e))return mt({status:"stale_preparation",changed:!1},!0);if(!r)return mt({status:"unavailable",changed:!1},!0);let l=s.draft??a?.draft;if(!l)return mt({status:"draft_required",changed:!1,error:"No staged onboarding draft is available. Prepare and stage the draft again before approval."},!0);s.token&&n.delete(s.token),Que(e,s.confirmation.trim());let u=r.renderDraft(l),d=f8e(e),f;try{f=await r.initialize({cwd:e,intent:c.intent,scan:c.scan?!0:void 0,hostDispatcher:async()=>u})}catch(h){return p8e(e,d),mt({status:"failed",changed:!1,error:`Initialization failed; all onboarding files were restored: ${h.message}`},!0)}let p=f.clarifyingQuestions??[],m={status:p.length>0?"needs_answers":"initialized",changed:!0,...f,onboardingSource:"host",confirmation:s.confirmation,nextQuestion:p[0]??null,remainingQuestions:p.length};return o(),mt(m)}),$n(Ct(e,"spec.yaml"))&&o()}function h8e(t,e,r,n){t.registerTool("clad_prepare_clarify",{title:"Prepare the next Cladding onboarding answer",description:"Use only after a new user message answers the displayed pending question. Pass that answer verbatim. Never call during the initialization approval turn and never invent an answer.",inputSchema:{answer:E.string().min(1)},outputSchema:{status:E.string(),changed:E.boolean(),schemaVersion:E.number().optional(),token:E.string().optional(),prompt:E.string().optional(),request:E.object({mode:E.string(),intent:E.string()}).optional(),observation:E.record(E.string(),E.unknown()).optional(),error:E.string().optional()},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}},async i=>{if(!n)return mt({status:"unavailable",changed:!1},!0);let o=n.prepareClarify(i.answer,{cwd:e});if("error"in o)return mt({status:"invalid_state",changed:!1,error:o.error},!0);let s={kind:"clarify",snapshot:hy(e),mode:"idea",intent:o.request.intent,answer:i.answer},a=Yue(s);return r.set(a,s),Kq(e,`clarify:${i.answer}`,a,s),mt({status:"needs_host_draft",changed:!1,schemaVersion:1,token:a,prompt:o.prompt,request:o.request,observation:o.observation})}),t.registerTool("clad_clarify",{title:"Answer the next Cladding onboarding question",description:"Apply a host-model refinement only for an answer supplied in a new user message after the pending question. Never call during the initialization approval turn; do not invent or alter the user answer.",inputSchema:{answer:E.string().min(1).describe("The user's answer, verbatim"),token:E.string().min(1).max(bA).optional(),draft:_A},outputSchema:{status:E.string(),changed:E.boolean(),cwd:E.string().optional(),answered:E.unknown().optional(),newQuestions:E.array(E.string()).optional(),mode:E.enum(["greenfield","existing-adoption","mixed"]).nullable().optional(),nextQuestion:E.string().nullable().optional(),remainingQuestions:E.number().optional(),refinementSource:E.string().optional(),pendingReview:E.array(E.string()).optional(),error:E.string().optional()},annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}},async i=>{let o=Xue(e,`clarify:${i.answer}`),s=(i.token?r.get(i.token)??Wq(i.token):null)??o?.request;if(!s||s.kind!=="clarify"||s.answer!==i.answer)return mt({status:"invalid_token",changed:!1},!0);if(s.snapshot!==hy(e))return mt({status:"stale_preparation",changed:!1},!0);if(!n)return mt({status:"unavailable",changed:!1},!0);i.token&&r.delete(i.token),Que(e,`clarify:${i.answer}`);let a=n.renderDraft(i.draft),c=await n.clarify(i.answer,{cwd:e,hostDispatcher:async()=>a});return c.ok?mt({...c.report??{},changed:!0,refinementSource:"host"}):mt({status:"failed",changed:!1,error:c.error??"onboarding clarification failed"},!0)}),t.registerTool("clad_resolve_onboarding_review",{title:"Apply reviewed onboarding design proposals",description:"After showing proposal diffs and receiving explicit user approval, applies only the selected pending proposal targets. Never call this automatically; authored design is preserved until the user reviews it.",inputSchema:{targets:E.array(E.string()).min(1).describe("Exact active artifact paths returned in pendingReview.")},annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}},async i=>{if(!n)return mt({status:"unavailable",changed:!1},!0);let o=n.resolveReview(i.targets,{cwd:e});return mt({status:o.status??(o.ok?"resolved":"failed"),changed:o.changed,remaining:o.remaining,error:o.error},!o.ok)}),t.registerTool("clad_list_features",{title:"List cladding features",description:"List features from spec.yaml. Optionally filter by status or slug substring, and sort alphabetically (default) or by recent file mtime.",inputSchema:{statusFilter:E.enum(["planned","in_progress","done","archived"]).optional().describe("Limit to features with this status"),slugSubstring:E.string().optional().describe("Case-insensitive substring match on slug (e.g. 'auth')"),sort:E.enum(["alphabetical","recent"]).optional().describe("'alphabetical' (default \u2014 by id) or 'recent' (by file mtime, newest first)")},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}},async i=>{let o=la(e);if("error"in o)return{isError:!0,content:[{type:"text",text:o.error}]};let a=o.spec.features;if(i.statusFilter&&(a=a.filter(u=>u.status===i.statusFilter)),i.slugSubstring){let u=i.slugSubstring.toLowerCase();a=a.filter(d=>{let f=d.slug;return f?f.toLowerCase().includes(u):!1})}let l=(i.sort==="recent"?g8e(a,e):a).map(u=>({id:u.id,slug:u.slug,title:u.title,status:u.status}));return{content:[{type:"text",text:JSON.stringify({total:l.length,features:l},null,2)}]}}),t.registerTool("clad_get_feature",{title:"Get a cladding feature",description:'Returns one feature record by id (e.g. "F-049" or "F-a3f9c2") or by slug (e.g. "login-flow"). When a slug matches multiple features, all matches are returned.',inputSchema:{id:E.string().optional().describe('Feature id such as "F-049" or "F-a3f9c2"'),slug:E.string().optional().describe("Feature slug such as 'login-flow'")},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}},async i=>{if(!i.id&&!i.slug)return{isError:!0,content:[{type:"text",text:"provide either id or slug"}]};let o=la(e);if("error"in o)return{isError:!0,content:[{type:"text",text:o.error}]};let s=o.spec.features.filter(c=>!!(i.id&&c.id===i.id||i.slug&&c.slug===i.slug));if(s.length===0)return{isError:!0,content:[{type:"text",text:`no feature with ${i.id?`id "${i.id}"`:`slug "${i.slug}"`} found`}]};let a=s.length===1?s[0]:{matches:s};return{content:[{type:"text",text:JSON.stringify(a,null,2)}]}}),t.registerTool("clad_run_check",{title:"Run cladding drift check",description:"Runs `clad check` drift detection. Returns a TERSE report by default (pass, error/warn counts, top 3 blocking findings) to keep the agent loop cheap; pass verbose:true for every finding incl. info-severity + suggestions.",inputSchema:{strict:E.boolean().optional().describe("Treat warnings as errors when true"),verbose:E.boolean().optional().describe("Return the full report (all findings incl. info + suggestions) instead of the terse top-3 summary")},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}},async i=>{let o=oi({strict:i.strict,cwd:e});if(i.verbose)return{content:[{type:"text",text:JSON.stringify(o,null,2)}],isError:!o.pass};let s=o.findings??[],a=s.filter(d=>d.severity==="error"),c=s.filter(d=>d.severity==="warn"),l=(a.length>0?a:c).slice(0,3).map(d=>({detector:d.detector,severity:d.severity,message:d.message,...d.path?{path:d.path}:{},...d.line?{line:d.line}:{}})),u={stage:o.stage,pass:o.pass,errorCount:a.length,warnCount:c.length,findings:l,...a.length+c.length>l.length?{truncated:!0,hint:"call clad_run_check with verbose:true for all findings"}:{}};return{content:[{type:"text",text:JSON.stringify(u,null,2)}],isError:!o.pass}}),t.registerTool("clad_run_gate",{title:"Run the full Iron Law gate",description:"Runs the real `clad check` pipeline for a tier (default pre-commit for latency; pre-push runs type/lint/tests/coverage/conformance/smoke) and returns the untruncated JSON outcome. Strict by default \u2014 this is the verification surface; use clad_run_check for the cheap drift-only view.",inputSchema:{tier:E.enum(["pre-commit","pre-push","all"]).optional().describe("Stage tier (default pre-commit)"),strict:E.boolean().optional().describe("Promote warn findings to blocking (default true)")}},async i=>{let o=Gue();if(!o)return{isError:!0,content:[{type:"text",text:JSON.stringify({schema_version:Lt,error:"cladding engine shim (bin/clad) not found relative to the running server"})}]};let s=i.tier??"pre-commit",a=i.strict!==!1,c=que(o,["check",`--tier=${s}`,...a?["--strict"]:[],"--json"],{cwd:e,encoding:"utf8",timeout:3e5});try{let l=JSON.parse(c.stdout||"");return{isError:(l.worst??1)!==0,content:[{type:"text",text:JSON.stringify({schema_version:Lt,...l},null,2)}]}}catch{return{isError:!0,content:[{type:"text",text:JSON.stringify({schema_version:Lt,error:"gate produced no parseable JSON",stderr:(c.stderr??"").slice(0,400)})}]}}}),t.registerTool("clad_verdict",{title:"Poll the loop verdict",description:"One-poll loop decision over the real pre-push strict gate + feature statuses. Runs the gate ONCE and reduces it to {verdict, next_action, remaining} \u2014 call this INSTEAD OF clad_run_gate per loop turn, not in addition. verdict is one of DONE|ITERATE|ESCALATE|BLOCKED|BOOTSTRAP; DONE requires a green gate AND every feature done AND at least one non-liveness behavioral proof.",inputSchema:{tier:E.enum(["pre-commit","pre-push","all"]).optional().describe("Gate tier (default pre-push)")}},async i=>{let o=Gue();if(!o)return{isError:!0,content:[{type:"text",text:JSON.stringify({schema_version:Lt,error:"cladding engine shim (bin/clad) not found relative to the running server"})}]};let s=que(o,["verdict","--json",...i.tier?[`--tier=${i.tier}`]:[]],{cwd:e,encoding:"utf8",timeout:3e5});try{let a=JSON.parse(s.stdout||"");return{isError:!1,content:[{type:"text",text:JSON.stringify({schema_version:Lt,...a},null,2)}]}}catch{return{isError:!0,content:[{type:"text",text:JSON.stringify({schema_version:Lt,error:"verdict produced no parseable JSON",stderr:(s.stderr??"").slice(0,400)})}]}}}),t.registerTool("clad_get_context",{title:"Get the context slice for one feature",description:"Returns the working set for ONE feature in one call: the focus feature (full), its transitive depends_on ancestors (title+status), bound scenarios, the matching ai_hints patterns, and the union of the feature's test_refs. Look up by feature id (F-\u2026), slug, or a module path. Prefer this over reading shards by hand \u2014 dispatch the slice, never the whole spec.",inputSchema:{query:E.string().describe("Feature id (F-\u2026), slug, or module path (e.g. src/auth/login.ts)")}},async i=>{try{let o=la(e);if("error"in o)return{isError:!0,content:[{type:"text",text:o.error}]};let s=fl(o.spec,i.query),a="not_found"in s;return Gq(e,"clad_get_context",i.query,!a),{isError:a,content:[{type:"text",text:JSON.stringify({schema_version:Lt,...s},null,2)}]}}catch(o){return{isError:!0,content:[{type:"text",text:o.message}]}}}),t.registerTool("clad_get_working_set",{title:"Get the token-budgeted working set for one feature (code + needs + breaks)",description:"Returns ONE token-budgeted working set for a feature/module: must_edit (focus + full ACs + the ACTUAL source code of its modules), needs (forward depends_on), breaks_if_changed (direct dependents + the regression test set), verify (scenarios + tests + oracle_refs + EARS unwanted/state high-risk ACs), guidance (ai_hints), and budget (what was clipped to fit). One call replaces reading the shard + opening each module file + grepping deps/tests. Look up by feature id (F-\u2026), slug, or module path.",inputSchema:{query:E.string().describe("Feature id (F-\u2026), slug, or module path (e.g. src/auth/login.ts)"),max_tokens:E.number().int().positive().max(2e4).optional().describe("Token budget for the payload (default 3000); distant deps then code then tests are clipped to fit")}},async i=>{try{let o=la(e);if("error"in o)return{isError:!0,content:[{type:"text",text:o.error}]};let s=xa(o.spec,i.query,{cwd:e,maxTokens:i.max_tokens}),a="not_found"in s?null:{truncated:s.budget.truncated.length>0,sliceTokens:s.budget.used_tokens};return Gq(e,"clad_get_working_set",i.query,a!==null,a??void 0),{isError:"not_found"in s,content:[{type:"text",text:JSON.stringify({schema_version:Lt,...s},null,2)}]}}catch(o){return{isError:!0,content:[{type:"text",text:o.message}]}}}),t.registerTool("clad_get_impact",{title:"Get the blast radius for a change (reverse / impact slice)",description:"Returns what a change to ONE feature or file could break: the transitive dependents (id+title+status), the scenarios bound to any of them, the deduped union of their test_refs (the regression set to re-run), and the modules in the radius. Look up by feature id (F-\u2026), slug, or a module path \u2014 a module fans out to ALL features that touch it. The backward complement of clad_get_context: forward = what this needs, impact = what depends on this. Prefer this over grepping to scope a safe refactor.",inputSchema:{query:E.string().describe("Feature id (F-\u2026), slug, or module path (e.g. src/spec/load.ts)"),max_depth:E.number().int().positive().max(6).optional().describe("Bound the dependent walk to N hops (default: unbounded \u2014 the full transitive radius)")}},async i=>{try{let o=la(e);if("error"in o)return{isError:!0,content:[{type:"text",text:o.error}]};let s=vr(o.spec,i.query,{depth:i.max_depth}),a="not_found"in s;return Gq(e,"clad_get_impact",i.query,!a),{isError:a,content:[{type:"text",text:JSON.stringify({schema_version:Lt,...s},null,2)}]}}catch(o){return{isError:!0,content:[{type:"text",text:o.message}]}}}),t.registerTool("clad_get_graph",{title:"Get the live knowledge graph (focused neighborhood, or a stats summary)",description:"With query: the focus node\u2019s N-hop neighborhood (typed nodes + edges; a path query unions its kind-twins). WITHOUT query: a compact stats summary (counts by kind + top hubs) \u2014 the full graph is tens of thousands of tokens, so use `clad graph export --format json` for a complete dump. Recomputed live, never stale. Node kinds + edge types: docs/knowledge-graph/design.md.",inputSchema:{query:E.string().optional().describe("Focus node: feature id (F-\u2026), slug, or module path. Omit for the stats summary."),max_depth:E.number().int().positive().max(6).optional().describe("Neighborhood radius around the focus node (default: full reachable subgraph from the focus)")}},async i=>{try{let o=la(e);if("error"in o)return{isError:!0,content:[{type:"text",text:o.error}]};let s=o.spec,a=wc(s,e);if(!i.query)return{content:[{type:"text",text:JSON.stringify({schema_version:Lt,summary:!0,stats:Lx(a),hint:"pass query (feature id, slug, or module path) for a neighborhood subgraph; `clad graph export --format json` dumps the full graph"},null,2)}]};let c=Px(s,a,i.query);if(c.length===0)return{isError:!0,content:[{type:"text",text:JSON.stringify({schema_version:Lt,not_found:i.query,accepted_forms:["feature id (F-\u2026)","slug","module path"],discovery:"grep spec/index.yaml \u2014 one line per feature (run clad sync if missing); if the query is a file, fall back to normal code search"},null,2)}]};let l=Ix(a,c,i.max_depth??1/0);return{content:[{type:"text",text:JSON.stringify({schema_version:Lt,...l},null,2)}]}}catch(o){return{isError:!0,content:[{type:"text",text:o.message}]}}}),t.registerTool("clad_changelog",{title:"Collect shipped changes since a git ref (changelog manifest)",description:"The deterministic shipped-changes manifest for ..HEAD (default since: latest tag): done-feature shards grouped by capability, the inventory count diff, and feat:/fix: commits naming no feature id. For human release notes, render FROM the manifest \u2014 never invent a change it does not carry. Formats (manifest/markdown/audit/catalog): skills/changelog/SKILL.md.",inputSchema:{since:E.string().optional().describe("Git ref to diff from (default: latest tag via `git describe --tags --abbrev=0`)"),format:E.enum(["manifest","markdown","catalog","audit"]).optional().describe("Payload format (default 'manifest')")}},async i=>{try{let o=i.format??"manifest";if(o==="catalog"){let l=gl(q(e));return{content:[{type:"text",text:JSON.stringify({schema_version:Lt,format:o,content:l},null,2)}]}}let s=i.since??rs(e),a=ns(e,s);if(o==="manifest")return{content:[{type:"text",text:JSON.stringify({schema_version:Lt,...a},null,2)}]};let c=o==="audit"?hl(a,q(e),e):ml(a);return{content:[{type:"text",text:JSON.stringify({schema_version:Lt,format:o,content:c},null,2)}]}}catch(o){return{isError:!0,content:[{type:"text",text:o.message}]}}}),t.registerTool("clad_get_events",{title:"Get recent cladding events",description:"Reads .cladding/events.log and returns the most recent entries.",inputSchema:{limit:E.number().int().positive().max(500).optional().describe("Maximum entries to return (default 50)")}},async i=>{let o=i.limit??50,s=Ct(e,".cladding","events.log.jsonl");if(!$n(s))return{content:[{type:"text",text:JSON.stringify({events:[],note:"no events log yet"})}]};let l=ua(s,"utf8").split(` `).filter(u=>u.trim().length>0).slice(-o).map(u=>{try{return JSON.parse(u)}catch{return{unparseable:u.slice(0,200)}}});return{content:[{type:"text",text:JSON.stringify({events:l},null,2)}]}}),t.registerTool("clad_create_feature",{title:"Create a new cladding feature",description:"Creates spec/features/.yaml with an auto-generated F- id. Author the feature WITH its acceptance_criteria (and modules) in this one call \u2014 an AC-less feature is a hollow stub that governs nothing. Hash ids are collision-safe across concurrent branches; see docs/spec-ids-multi-dev.md.",inputSchema:{slug:E.string().regex(/^[a-z0-9]([a-z0-9-]{0,62}[a-z0-9])?$/).describe("Kebab-case slug \u2014 filename + spec.slug field (e.g. 'login-flow')"),title:E.string().optional().describe("Optional human-readable title; defaults to slug"),status:E.enum(["planned","in_progress","done","blocked","archived"]).optional().describe("Optional status; defaults to 'planned'"),modules:E.array(E.string()).optional().describe('Module paths the feature binds to (e.g. ["src/auth/login.ts"]).'),acceptance_criteria:E.array(E.object({ears:E.enum(["ubiquitous","event","state","optional","unwanted","complex"]).optional(),text:E.string().optional().describe('The "The system shall \u2026" statement.'),action:E.string().optional(),response:E.string().optional(),condition:E.string().optional().describe("Trigger/precondition for event/state EARS."),test_refs:E.array(E.string()).optional().describe("Paths to verifying tests."),evidence_refs:E.array(E.string()).optional(),notes:E.string().optional()})).optional().describe("Acceptance criteria authored now (ids auto-assigned AC-001\u2026). Strongly preferred over an empty feature \u2014 this is what makes the feature governable."),design_impact:E.discriminatedUnion("classification",[E.object({classification:E.literal("none"),rationale:E.string().min(1)}),E.object({classification:E.literal("additive"),rationale:E.string().min(1),capability:E.string().regex(/^[a-z0-9]([a-z0-9-]{0,62}[a-z0-9])?$/),capability_title:E.string().min(1).optional(),scenario:E.string().min(1).optional()}),E.object({classification:E.literal("structural"),rationale:E.string().min(1),artifacts:E.array(E.enum(["spec/architecture.yaml","spec/capabilities.yaml","docs/project-context.md"])).min(1)})]).optional().describe("Optional design-impact decision. Omit for the legacy-compatible create-only path; structural changes remain review_required until resolved.")}},async i=>{let o=fy(e);if(o)return o;let s=tde(e,Zue);try{let a=Nue({slug:i.slug,title:i.title,status:i.status,modules:i.modules,acceptance_criteria:i.acceptance_criteria,design_impact:i.design_impact?{classification:i.design_impact.classification,rationale:i.design_impact.rationale,artifacts:i.design_impact.classification==="structural"?i.design_impact.artifacts:void 0}:void 0,cwd:e});i.design_impact?.classification==="additive"&&(Bq({capability:i.design_impact.capability,feature:a.id,title:i.design_impact.capability_title,cwd:e}),i.design_impact.scenario&&Cue({scenario:i.design_impact.scenario,feature:a.id,cwd:e})),my(e);let c=i.design_impact,l={schema_version:Lt,...a,gate:py(e),...c?{designImpact:c.classification==="structural"?{status:"review_required",artifacts:c.artifacts,next:"Preview and apply the listed Tier-B design changes, then call clad_resolve_design_impact."}:{status:"resolved",classification:c.classification}}:{hint:`If this feature is user-facing, link it to a capability with clad_link_capability (capability: , feature: ${a.id}) so the Tier-B design SSoT grows with development instead of being left an empty seed.`}};return{content:[{type:"text",text:JSON.stringify(l,null,2)}]}}catch(a){return rde(e,Zue,s),{isError:!0,content:[{type:"text",text:a.message}]}}}),t.registerTool("clad_resolve_design_impact",{title:"Resolve a reviewed structural design impact",description:"Marks a feature structural design impact resolved only after the user-approved Tier-B changes have been applied. Do not call this merely to clear the gate; verify every artifact listed in the feature first.",inputSchema:{feature:E.string().describe("Feature id whose listed Tier-B design changes are now applied.")}},async i=>{let o=fy(e);if(o)return o;try{let s=Due({feature:i.feature,cwd:e});return my(e),{content:[{type:"text",text:JSON.stringify({schema_version:Lt,...s,gate:py(e)},null,2)}]}}catch(s){return{isError:!0,content:[{type:"text",text:s.message}]}}}),t.registerTool("clad_author_oracle",{title:"Record an impl-blind spec-conformance oracle",description:"Records a host-authored conformance oracle for a feature AC + its impl-blind PROVENANCE, writes the test under tests/oracle/, and stamps oracle_refs so the SPEC_CONFORMANCE gate verifies it. cladding does NOT author the oracle. AUTHOR ONLY ACs on the policy worklist (`clad oracle --required`) \u2014 an empty worklist means do not author unless the user explicitly asks (out-of-policy recordings are labeled voluntary). FIRST run `clad oracle --ac ` for the spec-only brief; spawn a FRESH sub-agent given ONLY that brief (never the implementation); have it write the test; then call this with the body + the manifest of exactly what the sub-agent saw. Blindness is your discipline \u2014 the gate audits the manifest (manifest\u2229modules must be empty) and the author\u2260implementer identity, and records whether you attested a clean (blind) context.",inputSchema:{featureId:E.string().describe("The F- feature id."),acId:E.string().describe("The AC- the oracle verifies."),body:E.string().describe("The authored vitest oracle source (imports the module under test)."),readManifest:E.array(E.string()).describe("EXACTLY what the blind sub-agent was shown (the clad oracle brief: spec/AC + signatures). MUST NOT include an implementation file the feature owns."),blind:E.boolean().optional().describe("True only if the sub-agent saw the spec-only brief and nothing else."),authorName:E.string().optional().describe("Oracle author identity (sub-agent / model id) \u2014 must differ from the implementer for the gate to pass.")}},async i=>{let o=fy(e);if(o)return o;try{let s=zue({featureId:i.featureId,acId:i.acId,body:i.body,readManifest:i.readManifest,blind:i.blind,authorName:i.authorName,cwd:e});my(e);let a={};try{let c=q(e),l=Pp(c.project,Cp(c)),d=c.features.find(f=>f.id===i.featureId)?.acceptance_criteria?.find(f=>f.id===i.acId);(!d||!Dp(l,i.featureId,d))&&(a={voluntary:!0,cost_note:"this AC is not on the project's oracle worklist (`clad oracle --required`) \u2014 recording anyway as voluntary; prefer policy-listed ACs to keep token spend inside the declared verification budget."})}catch{}return{content:[{type:"text",text:JSON.stringify({schema_version:Lt,...s,...a,gate:py(e)},null,2)}],isError:!s.ok}}catch(s){return{isError:!0,content:[{type:"text",text:s.message}]}}}),t.registerTool("clad_create_scenario",{title:"Create a new cladding scenario",description:"Creates spec/scenarios/-.yaml with an auto-generated S- id. Same multi-dev safety property as clad_create_feature: two concurrent invocations on separate branches produce distinct hash ids by construction.",inputSchema:{slug:E.string().regex(/^[a-z0-9]([a-z0-9-]{0,62}[a-z0-9])?$/).describe("Kebab-case slug (e.g. 'checkout-happy-path')"),title:E.string().optional().describe("Optional human-readable title; defaults to slug"),flow:E.string().optional().describe("Prose user-journey flow (what the user does, step by step)."),features:E.array(E.string().regex(/^F-(\d{3,}|[a-f0-9]{6,})$/)).optional().describe("Optional list of feature ids the scenario touches")}},async i=>{let o=fy(e);if(o)return o;try{let s=jue({slug:i.slug,title:i.title,flow:i.flow,features:i.features,cwd:e});return my(e),{content:[{type:"text",text:JSON.stringify({schema_version:Lt,...s,gate:py(e)},null,2)}]}}catch(s){return{isError:!0,content:[{type:"text",text:s.message}]}}}),t.registerTool("clad_link_capability",{title:"Link a feature to a capability",description:"Upserts a feature into spec/capabilities.yaml: creates the capability if absent, else appends the feature to its features[] (deduped). A capability is ACCUMULATIVE, so the verb is link, not create. Use this when a user-facing feature lands so the design tier grows with development instead of being left an empty seed.",inputSchema:{capability:E.string().regex(/^[a-z0-9]([a-z0-9-]{0,62}[a-z0-9])?$/).describe("Capability id (kebab-slug, e.g. 'auth'). Created if it does not exist yet."),feature:E.string().regex(/^F-(\d{3,}|[a-f0-9]{6,})$/).describe("Feature id to add to the capability"),title:E.string().optional().describe("Title, used only when the capability is newly created"),summary:E.string().optional().describe("Summary, used only when newly created"),surface:E.enum(["feature","platform","tool","infrastructure"]).optional().describe("Surface, used only when newly created")}},async i=>{let o=fy(e);if(o)return o;try{let s=Bq({capability:i.capability,feature:i.feature,title:i.title,summary:i.summary,surface:i.surface,cwd:e});return my(e),{content:[{type:"text",text:JSON.stringify({schema_version:Lt,...s,gate:py(e)},null,2)}]}}catch(s){return{isError:!0,content:[{type:"text",text:s.message}]}}})}function my(t){try{if($n(Ct(t,"spec.yaml"))){if(ya(t))return;Vl(t,_s(t)),Wa(t),Xx(t)}}catch{}}function g8e(t,e){let r=Ct(e,"spec","features"),n=t.map(i=>{let o=i.slug,s=[o?Ct(r,`${o}-${i.id.slice(2)}.yaml`):null,Ct(r,`${i.id}.yaml`)].filter(c=>c!==null),a=0;for(let c of s)try{if($n(c)){a=SA(c).mtimeMs;break}}catch{}return{feature:i,mtime:a}});return n.sort((i,o)=>o.mtime-i.mtime),n.map(i=>i.feature)}function y8e(t,e){t.registerResource("spec",ca.spec,{title:"Cladding spec",description:"The active spec.yaml \u2014 aggregated when sharded.",mimeType:"application/json"},async()=>{let r=la(e),n="error"in r?JSON.stringify({error:r.error},null,2):JSON.stringify(r.spec,null,2);return{contents:[{uri:ca.spec,mimeType:"application/json",text:n}]}}),t.registerResource("events",ca.events,{title:"Cladding events log",description:"Raw JSONL stream of feature_activated, evidence_appended, gate_run, \u2026",mimeType:"application/x-ndjson"},async()=>{let r=Ct(e,".cladding","events.log.jsonl"),n=$n(r)?ua(r,"utf8"):"";return{contents:[{uri:ca.events,mimeType:"application/x-ndjson",text:n}]}}),t.registerResource("audit",ca.audit,{title:"Cladding audit log",description:"HITL audit log \u2014 every persona dispatch and human signoff.",mimeType:"application/x-ndjson"},async()=>{let r=Ct(e,".cladding","audit.log.jsonl"),n=$n(r)?ua(r,"utf8"):"";return{contents:[{uri:ca.audit,mimeType:"application/x-ndjson",text:n}]}})}function _8e(t,e){let r=(n,i,o)=>{t.registerPrompt(n,{title:`Cladding persona \u2014 ${i}`,description:o,argsSchema:{featureId:E.string().optional().describe("Optional feature id to interpolate into the persona context")}},s=>{let a=cy(i),c=s.featureId?` Active feature: ${s.featureId} @@ -949,4 +949,4 @@ ${o.length} AC(s) required, ${s.length} missing an oracle. `).find(r=>r.trim().length>0);e&&G.stdout.write(` ${Nde(e.trim(),160)} `)}}function Nde(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function g5e(t){let e=q();if(t.json){G.stdout.write(`${JSON.stringify(Qx(e,"."),null,2)} `),G.exitCode=0;return}G.stdout.write(`${Bte(e,".",{internal:t.internal})} -`),G.exit(0)}function y5e(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function _5e(t){let e=t.cwd??".",r=(t.out??"").trim();if(r.length===0){L("fail","bundle","missing --out \u2014 the bundle needs a destination path"),G.exit(1);return}let n;try{let i=q(e),o=Qx(i,e),s={gitHead:va(e),version:Xl(),generatedAt:t.now??new Date().toISOString()},a=gl(i),c;try{let l=t.since??rs(e),u=ns(e,l);c={kind:"present",sinceRef:l,changelogMarkdown:ml(u),auditMarkdown:hl(u,i,e)}}catch(l){c={kind:"omitted",reason:l.message}}n=kG({spec:i,panel:o,provenance:s,catalogMarkdown:a,changes:c})}catch(i){L("fail","bundle",i.message),G.exit(1);return}try{X8e(r,n,"utf8")}catch(i){L("fail","bundle",`could not write ${r}: ${i.message}`),G.exit(1);return}L("pass","bundle",`${r} \xB7 ${y5e(Buffer.byteLength(n,"utf8"))}`),G.exit(0)}function b5e(t){let e=HA(t);L("note",`route \u2192 ${e}`,t),G.exit(e==="unknown"?1:0)}function v5e(){let t=new x4;t.name("clad").description("Reference Ironclad CLI").version("0.9.0"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init payment SaaS for B2B` \u2014 free text in any language) to drive intent-aware onboarding \u2014 the LLM dispatcher then produces domain-aware capabilities/architecture/project-context plus product-level follow-up questions. Bare `clad init` keeps the v0.3.42 behaviour (greenfield seeds, or observed scan when \u22653 source files exist).").option("-n, --name ","Project name (default: cwd basename)").option("-f, --force","Overwrite existing spec.yaml").option("--scan","Force-walk the existing codebase. Default auto-detects (\u22653 source files trigger scan). Use --no-scan to skip even when source is present.").option("--no-llm","Force the deterministic interpreter (skip the LLM dispatcher chain). Intent text falls back to a deterministic quote in project-context.md.").option("--roots ","Override scanner source roots, comma-separated (e.g. packages/a/src,packages/b/src). Otherwise inferred from manifests + directory heuristics.").option("--with-hook","Install git pre-commit (cheap tier) AND pre-push (strict tier) hooks. Opt-in; cladding never touches .git without it.").option("--with-ci","Scaffold .github/workflows/cladding.yml running the strict pre-push gate \u2014 the authoritative enforcement layer.").option("--json","emit the raw InitResult for tooling; default is the human-readable surface").action(e5e),t.command("run [goal]").description("(experimental) Headless autonomous loop \u2014 iterate ready features, dispatch developer + reviewer personas, run L1 gates, record evidence. The supported, exercised path is host-delegated (clad serve + your AI host loops the cadence); this loop needs a real LLM transport and is not auto-invoked").option("--cwd ","target project directory (default cwd)").option("--max-iterations ","cap iterations (default 50)","50").option("--max-wall-clock-ms ","cap wall clock (default 600000)","600000").option("--max-retries ","cap retries per feature (default 3)","3").option("--json","emit the raw internal result (Iron Core view); default is a plain Soft Shell summary").action(t5e),t.command("sync").description("Validate spec.yaml against schema and report").option("--propose-archive","list STALE_SPECIFICATION findings whose suggestion.action is propose-archive (Phased Decommissioning Tier 2)").action(r5e),t.command("setup").description("Activate Cladding only for the current project (Claude Code / Codex / Gemini / Antigravity / Cursor)").option("--project ","activate a project other than the current directory").option("--host ","activate detected hosts (default), all, or one of: claude, codex, gemini, antigravity, cursor").option("--force","replace an existing conflicting cladding-owned project entry").option("--quiet","suppress stdout output").action(o5e),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: refresh project host wiring + sync inventory + refresh managed CLAUDE.md/AGENTS.md, then report stricter detector findings").action(s5e),t.command("check").description("Run every Iron Law stage and the drift detector suite").option("--internal","show stage codes (`stage_1.1`) instead of names (`Type`)").option("--strict","promote warn-severity drift findings to errors (CI / pre-publish gate)").option("--tier ","run only the stages for a trigger: pre-commit (drift/arch/secret) | pre-push (+ type/lint/unit/cov/spec-conformance/deliverable-smoke) | all (default; full 15-stage gate, used by CI)").option("--json","emit structured per-stage results (machine-readable: findings with file/line/suggestion, untruncated) \u2014 for agents/CI; cuts RED\u2192fix round-trips").option("--feature ","scope the gate to this feature's modules[] (Gradle monorepos): runs only :project: tasks instead of the root aggregate. No-op for non-Gradle repos or modules-less features").action(f5e),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(n5e),t.command("done ").description("Mark a feature done ONLY if `clad check --tier=pre-push --strict` is GREEN (flip \u2192 gate \u2192 revert-on-red). Keeps `done` honest.").action(p5e),t.command("oracle [featureId]").description("Print the impl-blind oracle authoring brief (acceptance criteria + signatures, never the implementation). Hand it to a fresh blind sub-agent; record the result with clad_author_oracle. cladding calls no LLM. Use --required to list which done ACs the project policy needs an oracle for.").option("--ac ","restrict the brief to a single acceptance criterion").option("--required","list the done ACs the oracle_policy / require_oracles requires an oracle for (worklist), instead of a brief").option("--cwd ","project root (defaults to .)").action((r,n)=>m5e(r,n)),t.command("rollback ").description("Record a rollback event and print the maintainer-runnable git command for the latest checkpoint").option("-r, --reason ","optional free-text reason recorded on the event payload").action(i5e),t.command("status").description("Render the feature \xD7 stage integrity matrix (business titles; use --internal for raw F-NNN ids)").option("--internal","show internal F-NNN ids and stage codes").option("--json","emit the row model as JSON \u2014 the same feature \xD7 stage integrity matrix rendered to the terminal (columns + per-feature glyph cells), one SSoT for terminal, JSON, and the audit bundle").action(g5e),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(c5e),t.command("impact ").description("Print the blast radius for a change \u2014 what depends on a feature/file + the tests to re-run (F-7794a6bc)").option("--depth ","bound the dependent walk to N hops (default: the full transitive radius)").action((r,n)=>l5e(r,n)),t.command("verdict").description("One-poll loop decision: DONE|ITERATE|ESCALATE|BLOCKED|BOOTSTRAP over the pre-push strict gate + feature statuses (F-2e28cc72). Single gate touch; DONE requires \u22651 non-liveness proof.").option("--json","emit the verdict object as JSON").option("--tier ","gate tier (default pre-push)").action(r=>FX(r,{checkStages:kA})),t.command("infer-deps").description("Suggest feature depends_on edges from the code import graph \u2014 the dependency edges cladding never auto-produced (F-2be3e3bb). Prints reviewable suggestions; does not write the spec.").option("--ambiguity ","emit edges for imports owned by \u2264 N features (default 1 = unambiguous single-owner only)").action(r=>u5e(r)),t.command("measure").description("Report the search + context efficiency the graph provides per feature \u2014 working-set tokens vs the naive baseline, dependency depth/edges resolved, regression-set coverage (F-16138071). Deterministic; no agent.").option("--json","emit the full report as JSON").option("--sessions","summarize recorded value-delivery telemetry instead \u2014 impact-card fire rate over eligible edits, the per-reason skip histogram, and MCP read-serve counts. Measures DELIVERY (did the surfaces fire), NOT adoption (F-6ba22c5c).").option("--trend [n]","render the last N (default 5) recorded measure snapshots with signed deltas \u2014 spot efficiency drift over time from the deduped .cladding/measure.jsonl ledger (F-39609db4)").action(r=>d5e(r));let e=t.command("graph").description("Render the spec\u2194code\u2194doc knowledge graph for a viewer, or report its shape (F-569f4b37)");return e.command("export").description("Export the graph: mermaid/dot/json to stdout, or an Obsidian vault to --out").option("--format ","mermaid | dot | json | obsidian | html (default: mermaid). html = a single self-contained offline viewer (requires --out)").option("--focus ","restrict to a feature/file node\u2019s neighborhood (id, slug, or module path)").option("--depth ","neighborhood radius around --focus (default: unbounded)").option("--out ","write to a file (or, for obsidian, a vault dir \u2014 default .cladding/graph)").action(r=>cte(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>lte()),e.command("serve").description("Serve a LIVE graph at localhost \u2014 recomputes on each load + auto-reloads on spec/doc changes (F-64a5c159)").option("--port ","port to listen on (default 3000)").action(r=>{ute(r)}),t.command("changelog").description("Render shipped changes since a git ref into human-facing documents (F-904495a5). Default: capability-grouped markdown from feature titles + acceptance sentences (no internal ids). --json emits the deterministic manifest hosts render release notes from; --audit the id-keeping verification table; --catalog the full capability \u2192 feature \u2192 acceptance catalog.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--json","print the deterministic ChangelogManifest as JSON (byte-identical across runs on the same state)").option("--audit","print the audit table \u2014 feature | AC | EARS | verification refs, each marked resolved \u2713/\u2717").option("--catalog","print the full capability \u2192 feature \u2192 acceptance listing of the living spec (no git range)").option("--measure","embed the release's own re-derivable measurement \u2014 but ONLY a snapshot taken at the current HEAD; no match renders a not-measured notice, never an older snapshot (F-ede6fa75)").action(r=>fG(r)),t.command("report").description("Render one deterministic review packet for a git range (F-f6cc5e5a) \u2014 spec-shard movement (from the changelog), changed source files resolved to their owning features via the reverse index, the deduped regression set, and gate + attestation state. For PR reviewers, team-leads, and auditors: it RENDERS, it gates nothing. Byte-identical across two runs on the same repository state.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--format ","md (default, the four-section markdown packet) | sarif (SARIF 2.1.0 \u2014 one result per error/warn drift finding, for code-scanning UIs) | json (the raw deterministic model)").action(r=>wY(r)),t.command("bundle").description("Write ONE self-contained HTML audit bundle (F-e940fffe) a non-coder can double-click \u2014 offline, zero network, no CDN, no scripts. Contains the project header + inventory, the feature \xD7 stage matrix, the capability catalog, shipped changes for the range, the audit table with resolved refs, and the attestation summary, under a provenance banner (git HEAD, date, version). Deterministic modulo the date stamp. If no anchor ref resolves, the changelog + audit sections show an omitted notice while the rest still renders.").requiredOption("--out ","destination path for the HTML bundle").option("--since ","git ref to diff shipped changes from (default: the latest tag via `git describe --tags --abbrev=0`)").action(r=>_5e(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(b5e),t.command("hook ").description("Host hook protocol adapter \u2014 consume one host lifecycle event (SessionStart | UserPromptSubmit | PreToolUse | PostToolUse | Stop) as stdin JSON and print the protocol response on stdout. Always exits 0 so a hook failure never bricks the host session.").action(OX),t.command("serve").description("Run cladding as an MCP server over stdio \u2014 tools/resources/prompts for any MCP client").option("--cwd ","project directory exposed to the client (default cwd)").action(Q8e),t.command("doctor").description("Summarise .cladding/events.log.jsonl \u2014 sentinel-miss frequency by phase/cause/fallback plus the top missed sentinels (LLM dispatcher health check)").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").option("--hosts","smoke-test host CLIs (Claude Code / Gemini / Antigravity / Codex / Cursor) and project wiring \u2192 dated artifact + docs/dogfood/matrix.md. Live LLM prompts run only with consent (CLAD_HOST_SMOKE=1 or --yes); otherwise not-run").option("--yes","grant live-run consent for --hosts (equivalent to CLAD_HOST_SMOKE=1)").option("--matrix-only","regenerate docs/dogfood/matrix.md from the newest host-smoke artifact without any probing").action(r=>{if(r.hosts||r.matrixOnly){YY({cwd:r.cwd,yes:r.yes,matrixOnly:r.matrixOnly});return}kY(r)}),t.command("clarify [answer...]").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, free text in any language, e.g. `clad clarify B2B only`); the LLM refines spec/docs based on the full Q-A history and may emit new follow-up questions. Reads/writes `.cladding/onboarding/state.yaml`. Requires `clad init ` to have started a session first.").option("--cwd ","project directory containing .cladding/onboarding/state.yaml (default cwd)").option("--no-llm","force the deterministic interpreter (preserves current artifacts, logs the answer)").option("--json","emit the raw RefineReport for tooling; default is the human-readable surface").action(Gee),t}var S5e=!!globalThis.__CLADDING_BUNDLED,w5e=S5e||import.meta.url===`file://${G.argv[1]}`;w5e&&v5e().parse();export{a5e as TIER_STAGES,v5e as createProgram,_5e as runBundleCommand,f5e as runCheckCommand,kA as runCheckStages,n5e as runCheckpointCommand,c5e as runContextCommand,p5e as runDoneCommand,l5e as runImpactCommand,u5e as runInferDepsCommand,e5e as runInitCommand,d5e as runMeasureCommand,m5e as runOracleCommand,i5e as runRollbackCommand,b5e as runRouteCommand,t5e as runRunCommand,Q8e as runServeCommand,o5e as runSetupCommand,g5e as runStatusCommand,r5e as runSyncCommand,s5e as runUpdateCommand}; +`),G.exit(0)}function y5e(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function _5e(t){let e=t.cwd??".",r=(t.out??"").trim();if(r.length===0){L("fail","bundle","missing --out \u2014 the bundle needs a destination path"),G.exit(1);return}let n;try{let i=q(e),o=Qx(i,e),s={gitHead:va(e),version:Xl(),generatedAt:t.now??new Date().toISOString()},a=gl(i),c;try{let l=t.since??rs(e),u=ns(e,l);c={kind:"present",sinceRef:l,changelogMarkdown:ml(u),auditMarkdown:hl(u,i,e)}}catch(l){c={kind:"omitted",reason:l.message}}n=kG({spec:i,panel:o,provenance:s,catalogMarkdown:a,changes:c})}catch(i){L("fail","bundle",i.message),G.exit(1);return}try{X8e(r,n,"utf8")}catch(i){L("fail","bundle",`could not write ${r}: ${i.message}`),G.exit(1);return}L("pass","bundle",`${r} \xB7 ${y5e(Buffer.byteLength(n,"utf8"))}`),G.exit(0)}function b5e(t){let e=HA(t);L("note",`route \u2192 ${e}`,t),G.exit(e==="unknown"?1:0)}function v5e(){let t=new x4;t.name("clad").description("Reference Ironclad CLI").version("0.9.1"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init payment SaaS for B2B` \u2014 free text in any language) to drive intent-aware onboarding \u2014 the LLM dispatcher then produces domain-aware capabilities/architecture/project-context plus product-level follow-up questions. Bare `clad init` keeps the v0.3.42 behaviour (greenfield seeds, or observed scan when \u22653 source files exist).").option("-n, --name ","Project name (default: cwd basename)").option("-f, --force","Overwrite existing spec.yaml").option("--scan","Force-walk the existing codebase. Default auto-detects (\u22653 source files trigger scan). Use --no-scan to skip even when source is present.").option("--no-llm","Force the deterministic interpreter (skip the LLM dispatcher chain). Intent text falls back to a deterministic quote in project-context.md.").option("--roots ","Override scanner source roots, comma-separated (e.g. packages/a/src,packages/b/src). Otherwise inferred from manifests + directory heuristics.").option("--with-hook","Install git pre-commit (cheap tier) AND pre-push (strict tier) hooks. Opt-in; cladding never touches .git without it.").option("--with-ci","Scaffold .github/workflows/cladding.yml running the strict pre-push gate \u2014 the authoritative enforcement layer.").option("--json","emit the raw InitResult for tooling; default is the human-readable surface").action(e5e),t.command("run [goal]").description("(experimental) Headless autonomous loop \u2014 iterate ready features, dispatch developer + reviewer personas, run L1 gates, record evidence. The supported, exercised path is host-delegated (clad serve + your AI host loops the cadence); this loop needs a real LLM transport and is not auto-invoked").option("--cwd ","target project directory (default cwd)").option("--max-iterations ","cap iterations (default 50)","50").option("--max-wall-clock-ms ","cap wall clock (default 600000)","600000").option("--max-retries ","cap retries per feature (default 3)","3").option("--json","emit the raw internal result (Iron Core view); default is a plain Soft Shell summary").action(t5e),t.command("sync").description("Validate spec.yaml against schema and report").option("--propose-archive","list STALE_SPECIFICATION findings whose suggestion.action is propose-archive (Phased Decommissioning Tier 2)").action(r5e),t.command("setup").description("Activate Cladding only for the current project (Claude Code / Codex / Gemini / Antigravity / Cursor)").option("--project ","activate a project other than the current directory").option("--host ","activate detected hosts (default), all, or one of: claude, codex, gemini, antigravity, cursor").option("--force","replace an existing conflicting cladding-owned project entry").option("--quiet","suppress stdout output").action(o5e),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: refresh project host wiring + sync inventory + refresh managed CLAUDE.md/AGENTS.md, then report stricter detector findings").action(s5e),t.command("check").description("Run every Iron Law stage and the drift detector suite").option("--internal","show stage codes (`stage_1.1`) instead of names (`Type`)").option("--strict","promote warn-severity drift findings to errors (CI / pre-publish gate)").option("--tier ","run only the stages for a trigger: pre-commit (drift/arch/secret) | pre-push (+ type/lint/unit/cov/spec-conformance/deliverable-smoke) | all (default; full 15-stage gate, used by CI)").option("--json","emit structured per-stage results (machine-readable: findings with file/line/suggestion, untruncated) \u2014 for agents/CI; cuts RED\u2192fix round-trips").option("--feature ","scope the gate to this feature's modules[] (Gradle monorepos): runs only :project: tasks instead of the root aggregate. No-op for non-Gradle repos or modules-less features").action(f5e),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(n5e),t.command("done ").description("Mark a feature done ONLY if `clad check --tier=pre-push --strict` is GREEN (flip \u2192 gate \u2192 revert-on-red). Keeps `done` honest.").action(p5e),t.command("oracle [featureId]").description("Print the impl-blind oracle authoring brief (acceptance criteria + signatures, never the implementation). Hand it to a fresh blind sub-agent; record the result with clad_author_oracle. cladding calls no LLM. Use --required to list which done ACs the project policy needs an oracle for.").option("--ac ","restrict the brief to a single acceptance criterion").option("--required","list the done ACs the oracle_policy / require_oracles requires an oracle for (worklist), instead of a brief").option("--cwd ","project root (defaults to .)").action((r,n)=>m5e(r,n)),t.command("rollback ").description("Record a rollback event and print the maintainer-runnable git command for the latest checkpoint").option("-r, --reason ","optional free-text reason recorded on the event payload").action(i5e),t.command("status").description("Render the feature \xD7 stage integrity matrix (business titles; use --internal for raw F-NNN ids)").option("--internal","show internal F-NNN ids and stage codes").option("--json","emit the row model as JSON \u2014 the same feature \xD7 stage integrity matrix rendered to the terminal (columns + per-feature glyph cells), one SSoT for terminal, JSON, and the audit bundle").action(g5e),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(c5e),t.command("impact ").description("Print the blast radius for a change \u2014 what depends on a feature/file + the tests to re-run (F-7794a6bc)").option("--depth ","bound the dependent walk to N hops (default: the full transitive radius)").action((r,n)=>l5e(r,n)),t.command("verdict").description("One-poll loop decision: DONE|ITERATE|ESCALATE|BLOCKED|BOOTSTRAP over the pre-push strict gate + feature statuses (F-2e28cc72). Single gate touch; DONE requires \u22651 non-liveness proof.").option("--json","emit the verdict object as JSON").option("--tier ","gate tier (default pre-push)").action(r=>FX(r,{checkStages:kA})),t.command("infer-deps").description("Suggest feature depends_on edges from the code import graph \u2014 the dependency edges cladding never auto-produced (F-2be3e3bb). Prints reviewable suggestions; does not write the spec.").option("--ambiguity ","emit edges for imports owned by \u2264 N features (default 1 = unambiguous single-owner only)").action(r=>u5e(r)),t.command("measure").description("Report the search + context efficiency the graph provides per feature \u2014 working-set tokens vs the naive baseline, dependency depth/edges resolved, regression-set coverage (F-16138071). Deterministic; no agent.").option("--json","emit the full report as JSON").option("--sessions","summarize recorded value-delivery telemetry instead \u2014 impact-card fire rate over eligible edits, the per-reason skip histogram, and MCP read-serve counts. Measures DELIVERY (did the surfaces fire), NOT adoption (F-6ba22c5c).").option("--trend [n]","render the last N (default 5) recorded measure snapshots with signed deltas \u2014 spot efficiency drift over time from the deduped .cladding/measure.jsonl ledger (F-39609db4)").action(r=>d5e(r));let e=t.command("graph").description("Render the spec\u2194code\u2194doc knowledge graph for a viewer, or report its shape (F-569f4b37)");return e.command("export").description("Export the graph: mermaid/dot/json to stdout, or an Obsidian vault to --out").option("--format ","mermaid | dot | json | obsidian | html (default: mermaid). html = a single self-contained offline viewer (requires --out)").option("--focus ","restrict to a feature/file node\u2019s neighborhood (id, slug, or module path)").option("--depth ","neighborhood radius around --focus (default: unbounded)").option("--out ","write to a file (or, for obsidian, a vault dir \u2014 default .cladding/graph)").action(r=>cte(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>lte()),e.command("serve").description("Serve a LIVE graph at localhost \u2014 recomputes on each load + auto-reloads on spec/doc changes (F-64a5c159)").option("--port ","port to listen on (default 3000)").action(r=>{ute(r)}),t.command("changelog").description("Render shipped changes since a git ref into human-facing documents (F-904495a5). Default: capability-grouped markdown from feature titles + acceptance sentences (no internal ids). --json emits the deterministic manifest hosts render release notes from; --audit the id-keeping verification table; --catalog the full capability \u2192 feature \u2192 acceptance catalog.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--json","print the deterministic ChangelogManifest as JSON (byte-identical across runs on the same state)").option("--audit","print the audit table \u2014 feature | AC | EARS | verification refs, each marked resolved \u2713/\u2717").option("--catalog","print the full capability \u2192 feature \u2192 acceptance listing of the living spec (no git range)").option("--measure","embed the release's own re-derivable measurement \u2014 but ONLY a snapshot taken at the current HEAD; no match renders a not-measured notice, never an older snapshot (F-ede6fa75)").action(r=>fG(r)),t.command("report").description("Render one deterministic review packet for a git range (F-f6cc5e5a) \u2014 spec-shard movement (from the changelog), changed source files resolved to their owning features via the reverse index, the deduped regression set, and gate + attestation state. For PR reviewers, team-leads, and auditors: it RENDERS, it gates nothing. Byte-identical across two runs on the same repository state.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--format ","md (default, the four-section markdown packet) | sarif (SARIF 2.1.0 \u2014 one result per error/warn drift finding, for code-scanning UIs) | json (the raw deterministic model)").action(r=>wY(r)),t.command("bundle").description("Write ONE self-contained HTML audit bundle (F-e940fffe) a non-coder can double-click \u2014 offline, zero network, no CDN, no scripts. Contains the project header + inventory, the feature \xD7 stage matrix, the capability catalog, shipped changes for the range, the audit table with resolved refs, and the attestation summary, under a provenance banner (git HEAD, date, version). Deterministic modulo the date stamp. If no anchor ref resolves, the changelog + audit sections show an omitted notice while the rest still renders.").requiredOption("--out ","destination path for the HTML bundle").option("--since ","git ref to diff shipped changes from (default: the latest tag via `git describe --tags --abbrev=0`)").action(r=>_5e(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(b5e),t.command("hook ").description("Host hook protocol adapter \u2014 consume one host lifecycle event (SessionStart | UserPromptSubmit | PreToolUse | PostToolUse | Stop) as stdin JSON and print the protocol response on stdout. Always exits 0 so a hook failure never bricks the host session.").action(OX),t.command("serve").description("Run cladding as an MCP server over stdio \u2014 tools/resources/prompts for any MCP client").option("--cwd ","project directory exposed to the client (default cwd)").action(Q8e),t.command("doctor").description("Summarise .cladding/events.log.jsonl \u2014 sentinel-miss frequency by phase/cause/fallback plus the top missed sentinels (LLM dispatcher health check)").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").option("--hosts","smoke-test host CLIs (Claude Code / Gemini / Antigravity / Codex / Cursor) and project wiring \u2192 dated artifact + docs/dogfood/matrix.md. Live LLM prompts run only with consent (CLAD_HOST_SMOKE=1 or --yes); otherwise not-run").option("--yes","grant live-run consent for --hosts (equivalent to CLAD_HOST_SMOKE=1)").option("--matrix-only","regenerate docs/dogfood/matrix.md from the newest host-smoke artifact without any probing").action(r=>{if(r.hosts||r.matrixOnly){YY({cwd:r.cwd,yes:r.yes,matrixOnly:r.matrixOnly});return}kY(r)}),t.command("clarify [answer...]").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, free text in any language, e.g. `clad clarify B2B only`); the LLM refines spec/docs based on the full Q-A history and may emit new follow-up questions. Reads/writes `.cladding/onboarding/state.yaml`. Requires `clad init ` to have started a session first.").option("--cwd ","project directory containing .cladding/onboarding/state.yaml (default cwd)").option("--no-llm","force the deterministic interpreter (preserves current artifacts, logs the answer)").option("--json","emit the raw RefineReport for tooling; default is the human-readable surface").action(Gee),t}var S5e=!!globalThis.__CLADDING_BUNDLED,w5e=S5e||import.meta.url===`file://${G.argv[1]}`;w5e&&v5e().parse();export{a5e as TIER_STAGES,v5e as createProgram,_5e as runBundleCommand,f5e as runCheckCommand,kA as runCheckStages,n5e as runCheckpointCommand,c5e as runContextCommand,p5e as runDoneCommand,l5e as runImpactCommand,u5e as runInferDepsCommand,e5e as runInitCommand,d5e as runMeasureCommand,m5e as runOracleCommand,i5e as runRollbackCommand,b5e as runRouteCommand,t5e as runRunCommand,Q8e as runServeCommand,o5e as runSetupCommand,g5e as runStatusCommand,r5e as runSyncCommand,s5e as runUpdateCommand}; diff --git a/plugins/codex/.codex-plugin/plugin.json b/plugins/codex/.codex-plugin/plugin.json index f2d4db2..8f3a1e0 100644 --- a/plugins/codex/.codex-plugin/plugin.json +++ b/plugins/codex/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "cladding", - "version": "0.9.0", + "version": "0.9.1", "description": "Reference implementation of the Ironclad standard — multi-agent dev harness for OpenAI Codex CLI / IDE / cloud. Exposes spec validation, drift detection, the Iron Law stage runner, and 5 agent personas as Codex skills + an auto-launched MCP server.", "author": { "name": "qwerfunch", diff --git a/plugins/gemini-cli/gemini-extension.json b/plugins/gemini-cli/gemini-extension.json index bf5cf11..a20d7a3 100644 --- a/plugins/gemini-cli/gemini-extension.json +++ b/plugins/gemini-cli/gemini-extension.json @@ -1,6 +1,6 @@ { "name": "cladding", - "version": "0.9.0", + "version": "0.9.1", "description": "Reference implementation of the Ironclad standard — multi-agent dev harness for Gemini CLI. Exposes spec validation, drift detection, 15 Iron Law stages, and 5 agent personas as custom commands + an auto-launched MCP server.", "contextFileName": "GEMINI.md", "mcpServers": { diff --git a/spec.yaml b/spec.yaml index 75a3ef9..c7444b7 100644 --- a/spec.yaml +++ b/spec.yaml @@ -11,7 +11,7 @@ project: name: cladding language: typescript description: "Reference implementation of the Ironclad harness for AI-coupled software." - version: "0.9.0" + version: "0.9.1" repository: "https://github.com/qwerfunch/cladding" intent_summary: "Make AI-coupled development measurably safer and more honest — 41 drift detectors + 4-tier SSoT governance + A/B-measurable cladding-vs-vanilla evaluation." deliverable: diff --git a/spec/attestation.yaml b/spec/attestation.yaml index 260822c..a36e8d8 100644 --- a/spec/attestation.yaml +++ b/spec/attestation.yaml @@ -17,7 +17,7 @@ attested_modules: .claude/settings.json: d0bba3583aef0960 .github/workflows/ci.yml: 8ea99219cb80df60 .gitignore: 1294975ba3b47043 - CHANGELOG.md: 9580bab8d2c2d6f3 + CHANGELOG.md: c3353cc4baf17ec7 CLAUDE.md: 16212c1749e6005d GOVERNANCE.md: 21cc28eaaf637a20 README.html: f9378f61e0073367 @@ -67,9 +67,9 @@ attested_modules: docs/spec-ids-multi-dev.md: 28d58e84879f58b1 docs/ssot-model.md: 66b9439e2f71ac4b docs/ssot-testing.md: abf3b2bd5acb29a1 - package-lock.json: 84fce6dd31da5308 - package.json: fb5fc393fb3f5e49 - plugins/claude-code/.claude-plugin/plugin.json: 3ece00e95ac4e232 + package-lock.json: dc094f923ab99ab8 + package.json: 5fc7fe2a9f18a959 + plugins/claude-code/.claude-plugin/plugin.json: 4daaab360fbbea9e plugins/claude-code/agents/developer.md: 40af2943253f6c72 plugins/claude-code/agents/observability.md: 5ea8f14b1c9b4a61 plugins/claude-code/agents/orchestrator.md: 443c6e13ade590cf @@ -77,7 +77,7 @@ attested_modules: plugins/claude-code/agents/reviewer.md: 9c4e095e60040473 plugins/claude-code/commands/init.md: 5529b13d0f1ab4bf plugins/claude-code/hooks/hooks.json: 42321ead26fb1da8 - plugins/codex/.codex-plugin/plugin.json: 26d1bc595d1b996a + plugins/codex/.codex-plugin/plugin.json: 835ff6366182f1ea plugins/codex/.mcp.json: 43e3f4b2af24aa18 plugins/codex/skills/check/SKILL.md: 6a665422af510e72 plugins/codex/skills/developer/SKILL.md: 40af2943253f6c72 @@ -93,7 +93,7 @@ attested_modules: plugins/gemini-cli/GEMINI.md: ba08eaf2cd557a65 plugins/gemini-cli/commands/README.md: 3527d771578431bd plugins/gemini-cli/commands/init.toml: e7f310fd7af23f95 - plugins/gemini-cli/gemini-extension.json: 9d2f839716b55869 + plugins/gemini-cli/gemini-extension.json: 85ff27830d2db32e scripts/build-plugin.mjs: 7fabe2b6301b142a scripts/build.mjs: 3a4b204063024ef1 scripts/migrate-dogfood-v0.3.16.mjs: 1e265fb370019996 @@ -113,7 +113,7 @@ attested_modules: skills/serve/SKILL.md: f08bbdbbfeb05041 skills/status/SKILL.md: 09faadc50b3449da skills/sync/SKILL.md: 775c0f990a52a3d9 - spec.yaml: 33dc47a833bc0bb7 + spec.yaml: f3b85cd5c92644ce spec/README.md: 7c257426396d435c spec/architecture.yaml: f0888480405a13a8 spec/features/: a4d0f0eb87fed960 @@ -146,7 +146,7 @@ attested_modules: src/cli: a4d0f0eb87fed960 src/cli/benchmark.ts: 77f84d2a898d724f src/cli/changelog.ts: 2de1adb009b89ab4 - src/cli/clad.ts: 6a45fa2924292697 + src/cli/clad.ts: e882d44ef304fce0 src/cli/clarify.ts: f17177969d5b75ff src/cli/doctor-hosts.ts: 1f0c2cec5a310b81 src/cli/doctor.ts: b98b955fe75e7f7e @@ -228,7 +228,7 @@ attested_modules: src/report/sarif.ts: 71e97aceeb0a4473 src/router: a4d0f0eb87fed960 src/router/intent.ts: 430590f761b891a6 - src/serve/server.ts: 4b2d0b94854d3fb5 + src/serve/server.ts: db452db2b4366605 src/spec: a4d0f0eb87fed960 src/spec/attestation.ts: 294a1e99c42d4aef src/spec/cli.ts: 7a9bcd0f66677810 @@ -335,7 +335,7 @@ attested_modules: tests/adapters/transport.test.ts: 68f22e9e8df7b813 tests/agents/loader.test.ts: a7df7b1c9a95d37d tests/cli/benchmark.test.ts: b4a87289605ee75f - tests/cli/clad.test.ts: 19a2f5950d84da42 + tests/cli/clad.test.ts: 7c61f7d2e759f792 tests/cli/gate-golden-matrix.test.ts: 39cf615407a55abe tests/cli/init.test.ts: 3428a89708fc9330 tests/cli/intent-onboarding.test.ts: 0681b98ce2e74c22 diff --git a/src/cli/clad.ts b/src/cli/clad.ts index 227f165..5eeac08 100644 --- a/src/cli/clad.ts +++ b/src/cli/clad.ts @@ -1050,7 +1050,7 @@ export function runRouteCommand(prompt: string): void { */ export function createProgram(): Command { const program = new Command(); - program.name('clad').description('Reference Ironclad CLI').version('0.9.0'); + program.name('clad').description('Reference Ironclad CLI').version('0.9.1'); program .command('init [intent...]') diff --git a/src/serve/server.ts b/src/serve/server.ts index eebae42..76869c8 100644 --- a/src/serve/server.ts +++ b/src/serve/server.ts @@ -174,7 +174,7 @@ export function buildServer(opts: ServerOptions = {}): McpServer { const server = new McpServer( { name: opts.name ?? 'cladding', - version: opts.version ?? '0.9.0', + version: opts.version ?? '0.9.1', }, { instructions: diff --git a/tests/cli/clad.test.ts b/tests/cli/clad.test.ts index 3e54a8a..8399728 100644 --- a/tests/cli/clad.test.ts +++ b/tests/cli/clad.test.ts @@ -561,7 +561,7 @@ describe('cli/clad — createProgram', () => { test('program version matches current package version', () => { const program = clad.createProgram(); - expect(program.version()).toBe('0.9.0'); + expect(program.version()).toBe('0.9.1'); }); });